Hii

am writing a simple application where for logging in, am checking the values
against the value objects contained in an ArrayCollection.

While 

if((evt.userVO.email == ModelLocator.ALL_USERS[i].email) && (evt.userVO.pwd
== ModelLocator.ALL_USERS[i].pwd))

returns true, then why it throws this Type coercion error at this following
line:

model.currentUser = ModelLocator.ALL_USERS[i];
//UserVO(ModelLocator.ALL_USERS[i]);

currentUser is type UserVO and ALL_USERS is a collection of UserVO objects.

I had tried by explicitely casting the above line(as commented), but still
the same.

Here is the error, I received while debugging:

Explicit casting:-

TypeError: Error #1034: Type Coercion failed: cannot convert [EMAIL PROTECTED]
to com.live.flats.vo.UserVO.
        at
com.live.flats.commands::LoginInfoCommand/execute()[F:\xampp\htdocs\flats\flex_src\com\live\flats\commands\LoginInfoCommand.as:60]
        at
com.adobe.cairngorm.control::FrontController/executeCommand()[C:\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\control\FrontController.as:215]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at
com.adobe.cairngorm.control::CairngormEventDispatcher/dispatchEvent()[C:\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\control\CairngormEventDispatcher.as:113]
        at
com.adobe.cairngorm.control::CairngormEvent/dispatch()[C:\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\control\CairngormEvent.as:77]
        at
com.live.flats.view::LoginPanelBar/loginUser()[F:\xampp\htdocs\flats\flex_src\com\live\flats\view\LoginPanelBar.mxml:29]
        at
com.live.flats.view::LoginPanelBar/__loginButton_click()[F:\xampp\htdocs\flats\flex_src\com\live\flats\view\LoginPanelBar.mxml:74]


Implicit Casting:-

TypeError: Error #1034: Type Coercion failed: cannot convert [EMAIL PROTECTED]
to com.live.flats.vo.UserVO.
        at
com.live.flats.commands::LoginInfoCommand/execute()[F:\xampp\htdocs\flats\flex_src\com\live\flats\commands\LoginInfoCommand.as:60]
        at
com.adobe.cairngorm.control::FrontController/executeCommand()[C:\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\control\FrontController.as:215]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at
com.adobe.cairngorm.control::CairngormEventDispatcher/dispatchEvent()[C:\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\control\CairngormEventDispatcher.as:113]
        at
com.adobe.cairngorm.control::CairngormEvent/dispatch()[C:\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\control\CairngormEvent.as:77]
        at
com.live.flats.view::LoginPanelBar/loginUser()[F:\xampp\htdocs\flats\flex_src\com\live\flats\view\LoginPanelBar.mxml:29]
        at
com.live.flats.view::LoginPanelBar/__loginButton_click()[F:\xampp\htdocs\flats\flex_src\com\live\flats\view\LoginPanelBar.mxml:74]


Any help would be great.
Thanks.


-- 
View this message in context: 
http://www.nabble.com/Casting-Problem..-Type-Coercion-Failed-tp17585702p17585702.html
Sent from the FlexCoders mailing list archive at Nabble.com.

Reply via email to