OK so I am still having a little problem implementing the code so I'll
post all relevate code.

Hello,

I am having a little issue with a script that is supposed to stop a
request to my server when I enter information into a form but the
information takes more than 5 seconds to be processed by the server.

Code:
<mx:Script>

        <![CDATA[

import mx.controls.Alert;

import mx.controls.Text;

private function initApp():void{

        this.Submit.addEventListener(MouseEvent.CLICK,onFormClick);

}

private function onFormClick(event:MouseEvent):void{

        var timer:Timer = new Timer(1000,5);

        timer.addEventListener(TimerEvent.TIMER_COMPLETE,onTimerComplete1);

        timer.start();

}

private function onTimerComplete1(event:TimerEvent):void{

        Alert.show('Invalid Request);   
        clearFormHandler();
        

}

        ]]>

</mx:Script>

Here is the data Service

<mx:HTTPService id="login_user" result="checkLogin(event)" 
        showBusyCursor="true" method="GET" 
        url="https://{customer.text}.mysite.net/interface.php";  
        useProxy="false"
        fault="userFaultHandler(event)">
        <mx:request xmlns="">
        <customer>
                {customer.text}
        </customer>
        <username>
                {username.text}
        </username>
        <password>
                {password.text}
        </password>
        </mx:request>
        </mx:HTTPService>

and the form

        <mx:Panel resizeEffect="Resize" width="582" height="354"
layout="absolute" title="Board Login" horizontalCenter="0"
verticalCenter="-2" id="panel1" color="#FF0000"
backgroundColor="#191919" cornerRadius="15" themeColor="#FFA800"
borderColor="#9FA7B7">
        <mx:Label x="10" y="14" text="Customer Number" id="customerlbl"
fontSize="20" width="542" textAlign="center"/>
        <mx:TextInput x="10" y="61" id="customer" width="542"
borderColor="#F90404" 
        backgroundColor="#D5D1D1" themeColor="#FFA800" color="#050505"
change="validateForm(event);"/>
        <mx:Label x="10" y="91" text="Username" id="label1" fontSize="20"
width="542" textAlign="center"/>
        <mx:TextInput x="10" y="138" id="username" width="542"
borderColor="#F90404" backgroundColor="#D5D1D1" 
        themeColor="#FFA800" color="#050505" change="validateForm(event);"/>
        <mx:Label x="10" y="175" text="Password" id="label2" fontSize="20"
width="542" textAlign="center"/>
        <mx:TextInput x="11" y="217" id="password" displayAsPassword="true"
width="542" borderColor="#F90404" 
        backgroundColor="#D5D1D1" themeColor="#FFA800" color="#050505"
change="validateForm(event);"/>
        <mx:Button x="10" y="282" label="Login" id="Submit"
click="login_user.send();" 
        fontSize="14" themeColor="#FFA800" borderColor="#FA0202"
enabled="{formIsValid}" />
        <mx:Button x="85" y="282" label="Reset" id="Reset"
enabled="{!formIsEmpty}"
    click="clearFormHandler();" fontSize="14" themeColor="#FFA800"
borderColor="#FA0202"/>
        </mx:Panel>

There are several different functions that are going on with this
form. All other functions are working but the timer is not timing out
and resetting the form as I expect it to. Any Ideas.




Reply via email to