A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: Changing Frames

  1. #1
    Senior Member
    Join Date
    Mar 2004
    Location
    Upper Marlboro, MD
    Posts
    146

    Changing Frames

    I have movie that has 4 frames. I also have a movie clip with a contact label. I want to be able to click on the label and go to frame 4. How do I reference frame 4 from the movie clip using action script?

  2. #2
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,317
    _parent.
    or
    _root
    .: To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Twitter - Linkedin
    bringmadeleinehome.com

  3. #3
    Senior Member
    Join Date
    Mar 2004
    Location
    Upper Marlboro, MD
    Posts
    146
    I don't understand what you mean. I tried the code below and it didn't work

    {gotoandstop _root frame 4}

    Could you show me the syntax?

  4. #4
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,317
    code:


    _root.gotoAndStop(4)


    Use your flash manual. Open flash and press F1
    .: To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Twitter - Linkedin
    bringmadeleinehome.com

  5. #5
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    Unless tweens are set to zero in the main movie, the above code won't work.

  6. #6
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,317
    Quote Originally Posted by Bob Hartzell
    Unless tweens are set to zero in the main movie, the above code won't work.
    Who, what, where WTF???
    .: To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Twitter - Linkedin
    bringmadeleinehome.com

  7. #7
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    Webdreamer, you are confused. This is not a flash forum.

  8. #8
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,317
    He he.

    didnt notice the forum section before posting.

    My apologies
    .: To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Twitter - Linkedin
    bringmadeleinehome.com

  9. #9
    Senior Member
    Join Date
    Mar 2004
    Location
    Upper Marlboro, MD
    Posts
    146
    the tweens are set to 6. so if that code doesn't work, how do I reference the main stage from a movie clip?

  10. #10
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    You can set the default tweens in the main stage to 0 in Frames > Default Tweens. Then the argument 4 will work. Otherwise, you need to count the number of tweens up to key frame 4:
    I think it is (6 + 1) x 3 + 1.

  11. #11
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Or just name the frame you need to jump to then use the name in you're gotoAndPlay

  12. #12
    Senior Member
    Join Date
    Mar 2004
    Location
    Upper Marlboro, MD
    Posts
    146
    I named the frame contact and put the following code on the contact button in the movie clip:

    _root.gotoAndStop(contact)

    It didn't work.

    The error message: Line1:expecting a mouse event statement

    Where can I find a tutorial on action script? Because my biggest problem is syntax. How do I make the code work (_root.gotoAndStop(contact))

  13. #13
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    _root.gotoAndStop('contact')

  14. #14
    Senior Member
    Join Date
    Mar 2004
    Location
    Upper Marlboro, MD
    Posts
    146
    thank you .... that worked. it's funny how a simple line can cause the code not to work

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