Importing Flash into Flash

Out of context: Reply #9

  • Started
  • Last post
  • 11 Responses
  • honda0

    whoa my grammar was way bad in that last post. sorry. anyway, here is some code for ya.

    //i prefer "onClipEvents" to write code, but understand that most use timeline based scripting, so put this code in whatever frame you are calling your loadMovie( ); event.
    //create your dynamic _mc and give it an instance name
    createEmptyMovieClip("newMC_name... 1);

    //place your new _mc on the stage
    newMC_name._x = 0;
    newMC_name._y = 0;

    //load the .swf into your newly created dynamic _mc
    loadMovie("external.swf", newMC_name);

    //preload the .swf you are loading
    this.onEnterFrame = function(){
    var l = newMC_name.getBytesLoaded();
    var t = newMC_name.getBytesTotal();
    if(l == t){
    if(newMC_name._width > 1){
    newMC_name.gotoAndPlay(2);
    delete this.onEnterFrame;
    }
    }
    };

    //begin playing your newly created _mc
    newMC_name.gotoAndPlay(2);

    /*you can now target your dynamic _mc and make it do whatever
    or target elements in the .swf you just loaded like:

    newMC_name.targetMCinside_loaded... = 0;

    */

View thread