i have this code to move a clip from point
a to point
b. it works fine, no problems at all with the movement. the problem i am having is to stipulate what point a is. the code lets me predefine what point
b will be. i can state what the
x and
y coords will be for that but i cannot say what the point
a x and
y coords wil be
a step by step to movement is below:
add code to the movieclip
onClipEvent(load)
frict = .2
ratio = .1
turnSp = xSp = ySp = xScSp = yScSp = 0
turnEnd = _parent.turnEnd
xEnd = _parent.xEnd
yEnd = _parent.yEnd
xscaleEnd = _parent.xscaleEnd
yscaleEnd = _parent.yscaleEnd
onClipEvent(enterFrame)
turnSp = turnSp*frict+(turnEnd-_rotation)*ratio
xSp = xSp*frict+(xEnd-_x)*ratio
ySp = ySp*frict+(yEnd-_y)*ratio
xScSp = xScSp*frict+(xscaleEnd-_xscale)*ratio
yScSp = yScSp*frict+(yscaleEnd-_yscale)*ratio
this._x += xSp
this._y += ySp
this._rotation += turnSp
this._xscale += xScSp
this._yscale += yScSp
- onClipEvent(load)
- frict = .2
- ratio = .1
- turnSp = xSp = ySp = xScSp = yScSp = 0
- turnEnd = _parent.turnEnd
- xEnd = _parent.xEnd
- yEnd = _parent.yEnd
- xscaleEnd = _parent.xscaleEnd
- yscaleEnd = _parent.yscaleEnd
-
- onClipEvent(enterFrame)
- turnSp = turnSp*frict+(turnEnd-_rotation)*ratio
- xSp = xSp*frict+(xEnd-_x)*ratio
- ySp = ySp*frict+(yEnd-_y)*ratio
- xScSp = xScSp*frict+(xscaleEnd-_xscale)*ratio
- yScSp = yScSp*frict+(yscaleEnd-_yscale)*ratio
- this._x += xSp
- this._y += ySp
- this._rotation += turnSp
- this._xscale += xScSp
- this._yscale += yScSp
now set the parameters for the tween on the main timeline
( on a frame or button action )
xEnd=475
yEnd=300
turnEnd=180
xscaleEnd = 120
yscaleEnd = 200
- xEnd=475
- yEnd=300
- turnEnd=180
- xscaleEnd = 120
- yscaleEnd = 200
see the problem?
i dont. would love a little help on this please!