Escolar Documentos
Profissional Documentos
Cultura Documentos
>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:dbgeralusersservice="services.dbgeralusersservice.*"
minWidth="955" minHeight="600"
currentState="Login" pageTitle="Veritas - Sistema de Controle e
Planejamento">
<fx:Script>
<![CDATA[
import flash.net.NetConnection;
import flash.net.ObjectEncoding;
import flash.net.Responder;
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.events.ResultEvent;
//
[Bindable]
public var PHPDados: Array;
public var gateway: NetConnection;
public function buscaDadosMYSQL():void {
gateway = new NetConnection;
gateway.objectEncoding = ObjectEncoding.AMF0;
gateway.connect("http://localhost/Veritas/amfphp/Amfphp/index.php");
gateway.call("conexao.getLista", new Responder(onOK,
onFalha));
}
//
public function onOK(resultado:Array):void {
PHPDados = resultado;
}
//
public function onFalha(falha:String):void {
trace(falha);
}
protected function gravarDados(event:Object):void
{
Alert.show(event.result);
}
public function getLista(event:ResultEvent):void {
PHPDados = event.result.valueOf();
}
protected function Entrar(event:MouseEvent):void
{
currentState="Main";
}
]]>
</fx:Script>
<s:states>
<s:State name="Login"/>
<s:State name="Main"/>
</s:states>
<fx:Declarations>
<mx:RemoteObject
id="RemoteVeritas"
endpoint="http://localhost/Veritas/amfphp/Amfphp/index.php"
destination="amfphp"
source="conexao"
showBusyCursor="true"
>
<mx:method
name = "getLista"
result = "getLista(event)"/>
<mx:method
name = "gravarDados"
result = "gravarDados(event)"/>
<mx:method
name = "Retorno"
result = "gravarDados(event)"/>
</mx:RemoteObject>
</fx:Declarations>
<s:Rect id="background" left="0" right="0" top="0" bottom="0" alpha=".7">
<s:fill>
<s:BitmapFill source="@Embed(source='../Background.jpg')"/>
</s:fill>
</s:Rect>
<s:Panel includeIn="Login" width="300" height="200" cornerRadius="20"
horizontalCenter="0"
title="Veritas - Acesso ao sistema" verticalCenter="0"
click.Login="Entrar(event)">
<s:Label x="45" y="39" width="60" height="19" fontWeight="bold"
text="Usurio"
verticalAlign="middle"/>
<s:Label x="45" y="67" width="60" height="19" fontWeight="bold"
text="Senha"
verticalAlign="middle"/>