PDA

View Full Version : Russian Doll-like movie clip controlling


anniebme
09-15-2008, 10:34 PM
Movie A is my big swf with controls like previousbtn, nextbtn, and closebtn. It loads MovieB. MovieB then loads MovieC.

I need closebtn to unload MovieC when pressed, and if MovieB is empty(MovieC was unloaded or not ever loaded) it will close Movie B.

Also, my nextbtn has this code(not on the button but in a frame):
nextbtn.onRelease=function(){
if(movieB.movieC==movieB.movieC._totalframes){
movieB.movieC.gotoAndStop(1);
}
else{movieB.movieC.nextFrame();
}
}

and works

My previousbtn has this code (not on the button but in a frame):
previousbtn.onRelease=function(){
if(movieB.movieC._currentframe>1) {
movieB.movieC.prevFrame();
} else {
movieB.movieC.gotoAndStop(movieB.movieC._totalfram es);
}
}

It will go to a previous frame if its greater than one. But it won't go to the last frame. ARGH!

Thank you for all your help.

alile
09-16-2008, 10:45 PM
so long as you did not copy-paste your code, this may not be an issue, but there is whitespace in this:else {
movieB.movieC.gotoAndStop(movieB.movieC._totalfram es);

i would put a trace statement in each of the conditions to see what the _currentframe value is, and to see if it does ever go to frame 1. The logic looks fine, so I can't say what the problem is.

wow. loading swfs into loaded swfs. that is madness!

anniebme
09-17-2008, 01:49 AM
No kidding on calling it madness! It seems to be the best way for my brain to get it, though if that's any indication of whom you're working with:D

so long as you did not copy-paste your code, this may not be an issue, but there is whitespace in this:else {
movieB.movieC.gotoAndStop(movieB.movieC._totalfram es);

i would put a trace statement in each of the conditions to see what the _currentframe value is, and to see if it does ever go to frame 1. The logic looks fine, so I can't say what the problem is.

wow. loading swfs into loaded swfs. that is madness!