all groups > flash actionscript > april 2007 >
You're in the

flash actionscript

group:

Writing classes with Fuse



Writing classes with Fuse erokCom
4/18/2007 9:13:35 PM
flash actionscript: Hello friends,

So, I am trying to learn how to write classes. (Same as before)

The IDE say's the Syntax is correct, but it still spits errors in the flash
file.. Here is the code:

import com.mosesSupposes.fuse.*;


class Mover extends MovieClip
{

private var Instance:Mover;
private var targetMC:MovieClip;
private var alphaUp:Number;




public function Mover()
{
Instance = this;
ZigoEngine.simpleSetup( Shortcuts, PennerEasing, Fuse );

trace("The constructor was called");


}

public function startMoving(alphaUp:Number)
{

targetMC.alphaTo(alphaUp, 1);

trace("startMoving was called");
}
}

///////////

And in the flash file I am calling it like:





var myMover:Mover = new Mover();


circle_mc.startMoving(400);


Can someone telll me what I am doing wrong?
Re: Writing classes with Fuse Devdoc
4/19/2007 1:55:51 PM
Well, I don't know anything about fuse, but...

If this is AS2, classes that inherit from the movie clip class can not be
instanced in the normal way. Instead you link a movie clip with the class in
the library and when you run attachMovie() the constructor of your class is run.

So, for the movie clip circle_mc to be able to access the methods of the Mover
class, it has to be an instance of said class.

Good luck, hope that helps a little!
Re: Writing classes with Fuse erokCom
4/20/2007 1:18:23 AM
AddThis Social Bookmark Button