Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

loadingSecondFile - Dosen't work

Participant ,
Sep 06, 2013 Sep 06, 2013

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;

}

TOPICS
ActionScript
862
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 06, 2013 Sep 06, 2013

What does the loading code look like?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 06, 2013 Sep 06, 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")

}

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 06, 2013 Sep 06, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 06, 2013 Sep 06, 2013

Thanks Ned. But I've got an array named mc

var mc:Array = [mc1, mc2, mc3];

I'm loading the below code as an external swf as well. Could that be causing this issue?

function traceName():Void {

     trace(this._name);

}

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

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

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 06, 2013 Sep 06, 2013

It could be.  That code should be getting assigned by the main file that does all of the loading, and it should happen after each time a new set of files is loaded.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 06, 2013 Sep 06, 2013
LATEST

Thanks Ned.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines