A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Making a button on an imported PSD

  1. #1
    Junior Member
    Join Date
    Aug 2010
    Posts
    4

    Making a button on an imported PSD

    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!

  2. #2
    Member
    Join Date
    Jul 2008
    Posts
    94
    First, what you've done sounds fine, so make sure you are running as2, as if your project is in as3, it won't get that code. (File > New... > New AS2 Project i think...)

    I would just make a white box, don't bother changing the alpha or anything. Convert it into a movieclip (not a button, though this will probably work either way) and give it an instance name of reserve. click the movieclip on the stage, and change the colour effect (in properties) to alpha, and change this to 0.

    do the code exactly as you did above.

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

    maybe the reason it isn't going anywhere is that you are trying it locally. why not upload it to the server and see if it works there (flash has some security features that sometimes stop browsers opening etc). either that, or try clicking it, and waiting a few seconds. when offline, this stuff can be slow...

    no idea if that is any use to you, I hope it is.

    dave

  3. #3
    Junior Member
    Join Date
    Aug 2010
    Posts
    4
    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("http://www.redeggnyc.com/menu2.htm");
    }


    and that works (even locally).


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


    Any downside in keeping this older code?


    Thanks.

    P.S. How and am I allowed to post a file? Im a noob here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center