# A famouse error that i have

**URL:** <https://forum.kirupa.com/t/a-famouse-error-that-i-have/306385>\
**Category:** Uncategorized\
**Created:** [March 14, 2010, 2:50pm UTC](https://forum.kirupa.com/t/a-famouse-error-that-i-have/306385 "2010-03-14T14:50:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![adi\_fl](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@adi\_fl](https://forum.kirupa.com/u/adi_fl)\
**Post date:** [March 14, 2010, 2:50pm UTC](https://forum.kirupa.com/t/a-famouse-error-that-i-have/306385/1 "2010-03-14T14:50:58Z")

</div>

hello everyone i am new in this forum (and please forgive me for my english).  
my problem is this:  
i have scrolling thumbnails (one movieClip with many movieClips inside), each thumbnail is a movieClip which is a button, and each one has a class.  
the movieClips which are on the stage on the fla file working when i start the swf file , but those who are above or under the stage on the fla file which come on the scrolling, when i press on them there is this error:  
TypeError: Error #1009: Cannot access a property or method of a null object reference.  
at DragDrop10/::drag()

i hope i explaind my problem well and you’ll be able to help me.

this is the class code:  
package {  
import flash.display.MovieClip;  
import flash.events.MouseEvent;  
import flash.net.URLRequest;  
import flash.net.URLLoader;  
import flash.display.Loader;  
import flash.events.Event;

public class DragDrop10 extends MovieClip {  
public var target:MovieClip;  
private var originalX:Number;  
private var originalY:Number;

public function DragDrop10() {  
originalX=this.x;  
originalY=this.y;

this.addEventListener(MouseEvent.MOUSE\_DOWN, drag);  
}  
private function drag(event:MouseEvent):void {  
var req:URLRequest= new URLRequest(“Joct.swf”);  
var loader:Loader = new Loader();  
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, fileLoaded);  
loader.load(req);  
target.addChild(loader);  
loader.x = -540;  
loader.y = -400;

}  
function fileLoaded(event:Event):void {

}

}  
}

and this is the main time line code (include the scrolling code):  
stop();  
this.addEventListener(Event.ENTER\_FRAME, scrolly);  
function scrolly(event:Event):void  
{  
var myVar:Boolean = true;  
if(this.mouseX\>75)  
{  
myVar=false;  
}  
if(this.mouseX\<51)  
{  
myVar=true;  
}

if(this.mouseY\>550 && myVar==true)  
{  
all2\_mc.prevFrame();  
all2\_mc.prevFrame();  
all2\_mc.prevFrame();

}  
else  
{  
all2\_mc.play();  
}  
if(this.mouseY\<300 && myVar==true)  
{  
all2\_mc.nextFrame();  
all2\_mc.nextFrame();  
all2\_mc.nextFrame();

}  
else  
{  
all2\_mc.stop();  
}

if(this.mouseY\>550 && this.mouseY\<300 && myVar==true)  
{  
all2\_mc.stop();  
}  
}

stage.scaleMode = flash.display.StageScaleMode.NO\_SCALE;  
stage.align = flash.display.StageAlign.TOP\_LEFT;

var buttons:Array = [all2\_mc.all\_mc.jan\_mc, all2\_mc.all\_mc.feb\_mc,  
all2\_mc.all\_mc.march\_mc, all2\_mc.all\_mc.april\_mc,all2\_mc.all\_mc.oct\_mc ]  
for (var i:uint = 0; i\<buttons.length;i++)  
{  
buttons\*.target=stam\_mc;  
}
