I am working on a simple app that shows how to add
data/display
data/and edit data in a flex/cf enviroment. But when I run my app, I
keep getting this error. I have search everywhere for this error, and
all I come up with is a very vague discription. The error does not
keep my app from working, it is just annoying at most. Can someone
explain to me why it does this, and maybe shed a little light on the
error it's self.
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at custom::userSearch/::showUserDetail()
at custom::userSearch/::alertClickHandler()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.controls.alertClasses::AlertForm/::removeAlert()
at mx.controls.alertClasses::AlertForm/::clickHandler()
Here is the code it is complaining about
showUserDetail();
// CALL USER ADD COMPONENT
private function showUserDetail(){
var popUp:userDetail = userDetail(
PopUpManager.createPopUp(this, userDetail, true))
if (userDG.selectedItem != ''){
popUp.uuid.text = userDG.selectedItem.FLD_USERID;
popUp.login.text = userDG.selectedItem.FLD_USERLOGIN;
popUp.pass.text = userDG.selectedItem.FLD_USERPASS;
popUp.firstName.text =
userDG.selectedItem.FLD_USERFIRSTNAME;
popUp.lastName.text =
userDG.selectedItem.FLD_USERLASTNAME;
popUp.email.text = userDG.selectedItem.FLD_USEREMAIL;
popUp.url.text = userDG.selectedItem.FLD_USERURL;
popUp.sex.selectedIndex = userDG.selectedItem.FLD_USERSEX;
}
else{
return;
}
}
alertClickHandler();
// EVENT HANDLER FOR ALERT SELECTED OPTION
private function alertClickHandler(event:CloseEvent):void {
if (event.detail==Alert.YES)
showUserDetail()
else
return;
}