Change the position of the registration point in Flash CS5

耗尽温柔 提交于 2020-01-12 09:16:26

问题


Is there a way to change the position of the registration point inside a Movie Clip using Flash5 ? I've found stuff online for older Flash versions but not CS5.


回答1:


I wasn't aware of that.

As far as I know, all you need to do is:

  1. edit the MovieClip(Dobule-click)
  2. move the contents of the MovieClip relative to the crosshair on stage

If you want to match the transform point with the registration point:

  1. Go one level up
  2. Use the Transform Tool(Q)
  3. Double-click Transform Tool's circle.

HTH




回答2:


In free transform mode, just move the hollow circle wherever you want and that will set the new registration point.




回答3:


import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Transform;

var rec:Sprite = new Sprite();
rec.graphics.beginFill(0x00FF00, 1);
rec.graphics.drawRect(-50, -50, 100, 100);
addChild(rec);

var tp:Transform = new Transform(rec);
tp.matrix.tx = 0;
tp.matrix.ty = 0;

trace("X: " + rec.x + " Y: " + rec.y);

rec.x = 250;
rec.y = 250;

trace("X: " + rec.x + " Y: " + rec.y);

addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(event:Event):void
{
rec.rotation += (Math.PI / 0.1);
}


来源:https://stackoverflow.com/questions/3701403/change-the-position-of-the-registration-point-in-flash-cs5

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!