[haXe] AS2 registerClass MovieClip
eka
ekameleon at gmail.com
Sun Apr 29 01:20:07 CEST 2007
Hello :)
you want pass arguments in the constructor ? or with the init object like
the last argument in the attachMovie method ?
To pass the arguments in the constructor :
MyClass.call(mc, arg1, arg2, arg...., argN ) ;
or
MyClass.apply(mc, [arg1, arg2, arg...., argN] ) ;
if you want initialize the properties :
var init = { _x : 25 , _y : 40 }
for (var prop:String in init )
{
mc[prop] = init[prop] ;
}
In AS2 i use my personnal class DisplayFactory (in VEGAS my openSource
framework... i wait the time to test the as2toHaxe application to creates
the haxe version of my framework)
http://svn.riaforge.org/vegas/AS2/trunk/src/vegas/util/factory/DisplayFactory.as
Page of the projects :
- http://vegas.riaforge.org/
Installation in the google code page project of VEGAS :
- http://code.google.com/p/vegas/
EKA+ :)
2007/4/28, filt3r at free.fr <filt3r at free.fr>:
>
> Re :)
> Sorry ... it works fine, but i have to pass the arguments to .
>
> Selon eka <ekameleon at gmail.com>:
>
> > Hello :)
> >
> > for me .. you must use the __proto__ object
> >
> > mc.__proto__ = MyClass.prototype ; // change the MovieClip prototype
> > reference of your instance with the MyClass prototype
> > MyClass.call(mc) ; // launch the constructor if you want initialize your
> > instance with this constructor
> >
> > EKA+ :)
> >
> > 2007/4/28, filt3r at free.fr <filt3r at free.fr>:
> > >
> > > Hi all !
> > > I'm looking for a trick to instanciate a class which extends
> MovieClip.
> > > I can instanciate it but it doesnt appear on the stage :(
> > > There was a trick in AS2:
> > >
> > >
> >
>
> http://www.peterjoel.com/blog/index.php?archive=2004_01_01_archive.xml#107550841406346131
> > >
> > > Maybe is there another trich in haXe ?
> > > Thanks,
> > > Michel
> > >
> > > --
> > > haXe - an open source web programming language
> > > http://haxe.org
> > >
> >
>
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/haxe/attachments/20070429/f1d6c79e/attachment.htm
More information about the Haxe
mailing list