hi,

if ( myDog instanceof Dog )
{
  trace("it's a dog");
}


if this doesn't help you diagnose the problem, a handy tool could be
as2lib's reflection api

www.as2lib.org
www.simonwacker.com

Best,
Aldo

On 8/2/05, Dave Kuncl <[EMAIL PROTECTED]> wrote:
>  
>  
> 
> The issue we are having has something to do with the casting… 
> 
>   
> 
> The code doesn't have a typo, there was a typo when transferring it to
> email….here is the code…. 
> 
>   
> 
> This doesn't work…. 
> 
>   
> 
>   
> 
> public function onResult(event:Object) : Void { 
> 
>   var infoArray : Array = event.result; 
> 
> . 
> 
> . 
> 
> . 
> 
> } 
> 
>   
> 
> public function saveUserInfo(userInfoArray : Array) : Void { 
> 
>   
> 
>   var call:Object = service.save(userInfoArray); 
> 
>   
> 
> } 
> 
>   
> 
> This does work…. 
> 
>   
> 
> public function saveUserInfo(userInfoArray : Array) : Void { 
> 
>   var infoArray : Array = new Array(); 
> 
>   
> 
>   for (var i in userInfoArray) { 
> 
>   var userInfo : UserInfoVO = new UserInfoVO(); 
> 
>                         
> 
>   userInfo.oid = userInfoArray[i].oid; 
> 
>   userInfo.name = userInfoArray[i].name; 
> 
>                           
> 
>   infoArray .addItem(userInfo); 
> 
>   
> 
>   var call:Object = service.save(infoArray); 
> 
>   
> 
> } 
> 
>   
> 
>   
> 
> How do we check to see if the received array has correctly casted objects?? 
> 
>   
>  
>  ________________________________
>  
> 
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of Aldo Bucchi
>  Sent: Tuesday, August 02, 2005 2:52 PM
>  To: [email protected]
>  Subject: Re: [flexcoders] Problem passing action script VOs using an array 
> 
>   
> 
> HI,
>  
>  first, there are some typos in your code
>  
>    infoArray .addItem(>>activity<<);
>  
>  var >>userIfno<< : UserInfoVO = new UserInfoVO();
>  
>  second, check that the received array has correctly casted objects
>  (UserInfoVO ), perhaps you don't have if correctly configured. Note
>  that the second time you are not relying on flex to do the correct
>  casting.
>  
>  
>  
>  On 8/2/05, Shahnavaz Alware <[EMAIL PROTECTED]> wrote:
>  >  
>  >  
>  > 
>  > I am having a problem passing action script VOs to the backend using an
>  > Array.  Can someone tell me what I am missing here... 
>  > 
>  >   
>  > 
>  > Here is an example of what I am trying to do: 
>  > 
>  >   
>  > 
>  > First I get an array of VOs from the backend.... 
>  > 
>  >   
>  > 
>  > public function onResult(event:Object) : Void { 
>  > 
>  >   var infoArray : Array = event.result; 
>  > 
>  > . 
>  > 
>  > . 
>  > 
>  > . 
>  > 
>  > } 
>  > 
>  >   
>  > 
>  > Then later I call the backend and pass back the array of VOs and this
>  > DOESN'T work because I get a class cast exception... 
>  > 
>  >   
>  > 
>  > public function saveUserInfo(userInfoArray : Array) : Void { 
>  > 
>  >   
>  > 
>  >   var call:Object = service.save(userInfoArray); 
>  > 
>  >   
>  > 
>  > } 
>  > 
>  >   
>  > 
>  > However, if I do the same thing, but create an array of new VOs and
> transfer
>  > all the values, this DOES work.... 
>  > 
>  >   
>  > 
>  > public function saveUserInfo(userInfoArray : Array) : Void { 
>  > 
>  >   var infoArray : Array = new Array(); 
>  > 
>  >   
>  > 
>  >   for (var i in userInfoArray) { 
>  > 
>  >   var userIfno : UserInfoVO = new UserInfoVO(); 
>  > 
>  >                         
>  > 
>  >   userIfno.oid = userInfoArray[i].oid; 
>  > 
>  >   userIfno.name = userInfoArray[i].activityId; 
>  > 
>  >                           
>  > 
>  >   infoArray .addItem(activity); 
>  > 
>  >   
>  > 
>  >   var call:Object = service.save(infoArray); 
>  > 
>  >   
>  > 
>  > } 
>  > 
>  >   
>  > 
>  >   
>  > 
>  > I don't understand exactly what the problem is here, can anyone give
> insight
>  > to this issue? 
>  > 
>  >   
>  > 
>  >   
>  > 
>  > Thanks, 
>  > 
>  >   
>  > 
>  > Dave 
>  > 
>  >  --
>  >  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 
>  >  Computer software testing Macromedia flex Development 
>  >  Software developer 
>  >  
>  >  ________________________________
>  >  YAHOO! GROUPS LINKS 
>  >  
>  >  
>  >  Visit your group "flexcoders" on the web.
>  >   
>  >  To unsubscribe from this group, send an email to:
>  >  [EMAIL PROTECTED]
>  >   
>  >  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
>  >  
>  >  ________________________________
>  >  
>  
>  
>  -- 
>  ::::: Aldo Bucchi :::::
>  mobile (56) 8 429 8300
>  
>  
> 
>  --
>  Flexcoders Mailing List
>  FAQ:
> http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
>  Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com 
> 
>  
>  
>  ________________________________
>  YAHOO! GROUPS LINKS 
>  
>  
>  Visit your group "flexcoders" on the web.
>   
>  To unsubscribe from this group, send an email to:
>  [EMAIL PROTECTED]
>   
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
>  
>  ________________________________
>  
> 
> 


-- 
::::: Aldo Bucchi :::::
mobile (56) 8 429 8300


------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hol9sq7/M=362329.6886308.7839368.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1123042142/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~-> 

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to