PDA

View Full Version : Newbe Question..


bydamien
04-29-2007, 11:23 AM
Hi all

before sorry for bad english :(

im using flex2 with asp, but i have some problem to httpservice

This is httpServiceCode


<mx:HTTPService id="loginCheck" url="http://localhost/sql/logincheck.asp" useProxy="false" method="POST" showBusyCursor="true">
<mx:request xmlns="">
<username>{VID.text}</username>
</mx:request>
</mx:HTTPService>


functions


<mx:Script>
<![CDATA[
import mx.controls.Alert;
private var sVID:String;

private function Check() :void
{
var sDurum:String;
if (VID.text == "")
{
Alert.show("olmazz");
}
loginCheck.send();
sDurum = loginCheck.lastResult.fControl.fUser;
if (sDurum == pass.text)
{
MainView.selectedChild = pilotView;
userRequest.send();
awardRequest.send();
}
else
{
Alert.show("Your Ivao ID or Password is Not Correct Try Again !");
VID.text = "";
pass.text = "";
}
}

}
]]>
</mx:Script>


form information

<mx:Form x="153" y="15">
<mx:FormItem label="Ivao ID">
<mx:TextInput id="VID"/>
</mx:FormItem>
<mx:FormItem label="VA Password">
<mx:TextInput id="pass"/>
</mx:FormItem>
</mx:Form>


button click
<mx:Button label="Login" x="252" y="99" click="Check()"/>

and error?

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at vLogin/::Check()
at vLogin/___Button1_click()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at mx.controls::Button/mx.controls:Button::keyUpHandler()


im finding solution 3 day :((

thank you for all helps
bydamien.

batmitra
05-04-2007, 02:50 PM
Hi
I don't know how are you getting data from you server, but one thing i see in your code is that you are trying to assign a null value to your string variable i mean you are not binding, so here it is what i see:


where you have
sDurum = loginCheck.lastResult.fControl.fUser;

you should have

sDurum = {loginCheck.lastResult.fControl.fUser};//Bindable expression