Skip to main content
December 15, 2007
Question

How to make URL link in flash movie

  • December 15, 2007
  • 8 replies
  • 813 views
hi...i'm really new to flash, and trying to link to a URL via a mouse click and it isn't working. accidentally posted this in the wrong action script forum, so hopefully this is the right place.

basically, i've inserted the key frame and converted that to a button. then put in the action script below:

thermostatbutton.addEventListener(MouseEvent.CLICK, goWhere)
function goWhere (evt) {
var url = " http://www.hvactechsupport.com/controls-main.asp"
navigateToURL(new URLRequest(url))
}

when I export the SWF and the movie gets to that point, my mouse arrow shows the little hand pointer, but a click doesn't activate the link.

any help would rock. THANKS!
This topic has been closed for replies.

8 replies

kglad
Community Expert
Community Expert
December 19, 2007
you are using as3. and in the as2 forum, they thought you wanted to use as3 and wanted as3 help.

now, it turns out you have flash 8 and can't use as3. so, you need to use as2 code and if you have any problem with that, use the as2 forum.
December 18, 2007
thanks guys...i originally posted this in the as 1 & 2 forum, but someone told me i was using as 3. i don't know what the heck i'm using - screw it. i'll forgo the hyperlinks. THANKS.
Known Participant
December 18, 2007
Sorry, thought you were looking for an AS3 answer.
kglad
Community Expert
Community Expert
December 18, 2007
in general, you can't use actionscript 3 in flash 8. use a.s.2
December 18, 2007
thanks for the help Mithrandireself...when i paste your code into my flash 8 and run the script check it gives me errors. am i not support to just paste that in place of what I had? it gives me these errors:

**Error** Scene=Scene 1, layer=therm-3, frame=144:Line 3: The class or interface 'MouseEvent' could not be loaded.
function goWhere (evt:MouseEvent):void {

**Error** Scene=Scene 1, layer=therm-3, frame=144:Line 5: The class or interface 'URLRequest' could not be loaded.
var request:URLRequest = new URLRequest(url);

Total ActionScript Errors: 2 Reported Errors: 2

THANKS so much for the help so far.
Known Participant
December 18, 2007
Known Participant
December 18, 2007
It might be that your assignment of var url does not have the datatype of :string

I attached a re-written version of your code, tell me if it works.
Participant
December 18, 2007
i've try it and it's working well, don't understand why it's not working for you. The only thing i see is that you've put your code in a ActionScript 2.0 file instead of ActionScript 3.0