Groups | Blog | Home
all groups > flash actionscript > may 2006 >

flash actionscript : Function Problem :S


danny biy
5/27/2006 8:56:22 PM
I'm having problems trying to get two actions to happen one after another.
This is my code:

_root.index_mc.onPress = function() {
gotoAndPlay(33)
getURL("index.html");
}

The first line works no problem. After it goes to frame 33 and plays...only
when that is done (frame 65), I need the next function to happen (opens the
html page). If I try it when the code is like this it does them both at the
same time, how can I get it to do the first line, then after its done, the
second line?? thanks for any help.
juankpro
5/27/2006 9:05:41 PM
Actually this is not done at the same time it is done one after another but
because a computer does things too fast it is done just ,milliseconds later. If
you want to play from frame(33) to (65) and then call a page you con do the
following:

1. you can delete the getURL line from your code and place it as the code for
frame 65.

2. Or you can have the following code:

_root.index_mc.onPress = function() {
gotoAndPlay(33)
_root.onEnterFrame = function(){
if(this._currentframe == 65){
getURL("index.html");
stop();
delete _root.onEnterFrame;
}
}
danny biy
5/27/2006 9:14:34 PM
yea im gonna have to go with the second option because its going to depend on what they click, it wont always open the same page.
AddThis Social Bookmark Button