Skip to main content
Known Participant
July 19, 2006
Answered

Button problem with gotoURL

If this is the action scripting in the main timeline for a button, and the button path is download.btn shouldn't this work?

download.btn.onRelease= function() {
getURL(" http://www.google.com/","_blank");
};

Right now when it's opened the url ( http://www.google.com) comes up in a separate browser, in addition to opening another browser when the button is clicked. Any idea why it would trigger when the movie loaded as well?

If you want to look at the .fla file it is found here:
http://www.midnight007.com/pizza/layer_100slices.fla
This topic is closed to new replies. Start a new post to keep the conversation going.
Craig Grummitt
Craig GrummittCorrect answer
Inspiring
July 21, 2006
you're right - that should work. my first thing that i test when something like that happens is that every keyframe in the tween contains exactly the same instance. A common problem is that the instance name of the clip may be slightly different(eg a space somewhere) in different keyframes.

Rather than looking for the problem, I usually just clear the keyframes in the tween and then put them back in. In your case I cleared the keyframe on frame 12 on layer "see more" and then inserted keyframe(returning it to color: None) and tested the movie. The button works fine!

So then i went back to your original movie to try to find what was inconsistent between the two keyframes in 'see more' and couldn't find the problem... so anyway, this looks like a situation where we may not know the reason for the problem but at least we've found the solution...

4 replies

swim4itAuthor
Known Participant
July 21, 2006
Strange - yeah it seemed all ok to me. Thanks for trying that out - it worked for me as well!
Translate
Craig Grummitt
Craig GrummittCorrect answer
Inspiring
July 21, 2006
you're right - that should work. my first thing that i test when something like that happens is that every keyframe in the tween contains exactly the same instance. A common problem is that the instance name of the clip may be slightly different(eg a space somewhere) in different keyframes.

Rather than looking for the problem, I usually just clear the keyframes in the tween and then put them back in. In your case I cleared the keyframe on frame 12 on layer "see more" and then inserted keyframe(returning it to color: None) and tested the movie. The button works fine!

So then i went back to your original movie to try to find what was inconsistent between the two keyframes in 'see more' and couldn't find the problem... so anyway, this looks like a situation where we may not know the reason for the problem but at least we've found the solution...
Translate
Craig Grummitt
Inspiring
July 19, 2006
the code you quoted isn't causing the problem, it's your code on frame 6(check line 88):

getURL(" http://www.midnight007.com/logos2.php","_blank");
Translate
swim4itAuthor
Known Participant
July 20, 2006
Oi - I didn't even see that was there. Thanks for catching that - now, can't I put the button code in the switch statement on frame 6 - instead of frame 12 - so that the button url changes according to the switch?

When I test it and click on it - nothing comes up. Here's the code within the switch statment:

download.btn.onRelease= function() {
getURL(" http://www.midnight007.com/logos2.php","_blank");
};

I've re-uploaded the fla file if looking at it helps:
http://www.midnight007.com/pizza/layer_100slices.fla
Translate