-
focus of play(); when it is inside a function
Have a small MC that is used several times (in main time line and in other MCs). I have a pause function inside the MC, that should pause its play for a few seconds, regardless of where it is placed. This is the pause I'm using:
Actionscript Code:
var nInterval = setInterval(Pause, 3000);
function Pause() { clearInterval(nInterval); play(); }
Only problem is the play() starts not only the timeline in the MC, but also the master timeline.
As the play() is inside a function in the MC, I can't seem to address the MC's timeline with commands like "this.".
Any help? I"m sure it is something simple.
Thanks!
-
You can pass parameters through the setInterval function...
Code:
var nInterval = setInterval(Pause, 3000, mcToPlayNameHere);
function Pause(mc) {
clearInterval(nInterval);
mc.play();
}
-
 Originally Posted by dawsonk
You can pass parameters through the setInterval function...
Code:
var nInterval = setInterval(Pause, 3000, mcToPlayNameHere);
function Pause(mc) {
clearInterval(nInterval);
mc.play();
}
Passing this thru setInterval did indeed work.
Thanks!
Still find it a little strange that a function has no awareness of the item that called it. Or am I just thinking of this wrong?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|