SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2008
    Location
    Idaho
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hyperlink problem in flash cs4

    Hey everyone, I used to have an account on here, but it has been years since Ive been on and I dont even remember my account name... anyways. I've been designing websites and programming for a while, but I haven't used flash in forever and the last version of flash I used was MX... so it has been awhile. Anyways I just got CS4, made a header for my site with navigation on it, but I can't figure out why my hyperlinks are not working!! I have the button symbol made, when I edit it I click on the "down" frame, click on the text then put my url in the "link" option on the left and it acts really weird when I test it.

    When I click the button during testing the down frame flickers a lot and if I click really fast it will load up the page or several of them, but it never works on just one nice click... anyone have any ideas why it is doing this? I have tried putting a rectangle box in the "hit" frame to make sure it just wasn't freaking out cause of that, but it didn't work. Any help would be greatly appreciated!

    Thanks

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hello

    You cannot add actions in the edit button symbol state. Undo everything you did other then a change on hover if you created one.

    Now keeping in mind that I have not used Flash in quite some time nor have I ever used Flash CS4 (bloatware edition)
    You need to give the button instance a name (myButton), then target that from the first frame of the movie on a separate layer for actions add:
    Code Actionscript:
    myButton.onRelease = function {
      getURL("http://google.com/")
    }
    Now assuming the object with this instance name exists on the first frame of the timeline it will work, however if the nav is on the root timeline but does not load until frame 30 (or whatever) move this to the timeline at frame 30.

    If the nav is contained within a movieclip with an instance name (myMovieclip) you will have to account for this as well:
    Code Actionscript:
    myMovieclip.myButton.onRelease = function {
      getURL("http://google.com/")
    }
    Hope this helps, but as I say I have not used cs4 yet. Need more help just ask.
    Last edited by RetroNetro; Dec 13, 2008 at 21:48. Reason: better use of english

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2008
    Location
    Idaho
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I entered in your code and it gave me an error (with renamed instance and everything) it said this

    1084: Syntax error: expecting leftparen before leftbrace.
    1084: Syntax error: expecting identifier before leftbrace.
    1084: Syntax error: expecting rightparen before leftbrace.

    Pretty annoying that I can't just make a simple URL! It seems that they have changed some things around in CS4... they have an different action script options to choose from which seem to simplify the script used. you can choose from (actionscript 3, 2, flash lite 1, etc.) so I tried flash lite which seemed to still have the url function in it.

    that code gives me this:
    1087: Syntax error: extra characters found after end of program.

    I'm so lost.... any more help would be great. I'm half tempted to revert back to flash MX or something for the time being...

    P.s. sorry I couldn't post my code, forum wont let me due to the fact that I could be a spammer... and it thinks im posting web links or something

  4. #4
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    My code should work under actionscript 2, do not think it will work under AS3, not sure on flash lite as I have never ever used it.

    I would say to post the file, but I will not be able to open it in the version I am using (flash 8), though you can still post it and maybe anotehr forum user can help. It is slow around here on the weekends, give it a few hours and once people start getting to work you will get some help.

    As far as the possible spammer and posting code, do not take offense, they have a huge issue with link spammers here and this is just another attempt by the SP staff to make it nicer for everyone.

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2008
    Location
    Idaho
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    None taken, it is very understandable... Anyways, i didnt even think of trying action script 2.0 and it worked. I just created an onRelease action in each separate button action script panel and it worked fine. Thanks for the help.


Bookmarks

Posting Permissions

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