# Problem with Camera

**URL:** <https://forum.kirupa.com/t/problem-with-camera/314964>\
**Category:** flash\
**Created:** [October 13, 2010, 2:48pm UTC](https://forum.kirupa.com/t/problem-with-camera/314964 "2010-10-13T14:48:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![L\_E\_O](https://avatars.discourse-cdn.com/v4/letter/l/f19dbf/32.png) [@L\_E\_O](https://forum.kirupa.com/u/L_E_O)\
**Post date:** [October 13, 2010, 2:48pm UTC](https://forum.kirupa.com/t/problem-with-camera/314964/1 "2010-10-13T14:48:53Z")

</div>

im making a sidescroller game, so i need a camera that fallows the player as he moves, i got this code:

import flash.geom.Matrix;  
import flash.geom.Transform;  
import flash.geom.ColorTransform;  
var copyrightNotice = “Copyright © 2006-2007 Sockpuppet Pty Ltd. All Rights Reserved. [http://www.reanimator.net](http://www.reanimator.net)”;  
var reanimator = new Transform(this);  
var camera = new Transform(this.\_parent);  
var w:Number = Stage.width;  
var h:Number = Stage.height;  
this.\_visible = false;  
this.onEnterFrame = function () {  
this.\_parent.filters = this.filters;  
var stageMatrix:Matrix = reanimator.matrix;  
camera.colorTransform = reanimator.colorTransform;  
stageMatrix.invert();  
stageMatrix.translate(w\*.5, h\*.5);  
camera.matrix = stageMatrix;  
}

your stupposed to put that one inside a mc on the frame, and then you put this code:

onClipEvent (enterFrame) {  
\_x += (\_root.player.\_x-\_x)/4;  
}

on the outside on top of mc.

the problem is that the camera is off, it cuts off about 3/4s of my original stage. cam anybody help?
