nevermind, i didn't fully read your example, though it might be a related issue, it's probably not the same...
Although, seeing as they have similar outcomes, maybe what I said will help you in further debugging the isssue. On Thu, Mar 26, 2009 at 12:05 PM, Taka Kojima <[email protected]> wrote: > Not sure if this is the issue, but it sure does sound like it. > > Does embed.swf have a base class? > > The issue I ran into caused all of my timeline code to not execute, > i.e. fail silently, which seems to be what is happening with you. > > The problem was that I couldn't import the external.swf's base class > and type cast the external.swf as that class in the class that loads > it in (if it's a local class casting something as ":Class", you're > importing it)... > > That's a bit of a run-on sentence, and it may or may not make > sense.... i'll give you an example to try to clarify: > > Let's say external.swf's base class is External... > > If you do: > > var _loader:Loader = new Loader(); > _loader.contentLoaderInfo.addEventListener( Event.COMPLETE, loadingComplete ); > _loader.load( new URLRequest( "external.swf" ) ); > > function loadingComplete(e:Event):void{ > addChild(_loader.content); > } > > The timeline code will execute, however, if you do: > > var _loader:Loader = new Loader(); > _loader.contentLoaderInfo.addEventListener( Event.COMPLETE, loadingComplete > );; > _loader.load( new URLRequest( "external.swf" ) ); > > function loadingComplete(e:Event):void{ > var external = External(addChild(_loader.content)); > } > > The timeline code will not execute. > > Obviously, this is a bit of an issue as you cannot correctly typecast > your external swf's and have timeline code run inside of them. > > The way I got around this was changing External to ExternalBase and > then creating a new External class -- I then set the document base > class of external.swf to "External" and typecasted it by doing var > external = ExternalBase(addChild(_loader.content)); > > > Hope this helped. > > On Thu, Mar 26, 2009 at 11:50 AM, Eric Costello <[email protected]> wrote: >> Hello flashcoders, >> >> Consider the following as3 file, built for flash 10 with mxmlc; it >> embeds a swf built with Flash CS4 which contains a simple motion >> tween: >> >> package { >> >> import flash.display.* >> >> public class Test extends MovieClip { >> >> [Embed(source="embed.swf")] >> public var embed:Class; >> >> public function Test():void { >> var m:MovieClip = MovieClip(addChild(new element())); >> m.stop(); // fails >> m.y=100; // works >> } >> >> } >> >> } >> >> Why is m.stop() ignored? No errors generated, it just does not stop >> the embedded swf's timeline from advancing. (All timeline methods fail >> silently: stop, gotoAndStop, etc.) >> >> Any pointers on what I'm doing wrong? >> >> TIA, >> Eric >> _______________________________________________ >> Flashcoders mailing list >> [email protected] >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> > _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

