ryeguy
10-05-2008, 10:43 PM
This is such a simple topic, and even using the example in the Flex help file, I still can't seem to get it to work.
I have this class in test.as:
package mypackage
{
public class Alert
{
public static function RecordEvent(event:String):void
{
mx.controls.Alert.show(event);
}
}
}
In my MXML file I have this:
<mx:Script>
<![CDATA[
import mypackage.Alert;
]]>
</mx:Script>
However, on the line of the import, I get this error:
1172: Definition mypackage:Alert could not be found.
What's the problem here? It's so simple and straightforward that it's killing me. The weird thing is is when I type "import" in the Flex IDE it pops up mypackage as a choice in the auto completion, so obviously it knows it exists.
I have this class in test.as:
package mypackage
{
public class Alert
{
public static function RecordEvent(event:String):void
{
mx.controls.Alert.show(event);
}
}
}
In my MXML file I have this:
<mx:Script>
<![CDATA[
import mypackage.Alert;
]]>
</mx:Script>
However, on the line of the import, I get this error:
1172: Definition mypackage:Alert could not be found.
What's the problem here? It's so simple and straightforward that it's killing me. The weird thing is is when I type "import" in the Flex IDE it pops up mypackage as a choice in the auto completion, so obviously it knows it exists.