简体   繁体   中英

Setting movieclip origin with AS3

I have a spotlight that moves on a stage. Now I rotate the spotlight but its not rotating on the correct point/origin.

I am trying to do something like

myOject.setOrigin = {x , y};
//and then rotate it about x,y.

I have manually set the white circle in the correct place and when I rotate the object with the mouse on the screen it works. Can somebody help me?

Make sure the registration point is in the middle of your symbol. It's not the white circle that appears when you use the Free Transform Tool:

But the crosshair that appears when you edit your movie clip:

You can easily center the object by selecting everything, then opening the Align panel and aligning its horizontal and vertical axes to the center using the two "center" icons under the Align section. If your MC has multiple items per layer, group each layer before aligning, then ungroup after aligning:

The white circle is not what will be used as the origin, it's the little cross. Adjust your clip to have that in the center (you'll have to move all of it's contents). Another option, if moving is not possible, is to wrap your clip in another clip and move it within that.

Select symbol and click CTRL+E - Then move it to positioning cross.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM