PDA

View Full Version : minimize,maximize,close


flashlearning
11-06-2006, 12:44 PM
how can i add minimize,maximize,close buttons to movieclip?whats the script.(im beginner )

Noct
11-06-2006, 02:32 PM
Close is the easy one:
on (Release) {_root.myMovieClip.removeMovieClip();}

Or, if you don't want the MC to actually be removed, you could set an empty frame in the movieClip, and call that. (Which is essentially just a better way of using a ._visible)
on (Release) {myMovieClip.gotoAndStop("_null");}

To make Min and Max you need to create a frame for each in the MC itself. One with everything removed for Min, and one in it's full glory for Max.
Then you just call them, and set the MCs .x and .y values so they go where you want.

on (Release) {
myMovieClip.gotoAndStop("_min");
myMovieClip._x = xValue;
myMovieClip._y = yValue;
}

Keep in mind if you want it to be accurate, you need to throw in mouseOvers on the 3 buttons to highlight, (the minimize should technically have right mouse click actions), and the Max button should switch back and forth between restore and max.

maxButton.onRelease = function () {
if (mcMax !=true) {
myMovieClip.gotoAndStop("_max");
mcMax = true;
} else {
myMovieClip.gotoAndStop("_restore");
mcMax = false;
}
}