Hi Everybody
I am working in flash cs3 past 1 years i have small error in flash cs3 coding.
I create external class file,
//
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.display.Stage;
public class Main extends MovieClip {
private var iLoop:int=1;
private var sta:Stage;
public function Main():void {
//sta=this.parent.parent;
//trace(this.parent.parent);
this.addEventListener(MouseEvent.CLICK,msDown);
this.addEventListener(MouseEvent.ROLL_OUT,msOut);
this.addEventListener(MouseEvent.ROLL_OVER,msOver);
}
public function msDown(e:MouseEvent):void {
for (iLoop=1; iLoop<3; iLoop++) {
//MovieClip(sta.getChildByName("mc"+iLoop)).gotoAndStop(1);
MovieClip(getChildByName("mc"+iLoop)).gotoAndStop(1);
}
e.currentTarget.gotoAndStop(3);
}
public function msOut(e:MouseEvent):void {
e.currentTarget.gotoAndStop(1);
}
public function msOver(e:MouseEvent):void {
e.currentTarget.gotoAndStop(2);
}
}
}
when i run this code i got the error message
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Main/msDown()
i attached my file also