Create a simple button in Flash using rectangular tool and getURL(); - AS2
Posted under » Flash on 28 March 2012
Probably the simplest way to create a button
- Create a new flash movie and change the size to 120px (width) x 70px (height).
- Choose a rectangular tool by clicking on or press R on your keyboard.
- Create a small rectangle at the centre of the stage.
- If you do not wish to see it, you can set the alpha to 0%.
- Select the rectangle by double click on it.
- Click 'Insert' > 'Convert to Symbol' > 'Button' for the behavior; Then type 'hyperlink' in the name field and click ok.
- Now you have the rectangle as a button instance.
- With your arrow tool still selected, click on the flash button instance which you have just created.
- Click 'Window' and choose 'Actions'.
- Type the following actionscript provided below into the white space:
on (release) {
getURL("http://www.google.com");
}
Note : this only works in AS2. For more info.