Skip to main content
Participating Frequently
September 13, 2011
Question

Need help with linking urls in Action script 2

  • September 13, 2011
  • 2 replies
  • 331 views
Hello I am new to the community, I doing a free website for internship purposes, long story i cannot get my buttons to link in flash site, i have tried many different codes and none had worked, i am a newbie and i need some guidance in the right direction.    I have three links  Link1, Link 3, and Link 4  The current code I am using is        import flash.net.navigateToURL; import flash.net.URLRequest;  var link_four:link4;  link_four = new link4(); stage.addChild(link_four);    link_four.addEventListener(MouseEvent.CLICK, buttonClickHandler);  function buttonClickHandler(event:MouseEvent):void { var url:String =   "http://itunes.apple.com/us/podcast/id352213332"; var request:URLRequest = new URLRequest(url); navigateToURL(request); }   Please Help!     Thanks  Gina T
This topic has been closed for replies.

2 replies

Ned Murphy
Legend
September 13, 2011

You are using actionscript 3 code, but say you are linking urls in Action script2.  So you may want to check your Publish Settings and set them to be for AS3, or if you intend to be using AS2, then change your code to AS2.

Kenneth Kawamoto
Community Expert
Community Expert
September 13, 2011

Your script itself seems OK, provided you have a Library item with its class set to "link4" (and/or you have a class file "link4.as"), and no buttons on stage. Do you see the "link_four" button on stage when you run the script?