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

flash actionscript

group:

Constructor of class the inherit MovieClip


Constructor of class the inherit MovieClip ArieKo
4/15/2004 10:56:09 PM
flash actionscript:
I am linking a movie clip with a class the extends it.
The constructor of this class should get parameters.
Re: Constructor of class the inherit MovieClip OPSpam
7/17/2004 6:37:32 AM
I'm not certain, but I believe you can not pass values via the constructor.
The only way I know to achieve what you want is to use the Initialize
functionality of the attachMovie(). Try this instead. (code may have bugs)

var myClip = _root.createEmptyMovieClip("theInstance", 1);
myClip.attachMovie("MyClass", "theInstance", 1,
{myProperty1:"hi",myProperty2:0));

// asuming your class had two properties, myProperty1 and myProperty2, they
will be initialized upon creation.

Does this help?

- Omegus Prime Development Team
AddThis Social Bookmark Button