View Full Version : actionscripted banner
domvdm
06-20-2005, 11:42 AM
i would like to make an actionscripted animated banner that loops automatically.
i have managed to script the movement ,but don't know how to script the movie clip so that it 'stays still' where i want it to for about 10 seconds and then animates again...
and i am very new to actionscript, and help = most welcome.
vinyladdict
06-20-2005, 01:37 PM
This was posted by a helpful chap not so long ago. Cant find the post now (busy at work) so sorry author! but try this...
//Please note, I can not take credit for this script.
//I found it while searching the newsgroups. Someone named Steve wrote it.
//Kudos to Steve, who ever you are,
//this is the best pause function I have found.
//In your main "action" timeline, frame 1 put the following code:
////////////////// Pause Function /////////////////////
this.createEmptyMovieClip("timer",50);
timer.onEnterFrame = function()
{
if (this.startTime>0)
{
var diff = getTimer()-this.startTime;
if (diff>this.timerLength)
{
this.target.play();
this.startTime = 0;
}
}
};
function pauseFor(theTime)
{
stop();
timer.timerLength = theTime;
timer.startTime = getTimer();
timer.target = this;
}
///////////////////////////////////////////////////
//Then on the frame you want to pause, add: pauseFor(3000)
//this would pause for 3 seconds.
This function is awesome - I use it in everything!
hth
Pete
vBulletin® v3.7.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.