A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] Button Issues / _visible

  1. #1
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540

    [F8] Button Issues / _visible

    Man, am I frustrated. Didn't really consider myself a novice, but since I can't figure this out, I think I need to re-evaluate. I have these buttons left and right that tween a mc when pressed. Now when the _x value of the mc gets to certain point I want the buttons to becomse invisible. Problem is, they don't. Here's what I have for code:

    lTmb_mc.onPress = function() {
    if(tmbs._x <= 519.9) {
    this._visible = true;
    } else {
    this._visible = false;
    }
    myTweenX = new Tween(tmbs, "_x", Regular.easeOut, 373, 519.9, 2, true);
    }
    rTmb_mc.onPress = function() {
    if(tmbs._x >= 519.9) {
    this._visible = true;
    } else {
    this._visible = false;
    }
    myTweenX = new Tween(tmbs, "_x", Regular.easeOut, 519.9, 373, 2, true);
    }

    As it stands the tween occurs whenever the button is pressed and I'd like to have it so that when the mc._x reaches a position, it won't continue to tween. I know there's a solution, probably simple too, that eludes me. If there's a better way, please feel free to enlighten me. Thanks.

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    onPress as a single command will not 'wait and see if' the correct _x pos. of the tmbs has been reached. You need a loop that will 'wait and see if'

    check .onMotionFinished in the Tween class in the livedocs or your help files.

    here you have them all:
    http://livedocs.adobe.com/flash/8/main/00004142.html

    gparis

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