# Delay in Actionscript

**URL:** https://forum.kirupa.com/t/delay-in-actionscript/284328
**Category:** flash
**Created:** [March 18, 2009, 3:07am UTC](https://forum.kirupa.com/t/delay-in-actionscript/284328 "2009-03-18T03:07:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nadaklan](https://avatars.discourse-cdn.com/v4/letter/n/8e7dd6/32.png) [@nadaklan](https://forum.kirupa.com/u/nadaklan)
#### Post date: [March 18, 2009, 3:07am UTC](https://forum.kirupa.com/t/delay-in-actionscript/284328/1 "2009-03-18T03:07:10Z")

</div>

Hey,

I have a question about some actionscript. Basically, I have a movie clip that I want to play when I click a button, and then have the button take us to another scene. Right now, I’m having problems with getting the clip to play before going to the next frame. What I pretty much need, I think, is a delay or something so that it lets the movie clip play all its frames, and then let it process the gotoAndPlay code. Here’s my code:

Code keeping movie clip from playing. It’s on frame one.  
[INDENT]\_root.fadeout.stop();  
[/INDENT]This is the button code.  
[INDENT]on (press) {  
\_root.fadeout.play();  
// Can I put a delay here for a number of frames?  
gotoAndPlay(“Scene 2”, 1);  
}

[/INDENT]Thanks bunches for your help.
