Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pause/delay the motion set by Actionscript in mc

Status
Not open for further replies.

Curisco

Programmer
Joined
Feb 6, 2002
Messages
90
Location
SE
well this is no joke i've spent 3 hours straight looking and trying but alas i just can't do it ...

Main timeline consists of 1 frame. So gotoAndPlay is out.

Movie has several 1 frame layers all of which are Actionscripted 1 framed movie clips.

The clip in question uses motion set and stoped by :


onClipEvent(load){
endLocation=600; //stops at x pos 600
}
onClipEvent(enterFrame){
diff=endLocation-_x;
_x+=diff/2; //higher number slow, low number faster

}

Now ... how the ... do i delay the playing of the above MC script.
most, if not all the tips i'v seen refer in one way or another to a frame based solution or needs to be tweeked in about 57 places..So tired now i can't think .
Help me out folks and once again my gratitude and thanks are of the deepest kind :)

Ramsey



-------------------------------------
Laughing out loud every day,
keeps the doctor away....gotoAndPlay
-------------------------------------
 
What do you mean exactly by delay? Slow down the execution of the script itself? Or delaying the moment when the script must be executed?

Regards,

cubalibre2.gif
 
Thanks for such a quick reply i would like to
delay the moment when the script must be executed.

/R

-------------------------------------
Laughing out loud every day,
keeps the doctor away....gotoAndPlay
-------------------------------------
 
Set a root variable to false to start with, and then condition your script to execute only when the variable has been set to true.

_level0.clip_move = false; //variable is clip_move

And on your script...
Code:
onClipEvent(enterFrame){
    if(_level0.clip_move == true){
        diff=endLocation-_x;
        _x+=diff/2;   
        // The clip was moved... 
        _level0.clip_move = false; 
    } else {
        //some other action...
        _level0.clip_move = false;
    }
}

Whenever you want your clip to move, just set the variable to true on a button or frame action...



Regards,

cubalibre2.gif
 
Nice one i'll give it a try
Thanks

-------------------------------------
Laughing out loud every day,
keeps the doctor away....gotoAndPlay
-------------------------------------
 
nope...
Sorry but i give up ...
it's going to be

stop()
after 10 seconds play movie clip1
then()
after 3 seconds play movie clip2

haveAniceDay();

using getTimer() or something.

nextQuestion
Thanks and sorry to waste your time

/R

-------------------------------------
Laughing out loud every day,
keeps the doctor away....gotoAndPlay
-------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top