1
votes

I'm developing a flash application. I am looking for a simple way to animate my camera's movement. Is there any built in tweening library that supports the camera object? I've checked out greensock.com, but I couldn't figure out how to use their libraries for the camera object.

EDIT: by camera I mean the viewing perception. Not a real hard drive web camera.

2

2 Answers

2
votes

If I understand well your question, you could have the Video as a child of a 'movable' object and then tween the container (with greensock or native APIs):

var myVideo:Video = new Video();
myContainer.addChild(myVideo);
// then tween myContainer
2
votes

There are a few ways to mimic camera movement in flash. The easiest way is to think of it in reverse.

Imagine you have a camera attached to the ceiling looking down at your floor. The floor represents the stage. On the floor you have a table, this is your uppermost DisplayObject, typically your Document class.

On this table are all the things you are displaying.

Now, you can't move that camera in the ceiling, nor can you move the floor, so what you need to do is to move either the table itself or the parts on it the "opposite" way. Say you want the camera to pan left; you move everything to the right.

TLDR: So, to get a "camera", wrap the things you want to pan around in a Sprite and move that Sprite the opposite way.