A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    the JesterTerrestrial Himself stumpy's Avatar
    Join Date
    Apr 2000
    Location
    The C.O.G. - County Of Grey
    Posts
    203
    Hey there... If you can help me with this one you rule the school!

    I have a varible named oloc.

    This is set with a number depending on the location of a orange bar. It is either 1,2,3 or 4.

    When a button is clicked I want the orange location to goto a new location. either 1,2,3 or 4.

    So this is what I need to know.

    Say that the current location of the orange bar is 1 and oloc is set to 1. Button 4 is clicked so, I want to goto and play frame labled (oloc + 4)

    How do I do this?

    Thanks for your help

  2. #2
    stumpy....
    how about a conditional ?

    if (_root.oloc == 1) {
    gotoAndPlay ("1");
    } else if (_root.oloc == 2) {
    gotoAndPlay ("2");
    } else if (_root.oloc == 3) {
    gotoAndPlay ("3");
    } else if (_root.oloc == 4) {
    gotoAndPlay ("4");
    }

    just make sure that you know where you are setting the variable oloc...the example above is on the root timeline.
    hope this helps
    ~Donnyboy

  3. #3
    NerdInside's Avatar
    Join Date
    May 2001
    Location
    Penguin Island
    Posts
    3,439
    If there are 4 different buttons and the orange bar is in a movie clip by itself, then Tell Target is what you need.

    Put this on the button:
    Code:
    on (press) {
    	tellTarget ("oloc") {
    		gotoAndPlay (#);
    	}
    }
    Replace # with 1, 2, 3, or 4 depending on the button.

    Hope this helps

  4. #4
    the JesterTerrestrial Himself stumpy's Avatar
    Join Date
    Apr 2000
    Location
    The C.O.G. - County Of Grey
    Posts
    203
    What I really need to know is how to concatinate the Varible name and a number. To play frame lable 32 or 12 or 43 or 24...

    This is set from the var oloc and the button that was clicked 1,2,3, or 4.

    I need to figure out how to Goto and play a framed labled (the value of oloc + button number)

    Does this make sence what I am trying to do?
    Peace

  5. #5
    the JesterTerrestrial Himself stumpy's Avatar
    Join Date
    Apr 2000
    Location
    The C.O.G. - County Of Grey
    Posts
    203
    Anyone?

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