# Delaying Actions

**URL:** https://forum.kirupa.com/t/delaying-actions/42602
**Category:** flash
**Created:** [February 10, 2004, 11:10pm UTC](https://forum.kirupa.com/t/delaying-actions/42602 "2004-02-10T23:10:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ghjr](https://avatars.discourse-cdn.com/v4/letter/g/dec6dc/32.png) [@ghjr](https://forum.kirupa.com/u/ghjr)
#### Post date: [February 10, 2004, 11:10pm UTC](https://forum.kirupa.com/t/delaying-actions/42602/1 "2004-02-10T23:10:56Z")

</div>

I’m not sure how I would go around doing this, so I couldn’t find anything by searching the boards.

I have a main SWF that has two buttons. Each button loads an external SWF into a empty movie clip (called container).

What I want to do is, when I already have an external SWF loaded, and I click on the other button, I want the current SWF to play from frame 13 onto its end, and then load the new SWF.

I tried adding a container.goToAndPlay(13) and then the new section script, but that doesn’t make the old section play entirely (because the new section load cuts it off). Here is the current code for the button actions:

```auto

button_conceito.onPress = function() {
	// If this is the first section loaded
                if (primeiraSecao == "sim") {
	criarCaixa();
	secao = "conceito_external.swf";
	primeiraSecao = "nao";
	}
	// Else if this isn't the first section loaded
                else {	
	container.gotoAndPlay(13);
	_root.createEmptyMovieClip("container", 2);
	loadMovie("conceito_external.swf".noCache(), "container");
	container._x = 19.9;
	container._y = 142;
	}

```

Dam, that was confusing… (-:  
I’ll try to re-write it if you guys can’t understand hehe. Thanks!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 11, 2004, 12:52pm UTC](https://forum.kirupa.com/t/delaying-actions/42602/2 "2004-02-11T12:52:32Z")

</div>

Hi,

[AS]  
// Else if this isn’t the first section loaded

else {  
this.\_parent.container.gotoAndPlay(13);  
this.onEnterFrame = function(){  
if(this.\_parent.container.\_currentframe == 57){ //i use 57 but you should use the last frame number of your animation  
this.onEnterFrame = undefined;  
this.\_parent.container.loadMovie(“conceito\_external.swf”.noCache());  
this.\_parent.container.\_x = 19.9;  
this.\_parent.container.\_y = 142;  
}  
}  
}  
[/AS]

SHO

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 18, 2004, 11:26am UTC](https://forum.kirupa.com/t/delaying-actions/42602/3 "2004-02-18T11:26:53Z")

</div>

Any time

🙂

SHO
