Kaapola
37 posts
|
Is there a way to mirror a scene, as in, turn around the whole picture on the x- or y-axis? For example, in this case I want to make a guy hit with a sword to the left in one frame series and then the same guy hit to the right in another, do I have to make the movements over and over or is there a possibility to turn the guy around immediately and accurately?
|
Vara
1598 posts
|
|
Kaapola
37 posts
|
k thanks… and does that command work in as2 or as3? Cause Im using as2
|
SuperMarioJump
303 posts
|
Try it. If it throws an error assume it’s the wrong language.
|
Vara
1598 posts
|
It’s AS2, for AS3, you need to use scaleX *= -1;
And for mario, AS2 is so friendly that sometimes it doesn’t even throw an error if you use AS3 code (AS3 will always throw an error through – unless you’ve turned strict mode off)
Example:
// Note that this is not perfect AS3:
// It misses some class definitions and using asterics by importing is not recommned either.
// AS2 seems strict enough to throw an error if you add those things through
import flash.display.*;
var mySquare:MovieClip = new MovieClip();
mySquare.graphics.beginFill(0x00FF00, 1);
mySquare.graphics.drawRect(-50,-50,100,100);
mySquare.graphics.endFill();
mySquare.x = 100;
mySquare.y = 100;
function rotateSquare(event) {
mySquare.rotation++;
}
mySquare.addEventListener("enterFrame", rotateSquare);
addChild(mySquare);
This is AS3 code. In AS3, this will create a green rotating square, in AS2 this is complete nonsense, but AS2 won’t throw an error if you use it.
|
Kaapola
37 posts
|
|
SuperMarioJump
303 posts
|
Jesus Christ I just tried it and you’re right, how does anyone work like this? AS2 is more “noob friendly”, but it doesn’t even tell you where you’re going wrong? How on earth are you supposed to learn like that? Even if you do learn, how do you manage to debug? I always wondered why people posted huge AS2 code blocks here asking what’s wrong, I thought they were just stupid.
|
Kaapola
37 posts
|
well Im just using as2 cause the shootorials were using it and I dont want to relearn the basics…
|
SuperMarioJump
303 posts
|
Switch to FlashDevelop then, the MTASC compiler is actually useful and will throw errors about the above code. It’s quicker too.
|
Kaapola
37 posts
|
k I might, after the trial of cs3 runs out (sorry but got used to it already :D)
|