View Full Version : How to flip a MC ?!
I want to flip (0x) a movie clip, but i don't find any property!
I use _xscale but when I flip the MC this one move to another X position. But i want it to STAY where it is!!!
Thanx a lot!
Ricod
02-21-2002, 03:52 PM
_xscale if for ... scaling the _x. To flip, u'll need to use _rotation
OK, I try to explain what I want to do!!!!
I want to do a fighting game, so i need to create an animation for my players. It's Ok! BUT, when the player2 (in the beginning, on the right of the player1) goes on the left to the player1, i need Player1 looking to the left, and the player2 looking to the right.
This is my PB!!
I need this
O
|-
|
became this
O
-|
|
Thanx for your answer!!
Ricod
02-21-2002, 06:27 PM
Right ! Like streetfighter etc. ehm ... now what was that specification again ? It was skewing, but how did u do that again ? I'll look into it ...
Jesse
02-22-2002, 03:41 AM
If '0x' is your isntance name, change it. You shouldn't begin frame labels, instance names or variables with a number. Then try this code:
_root.thing._xscale = -100;
Where 'thing' is your new instance name...
pixelwit
02-22-2002, 09:02 AM
To be sure your character flips in the same position when you set it's scale to -100 be sure the graphic in your clip is centered.
Hope it helps,
-PiXELWiT
http://www.pixelwit.com
To Jesse: 0x is the X axis, and i want to flip my movie on this axis...
To PixelWit: I 'd do it but the X position always change.
I'll get the center of my mc with MC.getBounds. (xMax - (xMax -xMin)/2), and i'm looking if the center i found equal a variable (center of the other player found with the same way).
Is it the good way to do it ? Perhaps this is why my clip move after fliping ?
Thanx a lot....... !
Jesse
02-23-2002, 02:45 AM
No he means ensure the graphic is placed in the center of the movieclip's timeline. Edit the movieclip and group all the objects on the movieclip timeline (select them and Ctrl G) then use Ctrl K and center the objects using the alignment panel. That way it will flip on it's center and the _x will not change.
To Jesse:
I've already centered my character in the main timeline of the MC. That's why i ask if the way i use to found the center of the MC is the good one.
Here is the link to download the .zip file conotains my .fla of my character. Note that the char is not the final one. This one is just for the test...
For the link see my last post!
Thanx to all of you!!!
Ricod
02-25-2002, 09:13 AM
No, no xxlm ! Jesse and pixelwit mean the center of your graphic. That little black cross (registration point) oughta be in the center of your character mc, cuz it scales from there ...
There's an explanation here : Click this URL ! (http://www.actionscripts.org/tutorials/intermediate/scrolling_a_text_box_II/index3.shtml)
Ok, i've already done all of this. I've centered my char with the center panel (CTRL K). For each image, i've grouped all the objet and center the "little balck cross" in the center of the animation ...
But none of this way works... So i've tried something. In a Main MC (called i.e MAIN), i've loaded the MC character (like in my game) and i've done a clip containing the same thing like my MC char.
So i've got two identical MC of my char: one loaded, one made "by hand".
AND WHEN I CLICK ON THE BUTTON TO SCALE TO -100 THE TWO MC, THE HAND MADE "FLIP" CORRECTLY AND THE LOADED ONE NOT. IT _x POSITION CHANGE.
So i deduce when a MC is load with loadMovie, the center of the MC receiving the load MC correspond to the lower left of the load MC.
Am I clear enouth !! I don't know!! lol
Is it right? And if it is how can i change this?
If you want example of what i said click on the link beneath. Here it's a .fla for the MAIN scene, with a character's clip "hand made", and the .fla of the mc loaded.
www.lagoon.nc/xavier/fight/main.zip
The joy of programing !!!!
Thanx .
Ricod
02-27-2002, 10:16 AM
Hate to burst your bubble xxlm, but they both flipped when I pressed the button. I didn't do anything except Ctrl+F12 (publish). So plz check again (might be that when u tested, it used the one in the cache, thus not showing the newer correct one). Good choise of character though :) !
To Ricod or other people looking for my pb!
Ok, they both flipped! But take another look please.
The upper cli is the "HAND MADE". It flip correctly, and its center do not move (_x do not change).
The lower one (load from MC "chunli_zero.swf") flip too. But its center move (_x change).
Have you got the same thing?
If so, how can i center a loadMC in the MC receiving it?
Thanx to all of you and sorry to annoy you!!!
A flash programmer quite near the depression!!! LOL
Ricod
02-27-2002, 12:22 PM
Right ! ... ehm ... I have no idea how to do that. But here's an alternative ...
put the swf in its own mc, like the handmade, and label that. Now target that mc with the button like :
_root.monclip.chunli._xscale = -100;
pixelwit
02-27-2002, 01:01 PM
Your movie "chunli_zero.fla" is not "centered". It's "origin" (0,0) is in the top left of the stage instead of your fighter's belly button.
Here's what you need to do. Open "chunli_zero.fla". Select all frames on the main timeline. Cut them (like copy, but more severe). Select "Insert" then "New Symbol". Name it "Fighter Chick" or something. Select the first frame of the Fighter Chick MC and paste all the frames you cut from the main timeline. Notice your animation is now "centered". Go back to the main timeline. Drag an instance of your Fighter Chick onto the Stage. Position the "center" of your Fighter Chick in the very top left corner of the stage (0, 0). Create a SWF of your new file. Open "Main.fla" and test it.
Hope it helps,
-PiXELWiT
http://www.pixelwit.com
So we have to center the clip in the upper left corner of the MC.
Good things to know.
Thanx to all of you!!!
And rendez-vous, when the game will be done, for some test!!!!
Now i can go to sleep!!! GOOD!
chinesefreeman
02-27-2002, 11:06 PM
Hail every one, i am the one who team with xxlm, about our game project, and i really want to thank you for ur support
:D
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.