BUTTONS: Delaying Get URL with Actionscript

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

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

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

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

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:)

I guess you could try this on a frame action:

function url() {
getURL(‘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

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’);
}
_root.s1.loadMovie (“spis.swf”);
_root.spis._visible = False;
delay = setInterval(this, “url”, 5000);
}

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

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

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 :wink: lol.

:p: aussy

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

:beam:

That was funny! :stuck_out_tongue:

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’);
}
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

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’);
}
_root.s1.loadMovie (“spis.swf”);
_root.spis._visible = False;
delay = setInterval(this, “url”, 5000);
} **
:slight_smile: :slight_smile: :slight_smile: