A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Help with '_visible'. Flash MX.

  1. #1
    Junior Member
    Join Date
    May 2004
    Posts
    21

    Help with '_visible'. Flash MX.

    I have the current actionscript on a button.

    on (press) {
    _root.cover._visible = !_root.cover._visible;

    }


    cover being the name of one of my symbols.

    What this does is Hide and reveal a symbol on the click of a button. What I want the script to do is reveal THEN hide a symbol on click. Flash brings up an error when I move the !, so I'm at a loss.

    Any help would be much appreciated.

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    So the symbol appears for a short time then dissapears again?

    You could maybe have the symbol appear when the button is pressed and then dissappear when it is released again,

    Code:
    on (press) {
    	_root.cover._visible = true;
    }
    on (release, releaseOutside) {
    	_root.cover._visible = false;
    }
    or you might have the symbol appear when the button is pressed and then dissappear again after a fixed time,

    Code:
    on (press) {
    	clearInterval(revealID);
    	_root.cover._visible = true;
            // hide the symbol again in 500 milliseconds time
    	revealID = setInterval(function() { _root.cover._visible = false; }, 500);
    }

  3. #3
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    _root.cover._visible = false;
    on (press) {
    _root.cover._visible = !_root.cover._visible;

    }

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