A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Variables used to go to frame label

  1. #1
    Member
    Join Date
    Mar 2000
    Posts
    34
    I want to get a movie clip to go to and stop on a frame label. I've named the instance of the movie clip "events". Inside the movie clip I have set up 10 frames labeled event1 - event10.

    I've set up the buttons on the main timeline to control the movie clip, by setting a variable called "selection" and then assigning it a value between 1-10 depending on which button has been rolled over.

    After setting the value of "selection", the button uses a call action to a frame where I have set up a sub-routine of actions.

    I know the variable is getting successfully passed to the call frame, because all of the actions on the subroutine use the variable, and the majority of them work. One, however, does not...

    I want to tell the movie clip "events" to go to and stop on a frame label in the "events" movie clip by stating:

    Begin Tell Target ("/events")
    Go to and Stop ("event"&selection)
    End Tell Target

    In theory, I thought this would tell the movie clip to go to and stop on the label marked event1, event2, or whatever the variable "selection" was equal to, but it's not working.

    What exactly am I doing wrong here?


    Thanks in advance.

  2. #2
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    Just one minor thing thats all:

    Begin Tell Target ("/events")
    Go to and Stop ("event"&/:selection)
    End Tell Target

    selection is a variable on the main timeline.

    The go to and stop part of your script is after a begin tell target command,because of that the go to and stop part of the script is assumed by flash to be running from the timeline that you have targetted(in your case the timeline of the movieclip "events") now the variable "selection" does not reside on the timeline of this movieclip it is based on the main timeline so we use /: to tell flash that the variable is on the main timeline.


    Hope that helps!!
    Regards FlashGuru

  3. #3
    Member
    Join Date
    Mar 2000
    Posts
    34
    Thanks! I should have known that. I do now...

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