A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: [RESOLVED] How to load external swf into movieclip?

Threaded View

  1. #1
    Senior Member
    Join Date
    Mar 2007
    Posts
    133

    [RESOLVED] How to load external swf into movieclip?

    Hey guys,

    I've decided to take the jump to AS3 now but im having a lot of issues... Im trying to load an external swf into a movieclip.

    In AS2 it would be:

    PHP Code:
    var mcLoader:MovieClipLoader = new MovieClipLoader();
    var 
    myListener:Object = new Object ();
    mcLoader.addListener(myListener);
    mcLoader.loadClip("mainLoader.swf","externalLoader_mc"); 
    In AS3 atm i have (taken from tutorial):
    PHP Code:
    var myLoader:Loader = new Loader();
    var 
    myRequest:URLRequest = new URLRequest("mainLoader.swf");
    myLoader.load(myRequest);

    myLoader.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
    myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress);
    myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,showLoadResult); 
    How can i load the URLRequest into an actual movieclip as i have done in AS2? As far as i know the load function only accepts one variable. ATM the external swf im loading is just going into thin air and i can't get anything to happen (i have the functions created to deal with the events btw).

    Any help would be greatly appreciated. Thx.


    Edit: Just fixed it by adding externalLoader_mc.addChild(myLoader);
    Last edited by chur; 11-13-2007 at 08:17 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center