AS2 code will not work directly with AS3. You'll have to use LocalConnection
to get the two pieces of code to communicate with each other (very ugly). At
this point, you might want to go with one or the other and not both.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael
Mudge
Sent: Saturday, April 07, 2007 6:53 PM
To: flashcoders@chattyfig.figleaf.com
Subject: RE: [Flashcoders] Constructors in AS2 SWFs not being
calledwhenloaded by AS3

> Is there any reason why you aren't porting over the Thingy 
> class from AS2 to AS3? It might be easier to rewrite the 
> class using AS3.

The system I'm making is for featuring other artist's work... Some may
not have Flash 9, and really don't want to require them to use a program
that isn't even out yet... Also, there are some older AS2 apps that will
be adapted to this system.  The reason the base is in AS3 is because I
want to be able to at least support AS3, since I assume it will
eventually dominate, and AS3's got some other functionality that I would
like to incorporate.

That link to AVM1Movie was really interesting -- It definitely has some
very relevant stuff, but I still don't see why AS2 doesn't call the
constructor.  From what I can tell, the instance is created and all
other calls work, but the constructor itself just gets skipped.

Has anyone else tried this?  Would anyone else be willing to try and see
what other information can be gleaned from it?  Would it be proper to
say that this is a bug (rather than a shortcoming) in Flash Player 9?

- Kipp

> On 4/6/07, Michael Mudge <[EMAIL PROTECTED]> wrote:
> >
> > I've got an AS 2.0 (Flash 8) SWF that creates a class, and traces a 
> > property on that class... Something like this:
> >
> > foo = new Thingy();
> > trace(foo.test);
> >
> > All the class does is initialize that property; something 
> like this: 
> > class Thingy {
> >   public var test:String;
> >   public function Thingy() {
> >     test = "hello";
> >   }
> > }
> >
> > This is pretty basic stuff -- and it works as expected.  
> When run, it 
> > simply traces "hello".  I then create an AS3 / Flash 9 app 
> that loads 
> > the aforementioned SWF... Something like this:
> >
> > As2thing = new Loader();
> > addChild(As2thing);
> > As2thing.load(new URLRequest("as2thing.swf"));
> >
> > Then suddenly, as2thing.swf doesn't quite behave the same; the 
> > Thingy's constructor doesn't get called -- it traces "undefined" 
> > instead.  Any idea why?
> >
> > - Kipp
> >
> > _______________________________________________
> > Flashcoders@chattyfig.figleaf.com
> > To change your subscription options or search the archive: 
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> > Brought to you by Fig Leaf Software
> > Premier Authorized Adobe Consulting and Training 
> > http://www.figleaf.com http://training.figleaf.com
> >
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive: 
> http://chattyfig.figleaf.com/mailman/listinfo/> flashcoders
> 
> 
> Brought to you by Fig Leaf Software
> Premier 
> Authorized Adobe Consulting and Training 
> http://www.figleaf.com > http://training.figleaf.com
> 

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to