Donate
 
Has KnowFlash helped you?

Donate towards running costs:


Why donate?

Newsletter
Sign up to our newsletter:
 
Enter your email address:
 
flash menu
Tutorials
Video Tutorials
Store
Main Menu
Home
News
Forum
Help/FAQ's
Contact Us
Search
Register
Advertise
Links
Webmasters

Hyperlinks In Flash Print E-mail
Written by Rawpulse   
Friday, 24 February 2006
Find out how to add hyperlinks to your Flash project.
 
So you want to know how to add a hyperlink to your Flash project. Hyperlinks are incredibly common among the web community, and it's possible to use them within Flash, with only a few lines of Actionscript. So, to begin, open Flash. Draw yourself a button or some text. Once you've done that, convert it to a symbol by right clicking it and selecting "Convert To Symbol...". Make sure you select Button from the behaviour list.

The code that we will add later on can only be applied to a button, as we want people to be able to click it, to take them to your site.




Once you've done this, double click on your button with the selection tool and you will go to button editing stage. There are four button stages; Up, Over, Down & Hit. Add a keyframe to each of the four stages. You don't need to make changes to your button throughout these stages if you don't want.





Once you have done this, go back to Scene 1 (your main stage). Your button will still only be on one keyframe. Click on your button with the selection tool. Open the Actions panel by pressing F9. Enter the following code:


on(release){
    getURL("http://www.YourSite.com");
}


Now test your project by pressing Control + Enter. You should be able to click the button, which will take you to your website. The result should be something like this. As mentioned previously, you can also add an email link. This simply requires a small addition to the code:


on(release){
    getURL("mailto: ");
}


Which would result in this. If you have had trouble following this tutorial, tell us about is on the forum. Likewise, if you have enjoyed this tutorial.


Last Updated ( Friday, 20 October 2006 )
< Prev

In association with Coursework Essays , Free Essays , Phishing Scams and Big Red Directory

Copyright Oxford Information Services Ltd 2007