Thanks Glos, you were close, the *= is the correct usage to multiply. What I didn’t know was that the number is the percentage and not an actual number to multiply by. So the number is -100.
Only downside to the script that we have now is that it only occured once. I needed a listener or something to keep checking to see if the x coordinate of the mouse had changed.
The script that seems to be working correctly is:
_root.onMouseMove = function(){
if(_xmouse >= Stage.width/2){
trace(“it is at more than half!”);
_root.gun_mc._xscale = 100;
}else{
trace(“it is at less than half!”);
_root.gun_mc._xscale = -100;
}
}
Let’s say that your movie is 50 pixels wide:
_xscale= 100; // mc is still 50 pixels wide
_xscale*= -1 // 100 * -1 = -100 so mc is flipped but still 50 pixels wide
As you can see, = -100 and *= -1 are both the same
But what if you’ve already resized your movie, say by 50%?
_xscale= 50; // mc is resized to 25 pixels wide
Now, if you use _xscale= -100, your movie is flipped but it reverts back to the original 50 pixel width. However, if you use _xscale*= -1, then 50 * -1 = -50 so your movie is flipped but it still retains your amended scaling of 25 pixels.
So -100 isn’t the number in these circumstances. Hope that explanation helps.
And updateAfterEvent() might help solve the other problem…check it out in the Help files.