1.) I have the following exact code for a button in a keyframe on the timeline (not in the button itself and of course excluding the quotes)
"
on (release) {
getURL ("www.yoursite.com", "_blank");
}
"
and I get the following error when I try and preview in Flash CS3
1087: Syntax error: extra characters found after end of program.
2.) Also, I have another layer with a "stop" action taking place at the same time that this button occurrs, however, once I have the script in the keyframe for the button, it seems to override the stop action. So, basicly, IM looking to stop the movie and get this button to, once clicked, open a web address.
ok this resolved the error problem. Thanks! However, my buttons rollover functions work (on mouse over) but once I click the button, it doesnt open up the new "blank" window in the default browser. Any suggestions on this?
as long as you are NOT publishing it in Flash Player 9, it has to work.. there is absolutely nothing wrong with the code you have now..
May be there is some bug with your button symbol, delete it and create a fresh button symbol.
Ahhh...thanks to your help I saw what I did wrong. I hadnt put a label for the instance...and it appears (correct me if Im wrong) that the script calls an instance of a button named "More_Info". Its the instance its looking for, not the name of the button. Once I put the name for the instance (same as the button name) then published, it worked great Thanks again!
I'm having a similar problem. I'm very new to flash and I'm learning as I go. i'm trying to add some flash to my website at the moment.
I typed some simple text and now i want to link it to another page (i'm using Actionscript 2.0 but flash cs4 since actionscript 3.0 is too confusing)
I use the following script originally: getURL("http://magdalenaphoto.com/humble.html"); but it automatically goes to that website, does not wait for me to click on the link.
Hi Guys, I have similar issue as cgrimes under point 2 of his post:
I have a button with similar script as his in the button layer. main layers stop (done that by stop(); in the last keyframe in a layer under the button layer) after appearing to create the background and other movieclips loop. However the stop frame in the main timeline makes this button inactive when it reaches the stop frame (the button has to be the first layer in timeline; webhost requirements:/).
could you help me to make it work so that the movie will stop however the button will remain active infinitive while the movieclips loop?
there is probably easy solution however I'm struggling to accomplish this and I suspect it's due to I'm an AS noob therefore any help would be appreciated!
magdalenaphoto. I suspect that your problem is that you are attaching the Actionscript incorrectly. If you are a beginner and you have created a btn then attach this code onto your btn instance not on the frame.
Always add a hit state to a btn otherwise you will struggle especially when the using text. The hit state should be a solid colour that is drawn over the area that you would like to be interactive with the mouse pointer. By leaving it blank is whats causing your problem.
By not putting your getURL("http://magdalenaphoto.com/humble.html"); into a function your are telling flash to run it when that frame is loaded. Thats what is causing your the trouble.
stop() on frames actions should not affect your btns. A function is called when in your example you release the btn.