|
Post by pauZe on Sept 10, 2006 13:53:35 GMT
umm i was wondering how you make a pop up box appear, in the flash window, once you have clicked on a button and for it also to have a close button
any help would be much appriciated
|
|
|
Post by Mike on Sept 10, 2006 20:21:27 GMT
There are a few ways to do it..
I tend to create my popup as a MovieClip and keep it off stage somewhere then to make the popup appear I tween it into place, and to make it popout I simply have a buttton in the movie clip that tweens it back down.
eg:
Make your popup window as a movieClip and give it the instance name MyClip_mc
Then make a button on the main stage to make the window popup, give this an instance of Pop_btn
Inside your MyClip_mc popup MovieClip you want another button to click to get rid of it, give this the instancename PopDown_btn
On your main stage make a new layer, name it actions, and in the first frame enter the ActionScript:
function TweenItY(what, pos, time) { easeType = mx.transitions.easing.Strong.easeOut; ballTween = new mx.transitions.Tween(what, "_y", easeType, what._y, pos, time, false); } Pop_btn.onRelease=function() { TweenItY(MyClip_mc,200,15); } MyClip.PopDown_btn=function() { TweenItY(MyClip_mc,1000,15); }
This basically says when the pop button is pressed it will Tween the popup to the specified Y axis coordinate (ie: On Screen and displayed) and when the close button is pressed it will tween it to another Specified Y avix coordinate (ie: Off screen and out of view).
|
|