A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Linking with text...

  1. #1
    Junior Member
    Join Date
    Mar 2004
    Location
    LBC
    Posts
    5

    Linking with text...

    Hi, I was looking around through other threads and tutorials, and I haven't been able to figure something out.

    I was wondering if there's a way I can link to other scenes in Flash MX with text? I tried to do it by making the text as a button and then just doing the action script as:
    on (release) {
    gotoAndPlay("home", 1);
    }

    But when I preview it, the links arent working. I don't know what I'm doing wrong. Can u not have text for a button or something?

    Thanks

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    You can not target scenes from within a movieclip ( if that is waht you do ). You have to make a framelabel on the frame where you want to go and reference that.

    on(release){
    _root.gotoAndPlay("myFrameLabel");
    }


    You can also use the asfunction to have hyperlinks trigger internal events.

    http://www.macromedia.com/support/fl...asfunction.htm

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Junior Member
    Join Date
    Mar 2004
    Location
    LBC
    Posts
    5
    No, it wasn't a movie clip. What I had done was create a new symbol (button)... then I drew a rectangle and wrote "HOME" (for example) in the middle of the rectangle. I did this on the "Up" frame, then I copied and pasted the frame in the "Over", "Down", and "Hit" frames. Then I went to the action scripts and assigned the:
    on (release) {
    gotoAndPlay("home", 1);
    }

    script to it. That didn't work though.. so I went back and edited the button and tried to do it by putting the over and hit states on different layers.. but that didn't work either. Does it have to be a movie clip to work as a button?

  4. #4
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Scripts for buttons should not be inside the button but applied ON it. Just select the button and paste the code in the actions panel.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  5. #5
    Junior Member
    Join Date
    Mar 2004
    Location
    LBC
    Posts
    5
    I dragged the button from the library onto the scene where I wanted it. Then I selected it and wrote out the action... but when I test the movie... it wont go anywhere... I put the stops at the end of all the scenes... but they still wont link.

  6. #6
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Your code is correct for referring to a scene, not if you want to target a framelabel..... If the framelabel is named home.....

    on (release) {
    _root.gotoAndPlay("home");
    }

    _root means the main timeline.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  7. #7
    Junior Member
    Join Date
    Mar 2004
    Location
    LBC
    Posts
    5
    Got it! Thanks for your help.

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