Hi,

Wondering if any can see the problem with the scripting below: i've found some code online for a scrolling background and added it to my own code (intend to write my own eventually as i dont like have large chucks of code in my script i didnt write - makes it a pain in the arse to alter later on...) - the coding was written in as3 but altered slightly as it was written to be used within the movie and not in a document class.

i can see what it's trying to do - update the x position of the frontPic everytime the timer fires, which in turn is set off by mouse movements. however when i test it, the frontpic loads in fine, but as soon as you move the mouse it disappears? I've clearly gone very wrong somewhere but cant see it...

(also please forgive the general mess in the code. i've deleted large parts to make it easier to find what's relevant...)

thanks

PHP Code:
package {
    
//imports

    
public class homePage extends MovieClip {

        private var 
timer:Timer;
        private var 
speed:Number 0.9;//variables

        
public function homePage() {
            
init();

        }
        private function 
init():void {

            
backPic=new backGrass  ;
            
addChild(backPic);

            
frontPic=new frontGrass  ;
            
addChild(frontPic);

            
timer = new Timer(40,0);
            

            
this.addEventListener(Event.ADDED_TO_STAGE,stageActive);
            

        }
        function 
stageActive(evt:Event):void {

            
stage.scaleMode=StageScaleMode.NO_SCALE;
            
stage.align=StageAlign.TOP_LEFT;
            
stage.addEventListener(Event.RESIZE,resizeHandler);
            
            
            
timer.addEventListener(TimerEvent.TIMERmoved);

            
backPic.x=stage.stageWidth 2;
            
backPic.y=stage.stageHeight;

            
frontPic.x=stage.stageWidth 2;
            
frontPic.y=stage.stageHeight;

            
            
this.addEventListener(MouseEvent.MOUSE_MOVE,timerCalled);
            
        }
        function 
resizeHandler(evt:Event):void {

                        
//function
        
}
        
        private function 
timerCalled(event:MouseEvent):void {

        
timer.stop();
        
timer.start();
    }
    
        private function 
moved(event:TimerEvent):void{
            
            
frontPic.speed frontPic.speed stage.stageWidth frontPic.width mouseX stage.stageWidth;
        
backPic.speed backPic.speed stage.stageWidth backPic.width mouseX stage.stageWidth;

        if (
Math.abs(frontPic.stage.stageWidth frontPic.width root.mouseX stage.stageWidth) < && Math.abs(backPic.stage.stageWidth backPic.width root.mouseX stage.stageWidth) < 1) {
            
frontPic.x=stage.stageWidth frontPic.width mouseX stage.stageWidth;
            
backPic.x=stage.stageWidth backPic.width mouseX stage.stageWidth;
            
timer.stop();


        }
        
event.updateAfterEvent();
            
        }
        
        private function 
onClickHome(event:MouseEvent):void {

            
//function
        
        
private function tweenFinished():void {

            
//function
        
        
private function homeIntroComplete(event:Event):void {

            
//function
        
        
private function homeLoading(event:ProgressEvent):void {
            
            
//function
        
        
public function homeLoadComplete(event:Event):void {

            
//function
        
        
private function homeOutroComplete(event:Event):void {

            
//function
        
        
private function homeBtnClicked(event:Event):void {

               
//function
    
}