-
Zombie Coder
Registration points/flipping an mc.
Here's a tricky problem. Tricky to explain without diagrams too.
I have a main movie clip for a character on the screen.
Within the mc are several nested mc's that contain the character animations
If you press the right arrow key, the character walks right. To maintain the correct direction I use the code ob._xscale = -100;
Same for the left direction. except.ob._xscale = 100;
The problem is, when you go left, the character flips, but the the mc leaps halfway across the screen in the opposite direction. I know it's because of the mc's being quite large. However, if the main top level registration point is centered, I thought the mc would flip around that point. Apparently not. It's making some kind of composite median registration point from all of the nested mc's and using that as the registration point.
Then I tried something like hero_mc._x-=hero_mc._x=hero_mc._width/2;
to center the mc, but all this did was transform the mc somewhere off into nowhere. I'm not sure what else to try. Tried setting some localToGlobal values too, but nothings going right.
I figure I could probably do a check for last direction against current direction and if they're different then set the x position at an + - offset that is dependant on which direction the mc is going. Seems like a long way to go about things - if only the mc would revolve around a central point it would work fine.
-
The registration is the + sign in the movieclip not the circle. You have to actually edit the movieclip and move all the content in relation to the +.
-
Pumpkin Carving 2008
If the character always starts facing right, change the inner movieclips registration points to the middle of the side closest to the characters center registration which is what character flips across when the flip occurs.
Swak: You can set the registration point when you create the movieclip, so if kris can and it's not too big of a problem, re-creating the movie clips may help.
The 'Boose':
ASUS Sabertooth P67 TUF
Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
8GB G.Skill Ripjaws 1600 DDR3
ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
New addition: OCZ Vertex 240GB SATA III SSD
WEI Score: 7.6
-
Trainee coder
Originally Posted by ImprisonedPride
Swak: You can set the registration point when you create the movieclip, so if kris can and it's not too big of a problem, re-creating the movie clips may help.
You dont have to re-create the movieclip if you want to change the position of an mc's registration point. You can just move all of its contents, as swak suggested.
-
Qwaizang:syntax_entity_
First of all, I don't know what sort of nesting structure you're using for your movieclips. The structure you should be using is something like this:
World.Hero.Animations[]
If this is what you're working with, you need to take all of your nested animations and translate them within the container ("Hero") at startup so that they'll be at the proper position to flip correctly.
It sounds like your problem is that your nested animations are being moved inside their container rather than their container being moved. Check your motion code to make sure you're translating the container and not the nested animations in all of your directional routines. This would explain the intermittent and unexpected flipping errors.
Qwai•zang \kwî-'zan\ n [origin unknown] 1 : abstract designer, esp. of complex real-time experiments, c. 21st century
-
Pumpkin Carving 2008
Originally Posted by Viza
You dont have to re-create the movieclip if you want to change the position of an mc's registration point. You can just move all of its contents, as swak suggested.
Yeah but if your animations are 100 frames long, it would be probably be easier to re-create the frames. Meh, at least in my brain it would.
The 'Boose':
ASUS Sabertooth P67 TUF
Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
8GB G.Skill Ripjaws 1600 DDR3
ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
New addition: OCZ Vertex 240GB SATA III SSD
WEI Score: 7.6
-
There's a button you can press to manipulate them all at once.
-
Script kiddie
IP, that's what the 'Edit Multiple Frames' button is for.
-
Zombie Coder
Aggh.. This is going in my Top-Ten-Stupidest-Questions-I've-Asked-on-FlashKit list.
Of course, all I had to do was align the nested clips to the center. Jesus. Duh.
-
Now tell me whos watchin......
you would probably have to extend that list later on. After you find the solution, everything seems like a stupid question.... ive asked alot already, and now i just search google, to make myself look less nubby here lol.
-
Pumpkin Carving 2008
Originally Posted by VENGEANCE MX
IP, that's what the 'Edit Multiple Frames' button is for.
Hmmm.... I've heard nor seen of any such thing... probably could've saved me years of remaking animations.
The 'Boose':
ASUS Sabertooth P67 TUF
Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
8GB G.Skill Ripjaws 1600 DDR3
ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
New addition: OCZ Vertex 240GB SATA III SSD
WEI Score: 7.6
-
Originally Posted by ImprisonedPride
Hmmm.... I've heard nor seen of any such thing... probably could've saved me years of remaking animations.
do you know which button it is? Try pressing each button under the timeline.
-
Pumpkin Carving 2008
Oh THAT lol. Yeah... I'm stupid... was thinking something else. With finals coming up, my brain is fired...
The 'Boose':
ASUS Sabertooth P67 TUF
Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
8GB G.Skill Ripjaws 1600 DDR3
ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
New addition: OCZ Vertex 240GB SATA III SSD
WEI Score: 7.6
-
You should get one of those hats that you can juice a lemon to help you concentrate. fired? or fried
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|