1 Attachment(s)
[F8] easy:if(mc._xscale<50){//do smthng} if not: problem...
hi. can someone please tell me why this is not working. this should be easy for anyone who actually knows a bit about anything ... :rolleyes:
i'm trying to make an mc 'pic' grow if clicked, attach a text box to it, and on a second click make it shrink again and unattach the text box. i've tried testing the mc's size with if-statements like so:
Code:
if (pic._xscale <= 50) {
pic.onRelease = function() {
myTween = new mx.transitions.Tween(pic, "_xscale", easeType, 50, 100, 7);
myTween = new mx.transitions.Tween(pic, "_yscale", easeType, 50, 100, 7);
attachMovie("textbox", "textbox", 100, {_x:300, _y:10});
};
}
if (pic._xscale ==100) {
pic.onRelease = function() {
myTween = new mx.transitions.Tween(pic, "_xscale", easeType, 100, 50, 7);
myTween = new mx.transitions.Tween(pic, "_yscale", easeType, 100, 50, 7);
unloadMovie("textbox");
};
}
i've tried many variations of this code. sometimes i get the first if-statement to work, sometimes the second, but never both of them. this code does grow the 'pic' and attach the text box, but ignores the second if-statement. i've attached an example fla.
your help will be very much appreciated!