Skip to main content
June 14, 2007
Question

Controlling the root timeline from inside a MovieClip

  • June 14, 2007
  • 2 replies
  • 308 views
[preface] I'll apologize in advance. I'm a designer, not a developer. I know very little about actionscript so if you can help me out, please pretend like I know nothing.
[/ preface]

I just need actionscript to check the value of a variable when the end of a movie clip is reached and then call an action.

Here's what I've got and it doesn't work. Please don't laugh.

if (p == 1){
tellTarget (_root) {
play();
}
}
else if (p == 0){
stop();
}

(the "stop" on the "else if" is referring to the movie clip's timeline, not the root timeline... in case you're wondering)

Any help would be greatly appreciated. Thanks!
This topic has been closed for replies.

2 replies

Inspiring
June 14, 2007
Are you using Flash MX, MX 2004, 8 or CS3? tellTarget was deprecated some time ago... Flash 5....I believe? Or maybe AS2....

June 15, 2007
No it's not a school project. Good guess though. It's actually a self-promo piece for the ad agency I work for. I'm an art director expanding my horizons. I would take a class or run through one of the good actionscript books but unfortunately, I don't have time.

Thanks for the help again kglad.

btw, I've used tellTarget successfully in a few projects in the last few months. I'm using Flash 8.
kglad
Community Expert
Community Expert
June 15, 2007
someone else asked exactly the same question, using the same variable p, a few days ago.

anyway, you're welcome.
kglad
Community Expert
Community Expert
June 14, 2007
is this a school project?

use _root.p instead of p