Error Message When Using a Class Files to Control Navigation
This is my first attempt at using a class file in a flash project. My intent is to keep all of my navigation elements in class file called "Navigation". However, I keep getting an error message when I publish.
I am using a button to go back to the main screen and I gave that button the instance name of "bnt_home". I have also linked that button in the library to the class "Navigation".
Here is the code:
package
{
import flash.display.SimpleButton;
public class Navigation extends SimpleButton
{
public function Navigation()
{
bnt_home.addEventListener(MouseEvent.MOUSE_DOWN, goNavigation);
}
private function goNavigation(event:MouseEvent):void
{
gotoAndPlay(1,"Main");
}
}
}
