I'm having trouble understanding packages. I have folder named electionMap
with 2 files in it, Morrow.as and Map.fla. The latter has a Movieclip called morrow and the
former has the code below. I keep getting the following error message:
"5001: The name of package 'electionMap' does not reflect the location of this file. Please change the packagedefinition's name inside this file, or move the file. /Volumes/Kenny/Workspaces/Jim/Decision2008FlashMap/Project/src/
electionMap/Morrow.as�" error.
If I take out the electionMap out and just have package
it works fine. Any ideas what I'm doing wrong?
Here's the code:
package electionMap
{
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.Font;
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;
public class Morrow extends MovieClip
{
// this event listener had to be within its own function to work
// this is a constructor
public function Morrow()
{
addEventListener(MouseEvent.CLICK , myFunction); // calls the next function if morrow is clicked
}
private function myFunction(event:MouseEvent):void
{
trace("Morrow is clicked");
}
}
}