Android Native Extension Text Input Dialog for Adobe Air

Andorid Text Input Dialog Native Extension for Adobe Air

New in asNativeAlert .

So once again to make the package compatible with every platform I’m working on I’v packed to the same ANE file additional classes.
I think one of the main feature of a basic Dialog Box on every platform is to show some kind of input for people to interact with it.
So NativeTextInputDialog add this functionality to the whole package.

Usage:

public function openTextInputDialog(event:MouseEvent):void{
	if(NativeTextInputDialog.isSupported()){
		textInputDialog = new NativeTextInputDialog();
		textInputDialog.theme = NativeTextInputDialog.THEME_HOLO_LIGHT;
		textInputDialog.addEventListener(NativeDialogEvent.CANCLED,trace);
		textInputDialog.addEventListener(NativeDialogEvent.OPENED,trace);
		textInputDialog.addEventListener(NativeExtensionErrorEvent.ERROR,trace);
		textInputDialog.addEventListener(NativeTextInputDialogEvent.CLOSED, onTextInputDialogClosedHandler);
		var buttons:Vector.<String> = new Vector.<String>();
		buttons.push("OK","Cancle");
		var v:Vector.<NativeTextInput> = new Vector.<NativeTextInput>();
		var ti1:NativeTextInput = new NativeTextInput("name");
		ti1.inputType = NativeTextInput.text;
		ti1.messageBefore ="name:";
		ti1.text = "jacek";
		v.push(ti1);
		var ti2:NativeTextInput = new NativeTextInput("password");
		ti2.inputType = NativeTextInput.textPassword;
		ti2.messageBefore ="password:";
		ti2.text = "dddd";
		v.push(ti2);
		textInputDialog.show(titleInput.text,v,buttons);
	}
}
private function onTextInputDialogClosedHandler(event:NativeTextInputDialogEvent):void
{
	for each (var n:NativeTextInput in event.list) 
	{
		trace(n.name+":  "+n.text);
	}
	trace(event.buttonIndex);
}
Advertisements
Tagged , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: