Welcome Guest!

If you do not have an account yet on The Web Squeeze forums, please Register! It's FREE and there are many benefits:

  • Receive Fast Advice
  • Learn Programming Languages
  • Get Professional Website Reviews
  • Quick Troubleshooting Assistance

> As3 Code For Url Link

This is a discussion on As3 Code For Url Link, within the Graphics, Flash, and Multimedia section. This forum and the thread "As3 Code For Url Link" are both part of the Designing Your Website category.

 
Reply to this topicStart new topic
> As3 Code For Url Link
gribble
post May 14 2009, 08:04 PM
Post #1


Squeezing
***

Posts: 86
Joined: 14-February 08
From: NZ

I have created a Flash banner but need to add a link to another website.
I don't want to create a button to trigger the link but rather have the whole banner clickable.
How is this achieved? I am using Flash CS4.


--------------------
.......................................

Gribble
icon advertising
Go to the top of the page
 
+Quote Post
aaron1988
post May 15 2009, 02:36 AM
Post #2


Rapid Squeezer
****

Posts: 269
Joined: 17-January 09
From: Gillingham - Kent

Hi gribble,

All you do is make sure the banner is a button symbol so

Right click the Banner/Header click Convert to Symbol and choose Button then click OK

Then give the Banner/Header an Instance name of what you like for example I gave mine banner_btn

Then create a new layer above all your other layers called actions and on frame 1 of the actions layer press f9 then

enter this CODE

banner_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("http://www.yourwebsiteurl.com/"));
}

The RED is what you can change but banner_btn needs to be the same as you gave the instance name of the banner

and the yourwebsiteurl.com which is in red too needs to be the URL you want to give it..

And thats it smile.gif

If you get stuck send reply

Regards,
Aaron
Go to the top of the page
 
+Quote Post
gribble
post May 19 2009, 01:39 AM
Post #3


Squeezing
***

Posts: 86
Joined: 14-February 08
From: NZ

Thanks Aaron. Works like a charm but how backward-compatible is the code?
I am dealing with people who are likely to still have Flash Player 7!


--------------------
.......................................

Gribble
icon advertising
Go to the top of the page
 
+Quote Post
If you found The Web Squeeze to be helpful, please donate so we can keep this site FREE, FRESH, and fortified with Web Design & Development info!
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No new   22 unitedcraig 4,669 19th September 2008 - 08:44 PM
Last post by: Monie
No New Posts   7 cosmicbdog 3,175 30th June 2009 - 01:53 AM
Last post by: cosmicbdog
No New Posts   5 welshstew 1,488 19th February 2008 - 01:15 AM
Last post by: Monie
No New Posts   10 Sharron 1,791 20th February 2008 - 06:40 PM
Last post by: Daygon
No New Posts   4 thewal 1,248 19th February 2008 - 11:19 AM
Last post by: Jacob