topical media & game development
actionscript-misc-LoginManager.ax
actionscript-misc-LoginManager.ax
[swf]
flex
package {
import flash.display.*;
import flash.text.*;
import flash.events.*;
public class @ax-actionscript-misc-LoginManager {
private var username:TextField;
private var password:TextField;
public function @ax-actionscript-misc-LoginManager (username:TextField,
password:TextField,
submitBtn:SimpleButton) {
this.username = username;
this.password = password;
submitBtn.addEventListener(MouseEvent.CLICK, submitListener);
}
private function submitListener (e:MouseEvent):void {
submit(username.text, password.text);
}
public function submit (name:String, pass:String):void {
trace("Now submitting user: " + name + " with password: " + pass);
// Now transmit login information to server (code not shown).
// Typically, the flash.net.URLLoader class is used to send
// data to a server.
}
}
}
(C) Æliens
27/08/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.