Mirroring

Subscribe to Mirroring 10 posts, 3 voices

Sign in to reply


 
avatar for Kaapola Kaapola 37 posts
Flag Post

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?

 
avatar for Vara Vara 763 posts
Flag Post

_xscale *= -1;

 
avatar for Kaapola Kaapola 37 posts
Flag Post

k thanks… and does that command work in as2 or as3? Cause Im using as2

 
avatar for SuperMarioJump SuperMarioJump 220 posts
Flag Post

Try it. If it throws an error assume it’s the wrong language.

 
avatar for Vara Vara 763 posts
Flag Post

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.

 
avatar for Kaapola Kaapola 37 posts
Flag Post

k thanks again

 
avatar for SuperMarioJump SuperMarioJump 220 posts
Flag Post

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.

 
avatar for Kaapola Kaapola 37 posts
Flag Post

well Im just using as2 cause the shootorials were using it and I dont want to relearn the basics…

 
avatar for SuperMarioJump SuperMarioJump 220 posts
Flag Post

Switch to FlashDevelop then, the MTASC compiler is actually useful and will throw errors about the above code. It’s quicker too.

 
avatar for Kaapola Kaapola 37 posts
Flag Post

k I might, after the trial of cs3 runs out (sorry but got used to it already :D)

Sign in to reply


Click Here