AS3 has an 'in' operator. I think hasOwnProperty() is really only
necessary when dealing with prototype inheritance, which Flex doesn't
use (except in the style prototype chain).
 
Gordon Smith
Adobe Flex SDK Team

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of jovialrandor
Sent: Thursday, January 24, 2008 7:16 PM
To: [email protected]
Subject: [flexcoders] Re: How to check if value exists in a return API
call?



Thanks Tracy, the hasOwnProperty() method works perfectly.

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Tracy Spratt" <[EMAIL PROTECTED]> 
wrote:
>
> Is that not working?
> 
> 
> 
> Also, I advise storing your result in an instance variable. In the
> result handler, use event.result (not lastResult) to assign the 
resutl
> to the var. Cast/convert it to the correct dataType as desired.
> 
> 
> 
> Also look at hasOwnProperty()
> 
> 
> 
> Tracy
> 
> 
> 
> 
> 
> ________________________________
> 
> From: [email protected] <mailto:flexcoders%40yahoogroups.com>

[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of jovialrandor
> Sent: Thursday, September 06, 2007 6:16 PM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: How to check if value exists in a return 
API
> call?
> 
> 
> 
> Here is the current function that I'm using:
> 
> private function bttnclick(event:Event):void
> {
> if 
> 
(sanData.lastResult.ENTITLEMENT.USERS.USER.CAN_UPDATE_ASSET.ASSET_ID)
> {
> 
> Alert.show('You can 
> edit!', 'Message')
> }
> if 
> 
(sanData.lastResult.ENTITLEMENT.USERS.USER.CAN_NOT_UPDATE_ASSET.ASSET
_ID
> )
> {
> Alert.show('No 
> edit!', 'Message')
> }
> }
> 
> --- In [email protected]
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> , "jovialrandor" <jovialrandor@> 
> wrote:
> >
> > 
> > I have API call that returns me this:
> > 
> > 1. result>ENTITLEMENT>USERS>USER>CAN_NOT_UPDATE_ASSET=null
> > 
> > 2. 
result>ENTITLEMENT>USERS>USER>CAN_UPDATE_ASSET>ASSET_ID=application
> > 
> > 
> > 
> > I want to be able to display a message if 'CAN_UPDATE_ASSET" 
returns
> > null.
> > 
> > 
> > 
> > Thanks
> >
>



 

Reply via email to