The Web Squeeze: As3 Code For Url Link - The Web Squeeze

Jump to content

Forum

Flash and Multimedia

Adobe Flash help forum for teaching and learning coding methods for actionscript, flash slide shows, and flash animation. Want to squeeze out a flash website and need to understand better Flash SEO techniques? Here's the place to do it.
Digg Del.ico.us Slashdot Technorati furl Reddit Facebook Fark Google Magnolia Wink Yahoo Netscape
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

As3 Code For Url Link

#1 User is offline   gribble Icon

  • Squeezing
  • PipPipPip
  • Group: Members
  • Posts: 86
  • Joined: 14-February 08
  • Gender:Male
  • Location:NZ

Posted 14 May 2009 - 08:04 PM

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
0

#2 User is offline   aaron1988 Icon

  • Rapid Squeezer
  • PipPipPipPip
  • Group: Members
  • Posts: 278
  • Joined: 17-January 09
  • Gender:Male
  • Location:Gillingham - Kent

Posted 15 May 2009 - 02:36 AM

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 :)

If you get stuck send reply

Regards,
Aaron
0

#3 User is offline   gribble Icon

  • Squeezing
  • PipPipPip
  • Group: Members
  • Posts: 86
  • Joined: 14-February 08
  • Gender:Male
  • Location:NZ

Posted 19 May 2009 - 01:39 AM

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
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


Page 1 of 1
Trackbacks
Trackback URL Trackback Date Total Hits
No trackbacks were found
Page 1 of 1

Similar Topics
  Topic Started By Stats Last Post Info
Hot Topic (New) Icon Posting Code unitedcraig Icon
  • 22 Replies
  • 4,872 Views
New Replies Icon Wordpress Is Too Helpful And Deleted My Blog Page Code :(
Can I disable all of its code helpers?
cosmicbdog Icon
  • 7 Replies
  • 3,503 Views
New Replies Icon Copy Code welshstew Icon
  • 5 Replies
  • 1,556 Views
New Replies Icon Flyouts Or Fold Outs What Are They And How Do You Code It
I don't mean the Eric Myers css hover thingy
Sharron Icon
  • 10 Replies
  • 1,859 Views
New Replies Icon Tutorial Link thewal Icon
  • 4 Replies
  • 1,312 Views

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users