Re: [Flashcoders] another AS 3 question

2006-06-28 Thread Derek Vadneau
You can't, directly.

A SWF8 loaded into a SWF9 ends up being an AVM1Movie Object. You can't 
cast this as a MovieClip. I tried casting it and got a failure during type 
coersion.

The two SWFs can only talk via LocalConnection, or through 
ExternalInterface. You could implement a class on each side to handle the 
conversation through ExternalInterface so that it behaves like two SWF8s.

Of course ExternalInterface requires that you implement code in the 
container/browser.


Derek Vadneau

- Original Message - 
From: Robin Burrer [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Tuesday, June 27, 2006 11:58 PM
Subject: [Flashcoders] another AS 3 question


Hi

How do I control the timeline of a loaded swf file (created with the
Flash 8 IDE) with AS 3? My problem is that the content property of a
Loader object returns me a display object but not a movieclip.

I tried casting but my application crashes when I try to run it.

Any ideas?

Robin


___
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] another AS 3 question

2006-06-27 Thread Robin Burrer
Hi 

How do I control the timeline of a loaded swf file (created with the
Flash 8 IDE) with AS 3? My problem is that the content property of a
Loader object returns me a display object but not a movieclip. 

I tried casting but my application crashes when I try to run it.

Any ideas?

Robin



// here's my callback function, which is executed once the external swf
is // loaded
private function onLoadComplete(event:Event):void
{

 
var myDisplayObject:DisplayObject =
myLoader.content;


// this creates an run time error
loadedSWF = myDisplayObject as MovieClip;
loadedSWF.play();

}

___
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