Hi, I have just started learning flash and actionscript and would appreciate help with a small issue. I know some Java and C++ but I'm a total begginer here. I was trying to copy the game shown in this video (http://www.youtube.com/watch?v=sK2LEbznMb4), so I created a flash file with a circle, converted it to a Symbol called "ball" of a class "Ball", and tried to modify it from an Actionscript file. However, in the line I try to modify "ball.x" , I get "Error 1009: Cannot access a property or method of a null object reference", which means "ball" is null.
How do I tell ActionScript that I am referring to the "ball" object I already created in the flash file? The guy in the video didn't initialize the variable or anything.
Here is the whole code of the .as file (the circle should fall):
package
{
import flash.display.MovieClip
import flash.events.Event
public class Project extends MovieClip
{
public var ball:Ball;
public function Project():void
{
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
private function enterFrameHandler(e:Event):void
{
ball.y += 1;
}
}
}
The files are called "Project.fla" and "Project.as", and they're in the same folder.
Thanks in advance!