Flash Button Link

citrus_cyanide

New Member
I just started flash actionscripting, and i can't even make a simple hyperlinked button. the code I used on the button is as follows.

getURL("here's the URL");

What's wrong with it. It's on the same layer and frame and the picture has been converted to a button symbol. Could somebody possibly outline step by step how tom kae a button work. w3schools has tutorials but only for an old flash, i'm using MX 7.2, not Studio 8 by the way.
 

stuluk28

New Member
hey, I'm not sure if you've missed some bits out to reduce the amount in your post, or there are some vital 'bits' missing from the actionscript. But…

The getURL command you've typed will work fine, so long as it is place within an instruction, like on(release) or on(rollover). Also as long as this entire actionscript has been assigned to the actual button, and not just placed in the timeline (although there is a way to do this too).

Basically, you'll need to get rid of the code from the timeline and make sure that only the button is selected, then open the properties panel and click inside the instance name box. type something obvious like 'link1_btn' so it'll be obvious when you see it again. Then open the actionscript panel and look for that instance name somewhere. (this tells you that only that button will be affected). Then enter to the code to create the hyperlink. This needs to be contained within a basic instruction, so for example:

on(release){
getURL("www.thiswebsite.com","_blank");
}

This says that, when the button is clicked, it will load 'www.thiswebsite.com' in a new browser window, hopefully! Just make sure the object is selected before you enter any code, and most commands will always be placed within curly brackets, so you need to type something to create them.

I hope this helps, and that it makes some sort of sense!
 
Top