Create a new fla file and name it Confirm.fla. Place the fla in the same folder as the biz folder. Add component button and ComboBox instances on the main timeline. Name one button "mySubmit". Then create an Actionscript file, name it Confirms.as and place this script. You should see an AlertBox instance popping up and the background blurred and the component instances inactivated. Test the movie again by giving the String a value.
package
{
import flash.display.Sprite;
import fl.controls.Button;
import fl.controls.ComboBox;
import flash.events.MouseEvent;
import biz.flashscript.components.alert.Confirm;
public class Confirms extends Sprite
{
private var myVar:String;//="confirmed";// a string from a textfield for example, here null.
public function Confirms ():void
{
mySubmit.addEventListener (MouseEvent.CLICK,confirmData);
}
private function confirmData (e:MouseEvent):void
{
var ca:Confirm = new Confirm(myVar,clip,"Enter data!");
}
}
}
|