Skip to main content
Participant
February 4, 2009
Question

Link to URL losing me.

  • February 4, 2009
  • 1 reply
  • 305 views
Good morning. I am in a pickle. I've only piddled in Flash and am a complete noob to Actionscripting.

Basically, we no longer have a Flash designer on-site and it's not in the budget to freelance the banner we need.

I've created a simple banner. When you roll over the banner a layer appears that details the banner further. When you click on the banner we want to open a web page (URL) in the same window. Sounds simple or so I thought. sigh.

I've basically made the roll-over layer a symbol and have applied the action script to that layer. However when I click on the SWF in the browser it will not load that new page. Flash application shows no errors in the script. (see script below.)

quote:

button1.addEventListener(MouseEvent.CLICK, onMouseClick); function onMouseClick(e:MouseEvent):void { var request:URLRequest = new URLRequest("xxxxx"); }


(obviously I have the proper URL in my actionscript, not just xxxx)
I'm sure it's pathetically simple. However this is escaping me how to make this work.

Thanks.
This topic has been closed for replies.

1 reply

Colin Holgate
Inspiring
February 4, 2009
Doing this:

button1.addEventListener(MouseEvent.CLICK, onMouseClick); function onMouseClick(e:MouseEvent):void { var request:URLRequest = new URLRequest("xxxxx"); }

only sets up the request variable with what it needs to know. To actually go there, do this instead:

button1.addEventListener(MouseEvent.CLICK, onMouseClick); function onMouseClick(e:MouseEvent):void { var request:URLRequest = new URLRequest("xxxxx"); navigateToURL(request,"_self")}