Simply flash actionscript hyperlink


How to make a simple flash actionscript button with a hyperlink function in Micromedia Flash


1.
First of we want to create a button to apply this actionscript to, I'll go through these steps quick.
First of with the oval tool make a green oval on the stage

Photoshop Tutorial thumb picture


2.
Now we want to make a reflection to the button.
So right click our shape and choose break apart, now select the fill part of the button and make a copy of it on the stage.
drag it outside so we have room to work in. select and delete the buttom part.

Now we will add a gradient to it from white to transparent, so select the shape, and go to the properties menu click the fill color and choose gradient and make a gradient as below.
Then use the gradient transform tool to rotate the gradient to vertical.

Photoshop Tutorial thumb picture


3.
Right click the reflection and choose convert to symbol, and choose convert to movieclip.
Move the reflection layer on top of the oval shape.
Go to the filters properties for the reflection and give it a bit of blur to soften the edges.

Photoshop Tutorial thumb picture


4.
Now select both shapes and right click and choose convert to symbol, and choose convert to button.
As you can see of my final flash movie, i made it animate in color when you click it, that you can read about in another tutorial.

5.
Now for the actionscript.
This is very simple for this small part. Click your button and open up the actions panel.

Photoshop Tutorial thumb picture


6.
Type in the following code, and I will explain it afterwards.

------------------------------------------------

on (release) {
getURL("http://www.0tutor.com", "_blank");
}

------------------------------------------------

on (release)
Means that the following code you type will run when your mouse button is released on the thing you have clicked.

the { } is the container, it shows the start and end of the on (release) code.

getURL("http://www.0tutor.com","_blank"); is our small code, getURL is the function, then followed by the http address, and the _blank is also well knowned in html language as explaining to open up in a new window and not the same as the on you are currently in.

Photoshop Tutorial thumb picture


Run your flash movie and click your button, and you will see your default internet browser open up the website.

 

0tutor.com rss feed