this will stop at a particular scale percentage:
[AS]
on(rollOver){
function shrink(){
if(this._xscale>20){
//replace the 20 with thesize you want to stop at
this._xscale = this._yscale -= 10;
}
}
keepShrinking = setInterval(shrink, 100)//100 is speed in milliseconds
}
on(rollOut, DragOut){
clearInterval(keepShrinking);
this._xscale = this._yscale = 100;
}
[/AS]
This will stop at a particular width or height:
[AS]
on(rollOver){
function shrink(){
if(this._width>20 && this._height>20){
//replace the 20 with thesize you want to stop at
this._xscale = this._yscale -= 10;
}
}
keepShrinking = setInterval(shrink, 100)//100 is speed in milliseconds
}
on(rollOut, DragOut){
clearInterval(keepShrinking);
this._xscale = this._yscale = 100;
}
[/AS]
okay I think I got what you want this time make it shrink on rollover then grow back to original size on rollout. If that is backwards I will make notes next to the lines that need to be changed, makes the changes and it should work.
[AS]
onClipEvent(load){ //this is so the function is only defined once
function growOrShrink(){
this._xscale += gOrS;
this._yscale += gOrS;
}
on(rollOver){
gOrS = -1;//if you want it to shrink faster make the -1 a -3 or -4
grower = setInterval(growOrShrink,100);
if(this._xscale<20 || this._yscale<20){//change 20 to something else to make it grow or shrink more
clearInterval(grower);//might need “” around the name in there
}
}
on(rollOut){
gOrS = 1;//make a 3 or 4 to grow faster
grower = setInterval(growOrShrink,100);
if(this._xscale>=100 || this._yscale>=100){
clearInterval(grower);//might need “” around the name in there
}
}
[/AS]
okay that should do what you need to make it work the other way around use this for the rollover/rollout states:
[AS]
on(rollOver){
gOrS = 1;//if you want it to shrink faster make the -1 a -3 or -4
grower = setInterval(growOrShrink,100);
if(this._xscale>120 || this._yscale>120){//change 120 to something bigger to make it frow more
clearInterval(grower);//might need “” around the name in there
}
}
on(rollOut){
gOrS = -1;//make a 3 or 4 to grow faster
grower = setInterval(growOrShrink,100);
if(this._xscale<=100 || this._yscale<=100){
clearInterval(grower);//might need “” around the name in there
}
}
[/AS]
if this is still not what you need feel free to email me at shawn@veuphoria.com and I could build you an little example file or maybe look at your .fla and get you going in the right direction.
I get off work at 6am US eastern time so it will be a few minutes before I can check my personal email.
Senocular has showed me an amazing tutorial on OOP and prototypes, constructors and all. It’s besically an entire guide through ActionScript 1.0. It’ll be up on kirupa.com in a while, so keep an eye out for it =)
I work for the Air Force on 12 hour night shifts making sure people dont nuke something somewhere. But luckily my job is boring, so I get to check out Kirupa and other slightly less cool Forums
Anyway I will be waiting to see that tutorial, and good luck Kay
I modified Voetsjoeba’s great sample file to have several of these scalable buttons in a row. But I now have a stacking order problem – if the buttons are too close together to start out with, the button that is targeted will grow to either cover a button next to it, or be partially hidden by a button next to it.
My question is , would it be easier in AS to Swap Depths so that every targeted button goes to the top (it’ll still partially cover buttons next to it), or is there a way to make the x of neighbor buttons move aside upon rolling over the target button?
That’s impressive. I see what you mean about moving back to their original postion, but the AS is far more efficient than motion-tweening would ever be. What does “schaal” mean?