Jeremy,

 

Add a return type of :void to your method, this can refine things a bit.

private function showUserDetail():void

{

….

}

 

(Although this isn’t the error!)

 

Change this if statement:

if (userDG.selectedItem != ''){

// this if statement allows null and undefined to be true!!!

 

Use:

if ( userDG.selectedItem ){

}

 

My hunch is that selectedItem is null and you are attempting get operations on it.

 

Ahhhh… FlexCoders as a distributed debugger!

 

Ted Patrick

Flex Evangelist

Adobe Systems Incorporated

 

 


From: [email protected] [mailto:[email protected]] On Behalf Of Jeremy Rottman
Sent: Monday, August 28, 2006 10:54 AM
To: [email protected]
Subject: [flexcoders] Flash player error.. I cant figure it out.

 

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;
}

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to