-
How to access functions in external swfs?
Hey guys, just wondering how actionscript 3.0 deals with accessing functions in external swfs?
In actionscript 2 i would just load the external swf into a movieclip (eg: loader_mc) then i would just say loader_mc.animateIn().
I've tried the same thing in AS3 but it doesnt work... Can anyone tell me the new way of doing it?
Thx
-
-
Do you want to load the swf and call one of its methods or just call one of its methods?
-
Senior Member
You have to use LocalConnection class. Make a search on this keyword on google there are some tutorials out there.
-
Thx for the replies. Im checking out this LocalConnection class but it seems a bit strange. Basically i've already loaded the swf into a movieclip, all i want to do is to call a function called animateIn() which is in the swf i loaded into the movieclip.
Normally it would just be blah_mc.animateIn(). I dont c why they changed it...
-
Code:
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadCompleteHandler);
loader.load(new URLRequest('myMovie.swf'));
function loadCompleteHandler(event:Event):void
{
var movie:* = loader.content;
movie.animateIn();
}
-
If you are loading an AS2 swf, you will need to use something like http://www.gskinner.com/blog/archive...dge_easie.html
-
Sweet thx 2morrowMan. I'll try it out today.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|