# BUTTONS: Delaying Get URL with Actionscript

**URL:** <https://forum.kirupa.com/t/buttons-delaying-get-url-with-actionscript/28554>\
**Category:** flash\
**Created:** [August 14, 2003, 10:40pm UTC](https://forum.kirupa.com/t/buttons-delaying-get-url-with-actionscript/28554 "2003-08-14T22:40:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bauche25](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@bauche25](https://forum.kirupa.com/u/bauche25)\
**Post date:** [August 14, 2003, 10:40pm UTC](https://forum.kirupa.com/t/buttons-delaying-get-url-with-actionscript/28554/1 "2003-08-14T22:40:00Z")

</div>

Hi, this question is for all you actionscript guru’s. I have this menu system I am building in which when you click on a button, a text effect animates in flash but I was wondering if there was a way to set it up so that when you click on the button, the text effect animates and sends command to get the required URL or page with a delay in place (in seconds), so I can set it so the text effect finishes before it forwards it to the new page. I understand I could do this easily if I just put the menu in a frame and not worry about it but the menu system needs to reload itself, thus is why it is on the same page as the content. Any help is much appreciated!

Thanks!  
Bauche25

---

<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:** [August 14, 2003, 10:57pm UTC](https://forum.kirupa.com/t/buttons-delaying-get-url-with-actionscript/28554/2 "2003-08-14T22:57:11Z")

</div>

this might not be the most effective way but, i would add:

getURL(‘[http://www.url.com](http://www.url.com)’);

in the last frame of the text effect so you wouldent really hafta figure out the time to delay

---

<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:** [August 14, 2003, 11:52pm UTC](https://forum.kirupa.com/t/buttons-delaying-get-url-with-actionscript/28554/3 "2003-08-14T23:52:50Z")

</div>

Thanks for your reply, I thought about doing this but can’t really because the effect was made in an external SWF editor (SWFX) and when I try to import it into a movie, the proper frames don’t show up for the effect and I can’t add actionscript to it.

Any other suggestions?  
Bauche25:)

---

<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:** [August 15, 2003, 12:08am UTC](https://forum.kirupa.com/t/buttons-delaying-get-url-with-actionscript/28554/4 "2003-08-15T00:08:00Z")

</div>

I guess you could try this on a frame action:

function url() {  
getURL(‘[http://www.google.com](http://www.google.com)’);  
}  
delay = setInterval(this, “url”, 5000);

5000 = time, i forgot what value it is but this is ~6 seconds  
i based this off SteveD response in:  
[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=25744&highlight=delay+action](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=25744&highlight=delay+action)

and modified it alil for the needs i remember the movie last time if you doin the same thing, you could just add it to the button like this:

on (release) {  
function url() {  
getURL(‘[http://www.google.com](http://www.google.com)’);  
}  
\_root.s1.loadMovie (“spis.swf”);  
\_root.spis.\_visible = False;  
delay = setInterval(this, “url”, 5000);  
}

---

<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:** [August 15, 2003, 12:52am UTC](https://forum.kirupa.com/t/buttons-delaying-get-url-with-actionscript/28554/5 "2003-08-15T00:52:31Z")

</div>

> _Originally posted by yonip_  
> **function url() {  
> getURL(‘[http://www.google.com](http://www.google.com)’);  
> }  
> delay = setInterval(this, “url”, 5000);**

[AS]setInterval(getURL, 5000, “[http://www.kirupa.com](http://www.kirupa.com)”);[/AS]  
… Much easier, don’t you think? 😉

---

<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:** [August 15, 2003, 2:22am UTC](https://forum.kirupa.com/t/buttons-delaying-get-url-with-actionscript/28554/6 "2003-08-15T02:22:02Z")

</div>

If it was me, I would just make teh animation be in a mc and make teh last frame of it contain the get url script. When teh button was hit, it would tell the animation mc to play throug htell target and hwne it was done it would go to teh site. That’s just be 😉 lol.

:p: aussy

---

<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:** [August 15, 2003, 3:23am UTC](https://forum.kirupa.com/t/buttons-delaying-get-url-with-actionscript/28554/7 "2003-08-15T03:23:27Z")

</div>

kode! …i mean kax!!! the master of setInterval! :beam:

---

<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:** [August 15, 2003, 3:46am UTC](https://forum.kirupa.com/t/buttons-delaying-get-url-with-actionscript/28554/8 "2003-08-15T03:46:52Z")

</div>

:beam:

That was funny! 😛

---

<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:** [August 15, 2003, 5:48am UTC](https://forum.kirupa.com/t/buttons-delaying-get-url-with-actionscript/28554/9 "2003-08-15T05:48:52Z")

</div>

Thanks Guys, Yonips POST is exactly what I was looking for. I appreciate all your help!

bauche25

> \*Originally posted by yonip \*  
> \*\*I guess you could try this on a frame action:

function url() {  
getURL(‘[http://www.google.com](http://www.google.com)’);  
}  
delay = setInterval(this, “url”, 5000);

5000 = time, i forgot what value it is but this is ~6 seconds  
i based this off SteveD response in:  
[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=25744&highlight=delay+action](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=25744&highlight=delay+action)

and modified it alil for the needs i remember the movie last time if you doin the same thing, you could just add it to the button like this:

on (release) {  
function url() {  
getURL(‘[http://www.google.com](http://www.google.com)’);  
}  
\_root.s1.loadMovie (“spis.swf”);  
\_root.spis.\_visible = False;  
delay = setInterval(this, “url”, 5000);  
} \*\*  
🙂 🙂 🙂
