4 Replies Latest reply on Mar 22, 2011 9:41 AM by dagil2011

    Embed url in flash file

    dagil2011

      I am new to using Flash (CS5 pro) and have created a leaderboard ad that I need to have link to a website.  Can someone please help me.  I have looked online and it all appears foreign to me....

       

      Thanks!

        • 1. Re: Embed url in flash file
          Ned Murphy Adobe Community Professional & MVP

          You can create an invisible button for linking to the new web site.  To create an invisible button just create a new button symbol and draw a small rectangle in the frame labelled "Hit". 

           

          You can then place that button in a layer above all the other content layers in your timeline and locate/size it as needed.  When you place it on the stage it will be visible in the editing mode via a semi-transparent turquoise color, but it will not be visible when you run the file.

           

          Then you need to assign an instance name to the button via the properties panel and add the code for the button in the timeline.  The code you add depends on which version of Actionscript your file is using, which you can find in the Flash Publish Settings.

          1 person found this helpful
          • 2. Re: Embed url in flash file
            dagil2011 Level 1

            Here is my action script:

             

             

            button_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);

             

            function fl_ClickToGoToWebPage(event:MouseEvent):void

            {

            navigateToURL(new URLRequest("http://www.siteIwanttolinktoo"), "_blank");

            }

            • 3. Re: Embed url in flash file
              Ned Murphy Adobe Community Professional & MVP

              That code is fine as long as your file is set up to be using AS3, and you have a button on the stage that you have assigned the instance name (not the library name) of "button_1"?

               

              If that's all good, then do you get any error messages?  Have you tried testing it on a server?

              1 person found this helpful
              • 4. Re: Embed url in flash file
                dagil2011 Level 1

                Got two errors....

                 

                Scene 1, Layer 'TAGline', Frame 1, Line 5 1084: Syntax error: expecting rightparen before Object

                Scene 1, Layer 'TAGline', Frame 1, Line 5 1084: Syntax error: expecting identifier before rightparen

                 

                 

                any ideas?