4 Replies - 1431 Views - Last Post: 04 June 2012 - 01:18 PM

#1 pioSko  Icon User is offline

  • still.dreaming
  • member icon

Reputation: 23
  • View blog
  • Posts: 1,888
  • Joined: 06-June 03

Timeline pause

Posted 22 March 2005 - 12:29 AM

Description: Place in first frame of main timeline. Execute in frame where you want the pause, with the number of seconds within brackets.Function which pauses a timeline 's' amount of seconds
// sec = number of seconds

function paused(sec) {
   stop();   // action to pause
   var i = sec - 1;
   var t = setInterval(function () {
      if (i == 0) {
         clearInterval(t);
         play();   // action to continue
      }
      i--;
   }, 1000);
}


Is This A Good Question/Topic? 0
  • +

Replies To: Timeline pause

#2 spikyangel  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 22-August 08

Re: Timeline pause

Posted 22 August 2008 - 03:28 AM

Excellent! Works just fine. thanx a lot pioSko
Was This Post Helpful? 0
  • +
  • -

#3 3DnGin  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 12-May 09

Re: Timeline pause

Posted 12 May 2009 - 06:52 AM

You said to place in first frame, but then you say to execute it in the frame where you want it to pause. I am a newbie. This doesn't make sense to me. That would be 2 different frames. So I would paste this actionscript in frame one and then in frame 30 I want to pause, so what do I do in that frame?
Was This Post Helpful? 0
  • +
  • -

#4 westpark  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 13-May 09

Re: Timeline pause

Posted 13 May 2009 - 05:52 AM

I have just called this function in flash MX and after the pause i want it to return to my current position in the code. I have changed the play(); to return; but i dont seem to manage a pause...? any ideas? you have call the function which you have just created - 3DnGin
Was This Post Helpful? 0
  • +
  • -

#5 huzi8t9  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 25
  • View blog
  • Posts: 367
  • Joined: 11-July 07

Re: Timeline pause

Posted 04 June 2012 - 01:18 PM

3DnGin - Create a new layer for global actions, or make the function a global function. IE // sec = number of seconds _global._paused = function(sec) { // Renamed function so it's not a keyword. stop(); // action to pause var i = sec - 1; var t = setInterval(function () { if (i == 0) { clearInterval(t); play(); // action to continue } i--; }, 1000); }
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1