Skip to main content
January 4, 2008
Question

Controlling Movie Clips on stage with Actionscript

  • January 4, 2008
  • 1 reply
  • 175 views
Hi all,

I've been following some tutorials on gotoandlearn.com, which is very cool. Now I'm trying to add some text effects (as movie clips) to a video and need to control when they play with actionscript. I'm using Flash 8.

Here's my code:

var duration:Number;
duration = 69;
function videoStatus(){
percentagePlayed = ns.time / duration;
if(percentagePlayed < 100){
trace (ns.time);
if(ns.time > 10){
_root.mResults.gotoAndPlay(2);
}
}
}


it outputs my trace just fine so why won't it gotoAndPlay my mResults movie clip when ns.time is greater than 10?

Thanks for any help.
This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
January 4, 2008
because mResults isn't on the root timeline, you have a typo in mResults, you have other code overriding that gotoAndPlay() or _root.mResults is going to frame 2, but you're not recognizing that.

to debug use the trace() function.