3 Replies Latest reply on May 7, 2008 2:24 AM by Kjup

    Get URL on mouse click

    JasperFDO Level 1
      Hey, I know this is basic, but i'm not a programmer, and just trying to make a button in flash link to a URL when clicked on. I have the button and flash knows it is a button, but every piece of code i try, flash doesn't like it, and I don't know what to do....

      here is the last code i tried, but it like other stuff just gives errors when i run the flash check.

      function trailer(evt:MouseEvent):void {
      var url:String = " http://www.myurl.com";
      getURL(url, "_self");

      the name of my button is trailer. THANKS anyone!!!!
        • 1. Re: Get URL on mouse click
          kglad Adobe Community Professional & MVP

          • 2. Re: Get URL on mouse click
            JasperFDO Level 1

            thanks for the code! i put it in and flash gives no errors on the check, and a pointer hand now appears on the swf file, but the link isn't active. when clicked nothing happens. is there anything else I have to do?
            • 3. Get URL on mouse click
              Kjup Level 1
              If you have a button you could also add the action script right to the button rather than to the timeline which is much simpler. Just select your button and choose Browser/Network under the Actions Menu and double click getURL and enter your parameters from there.

              For the method you mention, you would need to have an instance name of trailer on your button in order for this to work properly and add the below code to your timeline as an actionscript, see attached code below: