4 Replies Latest reply on Aug 13, 2010 2:05 AM by Hisham Attia

    Making a button on an imported PSD

    Dathaeus

      Hi all... it seemed like a simple process but I cant seem to get this right... I got a button there, but the URL wont go, ie, the click does nothing.

       

      I imported a PSD layered image to Flash CS3, into a new blank layer.  I need basically an area of this PSD to be "image mapped" so what I did was create a rectangle with the rect tool, over the area I needed the hot spot.

       

      Here I tried to do a transparent box and border (alpha 0) but the outline is still there even though the box is "empty." (any quickie on this would be appreciated, I did select the transparent box, no color, and tried alpha, both same result)

       

      I made that into a symbol, then I double clicked into there to fill in the key pts for the over, hit, etc., states.... I dont have any effects here btw, as simple as we can get.

       

      After that I right clicked on the buttonand entered the action script ("reserve" is the name of my button symbol)

       

      reserve.onRelease=function(){
      getURL("http://www.redeggnyc.com/menu2.htm");
      }

       

      which gave no errors on validation.

       

      When I preview in Flash, everything looks good except the thin black border and the fact that when the button is pressed, nothing happens.  I am assuming this is a little mistake somewhere, or maybe I am just tired!  Thanks!

        • 1. Re: Making a button on an imported PSD
          Hisham Attia Level 1

          Not quite sure, if this will help. But worth a try. I would create my shape first of the part of the image with (or without) border but with fill. Then I convert this area to a button. Now the button will be on top of the image. Now, I will apply a filter and reduce in alpha to zero. While still selected, I'll give it an instance name and use the code as you did. Try that!

          Cheers.

          • 2. Re: Making a button on an imported PSD
            learn n leverage Level 3

            Hi,

            If you make alpha 0 for an object/shape then flash wont consider the object/shape as something that one can click on. You may want it to make just more than 0 i.e.1 if that doesnt affect your design or you can make the Color Effect>Style>Alpha to 0 in the Properties panel for the button symbol as suggested by Hisham Attia.

            Thanks!

            • 3. Re: Making a button on an imported PSD
              Dathaeus Level 1

              I did my old fallback routine of going back to something that worked in the past even though it is old code:


              on (release) {
              getURL("h-t-t-p-:-/-/-w-w-w-.-redeggnyc-.-c-om/menu2-.-h-t-m");
              }


              and that works.


              Now does anyone know what I did wrong with the first try?


              Any downside in keeping this older code?


              Thanks.

               

              P.S.  I made the alpha 0 after I made the button etc... then it worked fine.  When you make it 0 before u make the button then I think u will have problems.

              • 4. Re: Making a button on an imported PSD
                Hisham Attia Level 1

                it is not really a code matter. Your initial code would have been in one layer with an instance name of the object on stage. If you say that with your current code it is working then you would have put the code on the object itself.

                 

                On the other hand you can also import the different layers of PSD separately into Flash and also define them a button themselves. That would probably be the best approach.

                 

                Cheers