Skip to main content
Inspiring
September 6, 2013
Question

loadingSecondFile - Dosen't work

  • September 6, 2013
  • 1 reply
  • 938 views

loadMovie() loads SWFs into _root.mc1.mc2, and I use the below method to be able to identify the selected movieclip. It works when I load the first SWF but when the second SWF is been loaded it dosen't work. What may be the cause for this.

I tried unloadMovie() and removeMovieClip() to clear the movieclip before loading the new file, but no success.

function traceName():Void {

     trace(this._name);

}

for (i=0; i<5; i++) {

    _root.mc1.mc2["color"+i].onRelease = traceName;

}

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
September 6, 2013

What does the loading code look like?

Inspiring
September 6, 2013

callItems_btn.onRelease = function () {

for(i=0; i<3; i++) {

unloadMovie(_root.mc.mc2)

}

           senderLoad.sendAndLoad("www.web.com/the.php",receiveLoad,"POST");

};

receiveLoad.onData = function(src) {

item_text = src;

for(i=0; i<3; i++) {

                    prototypeLDR.loadClip("www.web.com/"+i+"/new/item.swf, _root.mc.mc2);

          }

}

prototypeLDR.addListener(prototypeLO);

var swfsLoaded:Number=0;

var prototypeLDR:MovieClipLoader = new MovieClipLoader();

var prototypeLO:Object = {}; prototypeLDR.addListener(prototypeLO);

 

prototypeLO.onLoadInit = function(targetMC:MovieClip){

          swfsLoaded++;

          if(swfsLoaded==3){

trace ("loaded")

}

}

Ned Murphy
Legend
September 6, 2013

Unless you have an array named "mc" that has mc0 thru mc2 in it,  your use of

     _root.mc.mc2

is not going to target the object you identified in first posting that you specified as 

    _root.mc1.mc2

basically,  _root.mc.mc2 will not be _root.mc1.mc2

You would want to be writing that as _root["mc"+i].mc2