import org.pyamf.examples.ohloh.ApiExample; public var account: ApiExample; public function submit():void { submit_btn.enabled = false; account = new ApiExample( email.text ); account.addEventListener( ApiExample.RESPONSE, showResponse ); account.addEventListener( ApiExample.ERROR, showError ); account.connect('http://localhost:8000'); } private function showResponse( evt:Event ):void { submit_btn.enabled = true; results.visible = true; username.text = account.info.name; avatar.source = account.info.avatar_url; location.text = account.info.location; website.htmlText = "<a href='" + account.info.homepage_url + "'><font color='#1874CD'>" + account.info.homepage_url + "</font></a>"; } private function showError( evt:Event ):void { submit_btn.enabled = true; results.visible = false; }