A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Stopping a movie for 5 seconds and then let it start again.

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    3

    Stopping a movie for 5 seconds and then let it start again.

    Making a banner in flash cs4, and trying out AS 3.0.
    Any one know how i stop the movie for 5 seconds and then let it start again?
    Thanks for any reply.

  2. #2
    Member
    Join Date
    Nov 2009
    Posts
    43
    I never used AS 3.0. But you can delay movies with creating an empty mc. In the first frame you stop it, than make a lots of empty frames after it, and in the last, you write your script. So the movie's need to play this mc (for example if you need 5 sec, and you use 20fps, make 20*5 = 100 frames). And when the 100 frames played, will activate the delayed action.

  3. #3
    Junior Member
    Join Date
    Nov 2009
    Posts
    3
    Thanks for the reply, but one of the reasons i wanted to do this was to avoid "dead frames" or empty frames(even do it's inside a movie clip).
    If i create it in your way, wont the file size get larger?

  4. #4
    Member
    Join Date
    Nov 2009
    Posts
    43
    With empty frames I think won't.

  5. #5
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    Something like this:
    PHP Code:
    import flash.utils.Timer;
    import flash.events.TimerEvent;

    function 
    waitAS3(mc:MovieClips:Number 10):void
    {
        
    mc.stop();
       
        var 
    timer:Timer = new Timer(s*10001);
       
        
    timer.addEventListener(TimerEvent.TIMER_COMPLETE, function()
        {
            
    mc.play();
        }
        );

        
    timer.start();
    }

    // example:
    waitAS3(this5); // stop this timeline, 5 seconds 

  6. #6
    Junior Member
    Join Date
    Nov 2009
    Posts
    3
    Exactly like that. Work very nicely.
    Thanks alot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center