6 Replies Latest reply on Apr 30, 2010 12:28 PM by Ned Murphy

    setting up links to external .ASP pages...

    r_tist Level 1

      Hi,

       

      In my timeline I have different link hot spots, so that each product will link to a separate web page (externally).

      I don't think this is going to work:

       

      on (release) {

                getURL(http://www.mysite.com/product01);

      }

       

      When I upload the Flash file to a server to test, the links show me the 'pointing finger' icon, but when clicked upon it does not even open another web page attempting to follow the link. - that tells me this doesn't work!

       

      I need to get this correct for when the final goes live. What am I missing? Should I try the extension? (product01.asp) ?

       

      Any advice appreciated!

       

      Thank you!

        • 1. Re: setting up links to external .ASP pages...
          Ned Murphy Adobe Community Professional & MVP

          Where are you placing that code?

          • 2. Re: setting up links to external .ASP pages...
            r_tist Level 1

            I am attaching to an alpha rectangle that is covering the entire stage (the rectangle is set to button). The action is pasted onto the first frame.

             

            In the timeline, the keyframes are all filled in, in gray, spanning the duration of the image.

             

            Hopefully this helps!

            • 3. Re: setting up links to external .ASP pages...
              Ned Murphy Adobe Community Professional & MVP

              That code gets placed onto an object, not in the timeline, so if you can click on a frame in the timeline and see that code, it is in the wrong place.  You need to click on the button and then place the code in the Actions panel.  There should be no visible evidence of the code existing if you deselect the button (which is one reason why coding this way is not a recommended practice).

              • 4. Re: setting up links to external .ASP pages...
                r_tist Level 1

                OK, when I click on the gray area in any of the keyframes composing

                where the button exists, I am getting the code - which is not what you are recommending.

                 

                So, I suppose I need to add it directly to the button graphic itself.

                 

                Can I use this same script, or does it need to be something different? Please let me know what I need to type if something different.

                 

                Thank you!

                • 5. Re: setting up links to external .ASP pages...
                  r_tist Level 1

                  I've been reading. Seems w/ CS4 you cannot attach actions directly to buttons. - This 'graphic' really does not need to be a button as it does not require use of the 4 states. I just need an overlay of a graphic with an outbound link to a website. I need to repeat this a few times within the same timeline, and each outbound link will differ.

                   

                  What is the simplest way to do this? (firstly, should I convert the 'button' back to a 'graphic' or even a 'movie clip'?

                   

                  Thanks!

                  • 6. Re: setting up links to external .ASP pages...
                    Ned Murphy Adobe Community Professional & MVP

                    Whether you can attach code to objects or not depends on the version of actionscript you're using (AS2 vs. AS3), not the Flash version (CS#).  The code you showed is AS2 code, which allows code to be attached to objects.  But having mentioned that's bad practice anyways, let's go for goodness.

                     

                    Take that graphic and convert it to a Movieclip symbol.  Select the movieclip on the stage and in the Properties Panel assign it an instance name where it says <Instance Name>.  Let's say you give an instance name of "btn_mc".  Then, create a new layer for actions if you don't already have one, and in the same frame where this btn_mc starts, in the actions layer, enter the following code:

                     

                    btn_mc.onRelease = function(){

                          getURL("http://www.mysite.com/product01");

                    }

                     

                    Then check your Flash Publish Settings to be sure you are specifying AS2 for the file.