FORUMS: list search recent posts

External load a movie clip .Swf in another MC in as3

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
isabel cruces
External load a movie clip .Swf in another MC in as3
on Mar 17, 2010 at 10:32:46 am

I need to know how to load an external swf that is a dropdown menu on my main scene of another mc in as3


Return to posts index

Marcus Geduld
Re: External load a movie clip .Swf in another MC in as3
on Mar 22, 2010 at 4:33:58 pm

Here's the general way to load one swf into another:

//if this code is in a class file, you need to include the following
//import statements. If it's timeline code, you can omit them:
//
// import flash.display.Loader;
// import flash.events.Event;
// import flash.net.URLRequest;

var loader : Loader = new Loader();
loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onLoadComplete);
loader.load( new URLRequest( "address.of.child.swf" ) );

function onLoadComplete( event : Event ) : void
{
addChild( loader );

//if you need to adjust the loaded swf in any way, e.g. change it's
//width and height, do it here:
//loader.width = 150;
//loader.height = 200;
}

I hope that helps!

-----

I am teaching an Actionscript class for non-programmers in NYC on April 3rd. For more info, visit this link: https://accounts.craigslist.org/post/shwpst?pii=1655784737&db=lv

Author "After Effects Expressions"
Co-author "After Effects For Flash, Flash For After Effects"
Artistic Director, Folding Chair Classical Theatre, Inc
Senior Flash Developer, Zeitbyte.com


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]