-
Scaling buttons script
Hi everyone I found a cool scaling buttons script. But can anyone take a look at the script and tell me how to make the button gotoAndPlay a scene. Here's the script.
// ---- function to scale buttons in or out
var scaleSpeed:Number = 3; // the higher, the slower the movement is
var originalScale:Number = 100; // default scaling of the buttons
var maxScale:Number = 150; // maximim scaling of the buttons
function scaleButton(scaleTo:Number, scaleClip:MovieClip){
scaleClip.onEnterFrame = function(){
// smooth scaling
this._xscale = this._yscale += (scaleTo-this._xscale)/scaleSpeed;
// stop when scale is finished, remove onEnterFrame function
if(Math.round(this._xscale) == scaleTo){
delete this.onEnterFrame;
}
}
}
// ---- make button actions for webIcon
_root.webIcon.onRollOver = function(){
scaleButton(maxScale, this);
}
_root.webIcon.onRollOut = function(){
scaleButton(originalScale, this);
}
_root.webIcon.onDragOut = function(){
scaleButton(originalScale, this);
}
_root.webIcon.onRelease = function(){
trace("do stuff from webIcon");
}
Thanks
-
rabid_Delineator
this is actionscript 2 code
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|