FORUMS: list search recent posts

Scale problem

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Brian Mills
Scale problem
on Jun 8, 2007 at 4:24:24 pm

Hey all,
Im trying to create an interface that scales up when the user mouseover the buttons...ive gotten most of it to work...but ive run into a snag...
here is the url with the swf

http://mpg.udayton.edu/scale.swf

notice when you mouse over a button the first time the scale works fine...then when u mouse over the other button the scaling changes...im not sure what im doing wrong...here is the code for the scaling

onClipEvent (enterFrame) {
myYscale=this._yscale
myXscale=this._xscale
trace (this.myXscale);
trace (this.myYscale);

if (yvel == 1) {

this._xscale = myXscale+Math.round((200-myXscale)/10);
this._yscale = myYscale+Math.round((200-myYscale)/10);

}
if (yvel == 0) {

this._xscale = myXscale+(Math.round(100-myXscale))/10;
this._yscale = myYscale+(Math.round(100-myYscale))/10;

}
if (ysmall == 1) {


this._xscale = _xscale+(50-_xscale)/5;
this._yscale = _yscale+(50-_yscale)/5;

}
if (ysmall == 0) {

this._xscale = _xscale+(100-_xscale)/5;
this._yscale = _yscale+(100-_yscale)/5;

}
}



here is the button code

button1.onRollOver = function() {

b1.ysmall = 1;
a.yvel = 1;
};

button1.onRollOut = function() {
b1.ysmall = 0;
a.yvel = 0;

};
button2.onRollOver = function() {
b1.yvel = 1;
a.ysmall = 1;


};
button2.onRollOut = function() {
b1.yvel = 0;
a.ysmall = 0;


};


any help would be great
Thanks
Brian


Return to posts index

Brian Mills
Re: Scale problem - I got it!
on Jun 8, 2007 at 6:43:26 pm

a little more research and i found this code...
I put this on my MC

onClipEvent (load) {
targXscale1 = 100;
targYscale1 = 100;
}
onClipEvent (enterFrame) {
cXscale = this._xscale;
cYscale = this._yscale;
difXscale = cXscale-_root.targXscale1;
difYscale = cYscale-_root.targYscale1;
setProperty(this, _xscale, cXscale-(difXscale/5));
setProperty(this, _yscale, cYscale-(difYscale/5));
}


then i put this on my buttons

button1a.onRollOver = function() {
targXscale1 = 200;
targYscale1 = 200;
targXscale2 = 50;
targYscale2 = 50;
};
button1a.onRollOut = function() {
targXscale1 = 100;
targYscale1 = 100;
targXscale2 = 100;
targYscale2 = 100;
};

I just differentiated the MC scale prop(targXscale) with a 1 or 2
worked great....


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]