To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 11-25-2009, 11:44 AM   #1
Acnewbie
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.
Acnewbie is offline   Reply With Quote
Old 11-25-2009, 12:45 PM   #2
Creephun
Member
 
Join Date: Nov 2009
Posts: 40
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.
Creephun is offline   Reply With Quote
Old 11-25-2009, 01:05 PM   #3
Acnewbie
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?
Acnewbie is offline   Reply With Quote
Old 11-25-2009, 01:52 PM   #4
Creephun
Member
 
Join Date: Nov 2009
Posts: 40
With empty frames I think won't.
Creephun is offline   Reply With Quote
Old 11-25-2009, 02:42 PM   #5
nunomira
Moderator
 
nunomira's Avatar
 
Join Date: May 2002
Location: portugal
Posts: 6,767
hi,

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

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

    
timer.start();
}

// example:
waitAS3(this, 5); // stop this timeline, 5 seconds
nunomira is offline   Reply With Quote
Old 11-25-2009, 03:25 PM   #6
Acnewbie
Junior Member
 
Join Date: Nov 2009
Posts: 3
Exactly like that. Work very nicely.
Thanks alot.
Acnewbie is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:44 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.