Definitely doesn't override by default; the first defined in an applicationDomain wins out.
In AS2, you can _delete_ an existing class definition, so that classes loaded afterwards overwrite. But that's probably not helpful in most cases, and I certainly wouldn't recommend it. Ian On Mon, May 12, 2008 at 4:00 PM, Jonathan Valliere <[EMAIL PROTECTED]> wrote: > Duno, pretty sure i've seen that behavior in some version of flash. I've > seen that behavior in Java. > > > > On Mon, May 12, 2008 at 9:00 AM, <[EMAIL PROTECTED]> wrote: > > > IMHO, there is no way to override a class like that, the last loaded > instance of C will be skipped. > > The previous one will be used. > > ----- Mail Original ----- > > De: "Jonathan Valliere" <[EMAIL PROTECTED]> > > > > À: "Open Source Flash Mailing List" <[email protected]> > > Envoyé: Lundi 12 Mai 2008 14:32:48 GMT +01:00 Amsterdam / Berlin / Berne / > Rome / Stockholm / Vienne > > > > Objet: Re: [osflash] Class definitions > > > > > > > > > > The last loaded instance of Class C within a applicationDomain will > override > > the previous one. So you can specify a new applicationDomain or expect > the > > over-ride behavior > > > > On Fri, May 9, 2008 at 11:50 AM, Niels Wolf <[EMAIL PROTECTED]> > > wrote: > > > > > Hey. > > > > > > I am looking into following scenario: > > > > > > SWF A loads other SWF B. > > > > > > A defines class C. > > > B defines class C. > > > > > > If B calls on C it gets C from A! > > > > > > example: > > > > > > B.swf > > > package{ > > > import flash.text.TextField; > > > import flash.display.Sprite; > > > import flash.display.Loader; > > > import flash.net.URLRequest; > > > > > > public class C extends Sprite{ > > > private var variable:String = "I am C from B"; > > > > > > public function C(){ > > > trace(variable); > > > var txt:TextField = new TextField(); > > > txt.text = variable; > > > addChild(txt); > > > } > > > > > > } > > > } > > > > > > A.swf > > > package{ > > > import flash.text.TextField; > > > import flash.display.Sprite; > > > import flash.display.Loader; > > > import flash.net.URLRequest; > > > > > > public class C extends Sprite{ > > > private var variable:String = "I am C from A"; > > > > > > public function C(){ > > > trace(variable); > > > var txt:TextField = new TextField(); > > > txt.text = variable; > > > addChild(txt); > > > > > > var loader:Loader = new Loader(); > > > loader.load(new URLRequest("B.swf")); > > > } > > > > > > } > > > } > > > > > > RUN A.swf outputs: > > > I am C from A > > > I am C from A > > > I am C from A > > > I am C from A > > > ... > > > > > > > > > Even as it sounds natural it implies mayor restrictions if your project > > > requires nested swf loading. > > > > > > Is there a way to seal class definitions from each other but not objects > > > (as > > > the nested swfs have to talk to each other.. Though localconnection > could > > > be > > > an awkward answer). > > > > > > Comments are welcome. > > > > > > Thanks > > > > > > \n > > > > > > > > > _______________________________________________ > > > osflash mailing list > > > [email protected] > > > http://osflash.org/mailman/listinfo/osflash_osflash.org > > > > > > > _______________________________________________ > > osflash mailing list > > [email protected] > > http://osflash.org/mailman/listinfo/osflash_osflash.org > > > > _______________________________________________ > > osflash mailing list > > [email protected] > > http://osflash.org/mailman/listinfo/osflash_osflash.org > > > > > _______________________________________________ > osflash mailing list > [email protected] > http://osflash.org/mailman/listinfo/osflash_osflash.org > > _______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
