Skip to main content
Participating Frequently
April 16, 2010
Answered

Pan Image with AS2

  • April 16, 2010
  • 2 replies
  • 2038 views

I am looking to create a similar effect to the one in this website:

http://www.timoweiland.com/

I have a large image that I would like to pan around on various button clicks and I have no idea how to begin.  Any help or a point to the right post/tutorial would really be appreciated. 

This topic has been closed for replies.
Correct answer Ned Murphy

Look into using the actionscript Tween class to change both _x and _y positions and _xscale and _yscale values gradually.  You might be able to find something thru Google using "AS2 Tween tutorial"

That particular site uses more than one image to achive its effect.

2 replies

Participant
April 19, 2010

No problem,

What he is doing on the site you reference is just adjusting the ._x and ._y properties of his movie clip based on the mouse position.

Here is your code:

this.onEnterFrame = function() {

  myMC._x = _root._xmouse;

  myMC._y = _root._ymouse;

}

done!

Ned Murphy
Legend
April 19, 2010

What you offered will only have the movieclip following the mouse around the stage.  That is not what is going on in that site.

Nathan821Author
Participating Frequently
April 19, 2010

Thanks Ned.  I have been running through some AS2 and AS3 tweening tutorials and this seems to be

what I was after.  I appreciate your help.

Ned Murphy
Ned MurphyCorrect answer
Legend
April 16, 2010

Look into using the actionscript Tween class to change both _x and _y positions and _xscale and _yscale values gradually.  You might be able to find something thru Google using "AS2 Tween tutorial"

That particular site uses more than one image to achive its effect.