how do I use xscale
- thedo12
-
thedo12
- Member since: May. 18, 2007
- Offline.
-
- Forum Stats
- Member
- Level 04
- Blank Slate
basicly I want to know how to use it so I can change my characters animations easily but I dont know how, is there a tut on it or something? heres an example of a code I would use it on.
onClipEvent(load){
speed=13; stop();
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)){_x+=speed; gotoAndStop(1);}
if (Key.isDown(Key.LEFT)){_x-=speed; gotoAndStop(1);}
}
onClipEvent(enterFrame){
if (Key.isDown(65)){gotoAndStop(2);}
if (Key.isDown(68)){gotoAndStop(3);}
if (!Key.isDown(68) && !Key.isDown(65)){gotoAndStop(1);
}
}
- FappingFriends
-
FappingFriends
- Member since: Jun. 2, 2007
- Offline.
-
- Forum Stats
- Member
- Level 02
- Blank Slate
- JeremysFilms
-
JeremysFilms
- Member since: Feb. 18, 2005
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
_xscale is a property, just like _x is.
The value of _xscale is to be a percentage, 100 being normal, 50 being half, 200 being double, etc.
So for example, you can make a movie clip with this code on it:
onClipEvent(load){
this._xscale = 50;
}
That would make the movie clip half as wide.
If you used the value of -100, it would be flipped backwards, -50 would flip backwards and make it half as wide.
- thedo12
-
thedo12
- Member since: May. 18, 2007
- Offline.
-
- Forum Stats
- Member
- Level 04
- Blank Slate
great it works for everything but I hate not know what it means can you explain it to me?
- Shinki
-
Shinki
- Member since: Feb. 14, 2005
- Offline.
-
- Forum Stats
- Member
- Level 10
- Blank Slate
_xscale is the percentage of the object's original size.
With a value of 100 it is at its original size (horizontally).
With a value of 50 it is half its original size.
With a value of -100 it is it's original size but mirrored about the registration point.
The same applies for _yscale which is vertical.
- thedo12
-
thedo12
- Member since: May. 18, 2007
- Offline.
-
- Forum Stats
- Member
- Level 04
- Blank Slate
thanks this will be usefull for every game I make

