AS3 Basics 6 – Links!

In: Actionscript|Flash|Source Code

6 May 2009

Hello again. It’s time for another AS3 basics write up – today I’m doing Links.
Whilst the AS3 code is slightly longer than AS2′s getURL(); it’s still not bad.

?View Code ACTIONSCRIPT3
//Define the location of the link 
var url:String = "http://www.lawriecape.co.uk";
//Create a new URL request -
var request:URLRequest = new URLRequest(url);
//You can then open in the same window -
navigateToURL(request, '_self');
//Or open in a new window -
navigateToURL(request, '_blank');

That’s it. Nice and simple.
Cheers.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • StumbleUpon
  • Tumblr
  • Twitter

Comment Form

About this blog

This is the blog of Lawrie Cape, an interactive developer from Leeds, England.

Photostream

  • COne
  • CTwo
  • CThree
  • CFour
  • Lawrie: Hi Dinaz, I'm not sure what's happening on your system I'm afraid. When you run the FlashMidiServer [...]
  • Dinaz Kardooni: Hi, I am having trouble with the Flash Midi Server. I downloaded it and it says it is connected, but [...]
  • It’s Movember again! - The Lawrie Cape Blog: [...] was a great project to work on and I wrote a blog post about it here. We had a nice surprise t [...]
  • Lawrie: Glad you got it working :) [...]
  • Anonymous: Yeah, had to do this first: var mc:MovieClip = MovieClip(this.parent); trace(map(mc.mouseY, 0, s [...]

Donate

Found any helpful code? Why not donate a quid or two. Cheers!