Bob Sheehy
12-21-2001, 03:14 PM
I have a scripting problem that I hope someone has some insight to.
I have a movie that has 2 frames on the main time line. On this movie is a movie clip (math) that has no graphics, but contains a script containing a loop. Calculations are performed within this loop the results of which show up in text boxes of the main movie. This all works fine.
Problem. There is another MC called within the math MC to be played on the main frame. I would like the movie to play each time the loop is executed. I have tried scripting this two ways with different problems and no solution. Any suggestions would be appreciated.
1.
for (gam; gam=x; ++gam){
patgam = random(4);
if (patgam = 0){
_root.patgam0mov.gotoAndPlay(2);
}else if (patgam = 1){
_root.patgam1mov.gotoAndPlay(2);
}else{
_root.patgam3mov.gotoAndPlay(2);
}
}
This script goes through the loop x times and then plays the movies (or that's what appears to happen).
2.
for (gam; gam=x; ++gam){
patgam = random(4);
if (patgam = 0){
_root.patgam0mov.gotoAndPlay(2);
do{
z =++z //check to see if I am inside the do loop (yes)
testframe = _root.patgam0mov._currentframe //check to see if MC is advancing (no), I get stuck here.
} while (_root.patgam0mov._currentframe ne _root.patgam0mov._totalframes)
}else if (patgam = 1){
_root.patgam1mov.gotoAndPlay(2);
}else{
_root.patgam3mov.gotoAndPlay(2);
}
}
This script goes through the loop gets stuck within the do loop. The MC stays on frame 2 and does not advance.
How do I get a movie called by a script to play all the way through before the script continues execution?
I have a movie that has 2 frames on the main time line. On this movie is a movie clip (math) that has no graphics, but contains a script containing a loop. Calculations are performed within this loop the results of which show up in text boxes of the main movie. This all works fine.
Problem. There is another MC called within the math MC to be played on the main frame. I would like the movie to play each time the loop is executed. I have tried scripting this two ways with different problems and no solution. Any suggestions would be appreciated.
1.
for (gam; gam=x; ++gam){
patgam = random(4);
if (patgam = 0){
_root.patgam0mov.gotoAndPlay(2);
}else if (patgam = 1){
_root.patgam1mov.gotoAndPlay(2);
}else{
_root.patgam3mov.gotoAndPlay(2);
}
}
This script goes through the loop x times and then plays the movies (or that's what appears to happen).
2.
for (gam; gam=x; ++gam){
patgam = random(4);
if (patgam = 0){
_root.patgam0mov.gotoAndPlay(2);
do{
z =++z //check to see if I am inside the do loop (yes)
testframe = _root.patgam0mov._currentframe //check to see if MC is advancing (no), I get stuck here.
} while (_root.patgam0mov._currentframe ne _root.patgam0mov._totalframes)
}else if (patgam = 1){
_root.patgam1mov.gotoAndPlay(2);
}else{
_root.patgam3mov.gotoAndPlay(2);
}
}
This script goes through the loop gets stuck within the do loop. The MC stays on frame 2 and does not advance.
How do I get a movie called by a script to play all the way through before the script continues execution?