#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Posts
    15
    Rep Power
    0

    goto a frame based on a variable


    I have a movie clip which I want to go to a certain frame based on a var on the mail time line.

    I put this script action into a key frame in the 1st frame on the clip timeline:

    if (_root.v1=a) {
    gotoAndStop ("a");
    }


    if the var a on the main time line equals a then goto frame label a on the clip...

    Where did I go wrong? this does not work

    Thanks
  2. #2
  3. No Profile Picture
    Dev
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2001
    Posts
    1,436
    Rep Power
    41
    I think you mean:

    if(_root.v1 == a)


    _root.v1 = a sets _root.v1 to a

    _root.v1 == a checks of they are equal.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Posts
    15
    Rep Power
    0
    Thanks Jeff, the whole actionscript thing is new to me. I was able to achive my goal by labeling the frames with the possible variable inputs. Then it was a simple:

    gotoAndStop (_root.varname);

IMN logo majestic logo threadwatch logo seochat tools logo