I simply want to popup an Alertbox in AS3. I am using Flashdevelop and I got the null reference error when I just run this simple code. I THINK that it has something to do with the stage, but I don’t know.
import mx.controls.Alert;
public class Main extends Sprite
{
public function Main()
{
Alert.show("hello World","title",Alert.YES | Alert.NO);
}
}
I would like to run this alert and depending what the Alert returns I would love to return a true or false. But I would be glad if we can start with the displaying of the alertdialog
The problem was, that I wrote all my text in the AS files. When I used an MXML file as view, the alert will pop up correctly.