Tuesday, 27 May 2008

Open Url

This flash tutorial will teach you how to open a Url with a button. This flash tutorial is very simple and only requires one line of code.

For this tutorial I have used a free stock image of a light bulb for the button which is available at:www.sxc.hu

Open Url with button

Step 1

Open a new flash document.
Create your button on the stage. I used a light bulb for my button but you can design whatever you wish.
Convert your button into a symbol by selecting F8. Give your button an appropriate name, check the button and click ok.


Step 2

Right click on your button and select “actions” and enter the following code:

on (release) {

getURL("http://www.ilike2flash.blogspot.com");

}

This line of code opens up the above Url in the same window. You can change the Url to whatever you want. If want to open the Url in a new window then add the “_blank” to the end eg. ("http://www.ilike2flash.blogspot.com","_blank");


Step 3

Test your movie Ctrl + Enter


You should now have a button which opens a url.

0 comments:

What next ?

Subscribe to Flash Tutorials

Add to Technorati Favorites

Follow my Twitter