PDA

View Full Version : Code works "stand alone" but fails when loaded into MC


richard2005
11-14-2005, 11:57 AM
Greetings!
This little snip creates instances of a movie clip on the stage that get dragged around, etc. It works fine as part of a stand alone movie, but when I load the movie into a blank movie clip (as part of a larger application) the movie clips fail to show up. When traced, I know the code is being executed, but nothing shows up (Flash8)... HELP!?!

//Load Pictures from File imagefolder.txt
_global.pic_index=-1;
bilder_lv = new LoadVars();
bilder_lv.onLoad = function(){
bildansicht_mc.verschieben();
_root.container_thumbs_mc.removeMovieClip();
_root.createEmptyMovieClip("container_thumbs_mc", tiefe++)
container_thumbs_mc._x = 18;
container_thumbs_mc._y = 480;
//var fotos in bilder_array
for(var i=0; i<this.anz_bilder; i++){
fotos_array = this.fotos.split("|");
_global.pic_index++;
container_thumbs_mc.attachMovie("polaroid_mc", "polaroid"+i, tiefe++,{pic_txt: fotos_array[i], pic_index: _global.pic_index});
container_thumbs_mc["polaroid"+i].verteilePolaroid();
container_thumbs_mc["polaroid"+i].ladejpg(fotos_array[i]);
container_thumbs_mc["polaroid"+i].selectPolaroid(fotos_array[i]);
}
}

Many thanks in advance for any help! :)

oldnewbie
11-14-2005, 12:45 PM
Replace your references to _root with the appropriate this and/or 1 or more parent's, or if you're on MX2004, look into _lockroot...

http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004&file=00001522.html

http://www.webwasp.co.uk/tutorials/b54-Commmunicate-Ex-SWFs/index.php

richard2005
11-14-2005, 01:05 PM
I'll give that a try! Thanks!

richard2005
11-14-2005, 01:09 PM
_lockroot...

That solves that problem! (on to the next!)

x = ("thanks" x 1000)