Hello,
I have a problem with a button i want to create. I want different buttons (simple circles) that become bigger and 100% visible when the mouse becomes closer (at a certain distance), visa versa. till 0% visibility
Searched on forumI found this couldn’t find anything helpful. I found the code here below, but i don’t fully understand it to change the code. I tried changing it in many (probably very bad) way’s, as result that it only got worser…
Frame 1:
//this objects x position
posx = this._x;
//reaction boundaries
lbound = (posx - 50);
rbound = (posx + 50);
//default scale
z = 100;
n = 150;
//scale calcs
upscale = z+(posx-_xmouse);
downscale = n-(_xmouse-posx);
//mouse reactions...
if (_xmouse<lbound) {
(this._yscale=z), (this._xscale=this._yscale);
}
if (_xmouse>rbound) {
(this._yscale=z), (this._xscale=this._yscale);
}
if (_xmouse>lbound && _xmouse<=posx) {
(this._yscale=upscale), (this._xscale=this._yscale);
}
if (_xmouse>posx && _xmouse<rbound) {
(this._yscale=downscale), (this._xscale=this._yscale);
}
Frame 2:
gotoAndPlay(1)
Can someone please help me?
Thanks,
DA