Results 1 to 2 of 2

Thread: Using An Array With Buttons

  1. #1
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Using An Array With Buttons

    I have six buttons on my stage and whichever one is pressed send the playhead to the framelabel respectively, this is the code

    Code:
    numOfBtn = 6;
    stop();
    for (i=0; i<numOfBtn+1; i++) {
    	this["btn"+i].num = i;
    	this["btn"+i].onRelease = function() {
    		gotoAndStop("frm"+(this.num+1));
    	};
    }
    But before it goes to the framelabel I want the playhead to play first and THEN go to the framelabel... Any ideas? Should I remove this line gotoAndStop("frm"+(this.num+1)); and add it further down the playhead? It doesn't seem to work

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by tomyknoker View Post
    I have six buttons on my stage and whichever one is pressed send the playhead to the framelabel respectively, this is the code

    Code:
    numOfBtn = 6;
    stop();
    for (i=0; i<numOfBtn+1; i++) {
    	this["btn"+i].num = i;
    	this["btn"+i].onRelease = function() {
    		gotoAndStop("frm"+(this.num+1));
    	};
    }
    But before it goes to the framelabel I want the playhead to play first and THEN go to the framelabel... Any ideas? Should I remove this line gotoAndStop("frm"+(this.num+1)); and add it further down the playhead? It doesn't seem to work

    the not-so-clean way of doing it would be to play the playhead at the beginning of each framelabel (i.e. add the playhead play action to the framelabel frame)


    another (half-baked) suggestion is to use somethine equivalant
    to the onMotionfinished(); method with Tweens. Not sure what that would be though.

    BliZZard seems to be MIA or else I'm sure he'd know.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •