Strange framecontroll scripting

I use this code on my page:
on(press) {;
When I press the button, it will play a fadeouteffect that’s positioned one frame after the currentframe.

1.It fades out the current shown image with;
2.It fades in the new image, with *_root.gotoAndPlay(“studio_in”);

*The problem is that it seems that it just runs *_root.gotoAndPlay(“studio_in”); and skipps the;

*If I just run;[font=Arial] the fadeout works, but not if I run gotoAndPlay after the play() section. Howcome??

regards, henrik, sweden

It starts to play it, sees the gotoAndPlay and then does that. Try just play() and then at the end of the fadeout put the gotoAndPlay()

Ok, that makes sense. Though I can’t just put the gotoAndPlay() in the end of the fadeout, because depending of what button that’s pressed, the new image will be chosen, it won’t be the same everytime (it’s a menu I’m creating)

Maybe a while-function that runs play() as long as the fade-out last frame isn’t reached…

Nope, didn’t work very well. The while-function just fuc*ed things up. The script was warned to be to slow…

Well, you could make the fadeout be a mc, and pass the mc a variable that it then moves the movie to, something like:

mc.goToFrame = “myframe”;;

and in the last frame of the mc:

Its hard to tell if this will work without seeing your .fla though.