mmmmkay- been searchin all night to find out why my code wont work- now I gotta take it to the forums i guess lol…
The desired affect is simple:
I have a single button… with each click I want it to load text into a dynamic text field and load a corresponding picture or movieclip. There are only three unique text/image combinations- after its displayed the third, with the next click I want it to just start over. All the text functions perfectly with each click.
The problem is:
I use “createEmptyMovieClip” then use the resulting clip as a loader clip… With the first click I want a movieclip from the library to load, so I use the “attachMovie” method- it displays the first library fine
With the next click I want to load an external swf- so I call the “loadMovie” method of the loaderclip… The external swf loads just fine replacing the first library clip.
The third clip is where I have problems… now I want to load another library item into the loaderclip… so I tried using the attachMovie method again but the external swf remains static… then with the next click, I discover the first library item no longer loads and the external swf remains still playing- it’s like once it’s been loaded into the loaderclip it cant be moved…
So I tried adding the “unloadMovie” method in the code for the third click… it successfully removed the swf… but the next line of code immediately after the unload statement, doesn’t work. The line calls the attachMovie method for the loaderclip… but the library item doesnt load… Oddly enough, with the next click, the first library item now does load as if everything’s fine… It seems like you cant use the unloadMovie and attachMovie on the same executing code? if that makes any sense… the basic idea was that if I couldnt get the attachmovie method to replace the loaded external swf, then I would use the unload method to remove it, then have code immediately after, to then execute the attachMovie method… but it still doesnt load the library clip. and I know it’s not a type-o, because when I comment out the loadMovie and unloadMovie statements, it loads both the library items perfectly any ideas anyone?? The code is below
var increment:Number = 1;
var verbiage1:String = “Hello World1”;
var verbiage2:String = “Hello World2”;
var verbiage3:String = “Hello World3”;
this.createEmptyMovieClip(“dynaHolder_mc”, this.getNextHighestDepth());
dynaHolder_mc._x = 202;
dynaHolder_mc._y = 36;
dynaHolder_mc._xscale = 50;
dynaHolder_mc._yscale = 50;
butters.onRelease = function(){
if (increment < 3) {
if (increment == 1) {
dynaText.text = eval("verbiage" + increment);
dynaHolder_mc.attachMovie("verbClip1","loadedClip_mc",0);
}else{}
if (increment == 2) {
dynaText.text = eval("verbiage" + increment);
dynaHolder_mc.loadMovie("entire.swf");
}else{}
increment += 1;
} else {
dynaHolder_mc.unloadMovie();
dynaText.text = verbiage3;
dynaHolder_mc.attachMovie(“verbClip3”,“loadedClip_mc”,0);
increment = 1;
trace(dynaHolder_mc._x);
trace(dynaHolder_mc._y);
}
}