[flexcoders] Re: TypeError: Error #1034: Type Coercion failed: cannot convert ...
I have 2 namespaces: mx:HBox xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:wsm=com.websim.components.* ... LG --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Any namespaces defined in the XML? From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of weezee49 Sent: Wednesday, August 20, 2008 5:16 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] TypeError: Error #1034: Type Coercion failed: cannot convert ... I'm getting the dreaded Type Coercion error on this line: resourcesAC = event.result.resources.resource; resourcesAC is declared as follows: [Bindable] private var resourcesAC : ArrayCollection = new ArrayCollection(); My result handler for my HTTPService is: private function handleRscListResult(event:ResultEvent):void{ resourcesAC = event.result.resources.resource; var rscObj:Object = new Object(); rscObj.name = --New Resource--; rscObj.resourceID = 0; resourcesAC.addItemAt(rscObj, 0); rscBox.rscListCB.selectedIndex=0; } Turns out that event.result.resources.resource is empty, which is why I'm getting the error. However, I can't figure out why this is empty. Here's my event.result: resources type=array resource capacity type=integer1/capacity created_at type=datetime nil=true/ descThe grocery store server/desc id type=integer2/id nameRclerk/name simulation_id type=integer4/simulation_id time_unitssec/time_units updated_at type=datetime nil=true/ /resource /resources When I check the length of event.result.resources.resource using trace(event.result.resources.resource.length()), I get 0. Why is this? Seems to me it should be 1 - there's one resource object in there! The only other guess I have is that somehow resources and resource are magic words. I was checking my routes.rb file today and noticed the following route: map.resources :resources which struck me as looking peculiar today. Has anyone run across this before? Thanks, LG
[flexcoders] Re: TypeError: Error #1034: Type Coercion failed: cannot convert ...
--- In flexcoders@yahoogroups.com, weezee49 [EMAIL PROTECTED] wrote: I'm getting the dreaded Type Coercion error on this line: resourcesAC = event.result.resources.resource; resourcesAC is declared as follows: [Bindable] private var resourcesAC : ArrayCollection = new ArrayCollection(); My result handler for my HTTPService is: private function handleRscListResult(event:ResultEvent):void{ resourcesAC = event.result.resources.resource; var rscObj:Object = new Object(); rscObj.name = --New Resource--; rscObj.resourceID = 0; resourcesAC.addItemAt(rscObj, 0); rscBox.rscListCB.selectedIndex=0; } event.result.resources won't contain anything, because event.result already _is_ the resources node, assuming it is formatted as XML. You could try resoucesAC = event.result.resource, but I'm not sure if it's possible to go directly from XML to ArrayCollection like that anyway. HTH; Amy
RE: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed: cannot convert ...
In the XML, not the MXML. Your snippet just started with resources Usually, there's more before that. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of weezee49 Sent: Thursday, August 21, 2008 5:56 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed: cannot convert ... I have 2 namespaces: mx:HBox xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml xmlns:wsm=com.websim.components.* ... LG --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui [EMAIL PROTECTED] wrote: Any namespaces defined in the XML? From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of weezee49 Sent: Wednesday, August 20, 2008 5:16 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] TypeError: Error #1034: Type Coercion failed: cannot convert ... I'm getting the dreaded Type Coercion error on this line: resourcesAC = event.result.resources.resource; resourcesAC is declared as follows: [Bindable] private var resourcesAC : ArrayCollection = new ArrayCollection(); My result handler for my HTTPService is: private function handleRscListResult(event:ResultEvent):void{ resourcesAC = event.result.resources.resource; var rscObj:Object = new Object(); rscObj.name = --New Resource--; rscObj.resourceID = 0; resourcesAC.addItemAt(rscObj, 0); rscBox.rscListCB.selectedIndex=0; } Turns out that event.result.resources.resource is empty, which is why I'm getting the error. However, I can't figure out why this is empty. Here's my event.result: resources type=array resource capacity type=integer1/capacity created_at type=datetime nil=true/ descThe grocery store server/desc id type=integer2/id nameRclerk/name simulation_id type=integer4/simulation_id time_unitssec/time_units updated_at type=datetime nil=true/ /resource /resources When I check the length of event.result.resources.resource using trace(event.result.resources.resource.length()), I get 0. Why is this? Seems to me it should be 1 - there's one resource object in there! The only other guess I have is that somehow resources and resource are magic words. I was checking my routes.rb file today and noticed the following route: map.resources :resources which struck me as looking peculiar today. Has anyone run across this before? Thanks, LG
[flexcoders] Re: TypeError: Error #1034: Type Coercion failed: cannot convert ...
The XML returned by http://localhost:3000/simulations/4/resources.xml is: ?xml version=1.0 encoding=UTF-8 ? - resources type=array - resource capacity type=integer1/capacity created_at type=datetime2008-08-21T17:22:46Z/created_at descThe grocery store server/desc id type=integer2/id nameRclerk/name simulation_id type=integer4/simulation_id time_unitssec/time_units updated_at type=datetime2008-08-21T17:22:46Z/updated_at /resource /resources This is the same data returned by event.result in the event handler. LG --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: In the XML, not the MXML. Your snippet just started with resources Usually, there's more before that. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of weezee49 Sent: Thursday, August 21, 2008 5:56 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed: cannot convert ... I have 2 namespaces: mx:HBox xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml xmlns:wsm=com.websim.components.* ... LG --- In flexcoders@yahoogroups.com mailto:flexcoders% 40yahoogroups.com , Alex Harui aharui@ wrote: Any namespaces defined in the XML? From: flexcoders@yahoogroups.com mailto:flexcoders% 40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders% 40yahoogroups.com ] On Behalf Of weezee49 Sent: Wednesday, August 20, 2008 5:16 PM To: flexcoders@yahoogroups.com mailto:flexcoders% 40yahoogroups.com Subject: [flexcoders] TypeError: Error #1034: Type Coercion failed: cannot convert ... I'm getting the dreaded Type Coercion error on this line: resourcesAC = event.result.resources.resource; resourcesAC is declared as follows: [Bindable] private var resourcesAC : ArrayCollection = new ArrayCollection (); My result handler for my HTTPService is: private function handleRscListResult(event:ResultEvent):void{ resourcesAC = event.result.resources.resource; var rscObj:Object = new Object(); rscObj.name = --New Resource--; rscObj.resourceID = 0; resourcesAC.addItemAt(rscObj, 0); rscBox.rscListCB.selectedIndex=0; } Turns out that event.result.resources.resource is empty, which is why I'm getting the error. However, I can't figure out why this is empty. Here's my event.result: resources type=array resource capacity type=integer1/capacity created_at type=datetime nil=true/ descThe grocery store server/desc id type=integer2/id nameRclerk/name simulation_id type=integer4/simulation_id time_unitssec/time_units updated_at type=datetime nil=true/ /resource /resources When I check the length of event.result.resources.resource using trace(event.result.resources.resource.length()), I get 0. Why is this? Seems to me it should be 1 - there's one resource object in there! The only other guess I have is that somehow resources and resource are magic words. I was checking my routes.rb file today and noticed the following route: map.resources :resources which struck me as looking peculiar today. Has anyone run across this before? Thanks, LG
[flexcoders] Re: TypeError: Error #1034: Type Coercion failed: cannot convert ...
Okay, I finally found a solution that works. I declare [Bindable] private var _rscAndNewXLC: XMLListCollection; Then my event handler looks like this: private function handleRscListResult(event:ResultEvent):void{ var resultXML : XML = XML(event.result); _rscAndNewXLC = getRscAndNew(resultXML.children()); rscBox.rscListCB.dataProvider = _rscAndNewXLC; rscBox.rscListCB.selectedIndex=0; } and my function getRscAndNew: private function getRscAndNew(rscXL: XMLList):XMLListCollection{ var retval:XMLListCollection = new XMLListCollection(rscXL.copy()); retval.addItemAt(NEW_RSC_XML, 0); return retval; } This is populating the ComboBox correctly with --New Resource as the default selected item, and the single resource returned from the HTTPService call as the 2nd item in the box. After reading http://blogs.adobe.com/aharui/2007/03/arraycollection_arrays_and_ser. html, I decided that the ArrayCollection data structure is the wrong choice here. I hope this is helpful to others. LG
[flexcoders] Re: TypeError: Error #1034: Type Coercion failed :
Conclusion: If you have Error #1034: Type Coercion failed error and you don't know why, try to load this class in the main application first. To test, you can put the class directly in your main application. If now it's working, that was your problem. Solution, use RSL and/or link-report to load duplicated class in your main application first. Thank you Alex Harui and Robert Cadena for you help. David www.ideeclic.com --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: I use link-report to be sure that there is no duplication of classes. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nxzone Sent: Wednesday, March 28, 2007 11:22 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : My question was more why should I use link-report? If i have a RSL library, each module or application that link this RSL will not export class that are inside this RSL. So what is the difference? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: RSLs contain code to load (so do modules). link-report is a list of classes that don't need to be in a module because you guarantee they'll be found elsewhere. THis makes your modules smaller so they load faster. Usually you need both when using modules and RSLs From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of nxzone Sent: Wednesday, March 28, 2007 10:35 AM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : You are right. Now i use a generic library (myLib.swc) as RSL. The RSL is loaded first and my problem is solve... I can use RSL or link-report to load repetitive class, but what is the advantage to use link-report? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: Because it is a common problem. Try putting a ToggleButtonBar in the main app first to prove it one way or another. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of nxzone Sent: Tuesday, March 27, 2007 2:36 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : Why you think this bug is due to this cause? Why loading the shared content before should solve the Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar ? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: Check out the shared code portion of my modules presentation at blogs.adobe.com/aharui From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of nxzone Sent: Monday, March 26, 2007 2:27 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : Same problem ... Line 158 of ButtonBarButtonSkin.as... (parent.parent is a ToggleButtonBar not a buttonbar) var bar:ButtonBar = parent ? ButtonBar(parent.parent) : null; --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , lrhazi lrhazi@ wrote: I get this annoying error often: TypeError: Error #1034: Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar My app uses Modules and has a user login/logout functionality... I get the above error systematically when i logout of an account and login to a second one. Any hints on what to look for? Thank you very much. Mohamed~
[flexcoders] Re: TypeError: Error #1034: Type Coercion failed :
You are right. Now i use a generic library (myLib.swc) as RSL. The RSL is loaded first and my problem is solve... I can use RSL or link-report to load repetitive class, but what is the advantage to use link-report? --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Because it is a common problem. Try putting a ToggleButtonBar in the main app first to prove it one way or another. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nxzone Sent: Tuesday, March 27, 2007 2:36 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : Why you think this bug is due to this cause? Why loading the shared content before should solve the Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar ? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: Check out the shared code portion of my modules presentation at blogs.adobe.com/aharui From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of nxzone Sent: Monday, March 26, 2007 2:27 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : Same problem ... Line 158 of ButtonBarButtonSkin.as... (parent.parent is a ToggleButtonBar not a buttonbar) var bar:ButtonBar = parent ? ButtonBar(parent.parent) : null; --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , lrhazi lrhazi@ wrote: I get this annoying error often: TypeError: Error #1034: Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar My app uses Modules and has a user login/logout functionality... I get the above error systematically when i logout of an account and login to a second one. Any hints on what to look for? Thank you very much. Mohamed~
[flexcoders] Re: TypeError: Error #1034: Type Coercion failed :
My question was more why should I use link-report? If i have a RSL library, each module or application that link this RSL will not export class that are inside this RSL. So what is the difference? --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: RSLs contain code to load (so do modules). link-report is a list of classes that don't need to be in a module because you guarantee they'll be found elsewhere. THis makes your modules smaller so they load faster. Usually you need both when using modules and RSLs From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nxzone Sent: Wednesday, March 28, 2007 10:35 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : You are right. Now i use a generic library (myLib.swc) as RSL. The RSL is loaded first and my problem is solve... I can use RSL or link-report to load repetitive class, but what is the advantage to use link-report? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: Because it is a common problem. Try putting a ToggleButtonBar in the main app first to prove it one way or another. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of nxzone Sent: Tuesday, March 27, 2007 2:36 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : Why you think this bug is due to this cause? Why loading the shared content before should solve the Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar ? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: Check out the shared code portion of my modules presentation at blogs.adobe.com/aharui From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of nxzone Sent: Monday, March 26, 2007 2:27 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : Same problem ... Line 158 of ButtonBarButtonSkin.as... (parent.parent is a ToggleButtonBar not a buttonbar) var bar:ButtonBar = parent ? ButtonBar(parent.parent) : null; --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , lrhazi lrhazi@ wrote: I get this annoying error often: TypeError: Error #1034: Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar My app uses Modules and has a user login/logout functionality... I get the above error systematically when i logout of an account and login to a second one. Any hints on what to look for? Thank you very much. Mohamed~
RE: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed :
RSLs contain code to load (so do modules). link-report is a list of classes that don't need to be in a module because you guarantee they'll be found elsewhere. THis makes your modules smaller so they load faster. Usually you need both when using modules and RSLs From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nxzone Sent: Wednesday, March 28, 2007 10:35 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : You are right. Now i use a generic library (myLib.swc) as RSL. The RSL is loaded first and my problem is solve... I can use RSL or link-report to load repetitive class, but what is the advantage to use link-report? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui [EMAIL PROTECTED] wrote: Because it is a common problem. Try putting a ToggleButtonBar in the main app first to prove it one way or another. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of nxzone Sent: Tuesday, March 27, 2007 2:36 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : Why you think this bug is due to this cause? Why loading the shared content before should solve the Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar ? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: Check out the shared code portion of my modules presentation at blogs.adobe.com/aharui From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of nxzone Sent: Monday, March 26, 2007 2:27 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : Same problem ... Line 158 of ButtonBarButtonSkin.as... (parent.parent is a ToggleButtonBar not a buttonbar) var bar:ButtonBar = parent ? ButtonBar(parent.parent) : null; --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , lrhazi lrhazi@ wrote: I get this annoying error often: TypeError: Error #1034: Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar My app uses Modules and has a user login/logout functionality... I get the above error systematically when i logout of an account and login to a second one. Any hints on what to look for? Thank you very much. Mohamed~
RE: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed :
I use link-report to be sure that there is no duplication of classes. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nxzone Sent: Wednesday, March 28, 2007 11:22 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : My question was more why should I use link-report? If i have a RSL library, each module or application that link this RSL will not export class that are inside this RSL. So what is the difference? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui [EMAIL PROTECTED] wrote: RSLs contain code to load (so do modules). link-report is a list of classes that don't need to be in a module because you guarantee they'll be found elsewhere. THis makes your modules smaller so they load faster. Usually you need both when using modules and RSLs From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of nxzone Sent: Wednesday, March 28, 2007 10:35 AM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : You are right. Now i use a generic library (myLib.swc) as RSL. The RSL is loaded first and my problem is solve... I can use RSL or link-report to load repetitive class, but what is the advantage to use link-report? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: Because it is a common problem. Try putting a ToggleButtonBar in the main app first to prove it one way or another. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of nxzone Sent: Tuesday, March 27, 2007 2:36 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : Why you think this bug is due to this cause? Why loading the shared content before should solve the Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar ? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: Check out the shared code portion of my modules presentation at blogs.adobe.com/aharui From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of nxzone Sent: Monday, March 26, 2007 2:27 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : Same problem ... Line 158 of ButtonBarButtonSkin.as... (parent.parent is a ToggleButtonBar not a buttonbar) var bar:ButtonBar = parent ? ButtonBar(parent.parent) : null; --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , lrhazi lrhazi@ wrote: I get this annoying error often: TypeError: Error #1034: Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar My app uses Modules and has a user login/logout functionality... I get the above error systematically when i logout of an account and login to a second one. Any hints on what to look for? Thank you very much. Mohamed~
[flexcoders] Re: TypeError: Error #1034: Type Coercion failed :
Why you think this bug is due to this cause? Why loading the shared content before should solve the Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar ? --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Check out the shared code portion of my modules presentation at blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nxzone Sent: Monday, March 26, 2007 2:27 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : Same problem ... Line 158 of ButtonBarButtonSkin.as... (parent.parent is a ToggleButtonBar not a buttonbar) var bar:ButtonBar = parent ? ButtonBar(parent.parent) : null; --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , lrhazi lrhazi@ wrote: I get this annoying error often: TypeError: Error #1034: Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar My app uses Modules and has a user login/logout functionality... I get the above error systematically when i logout of an account and login to a second one. Any hints on what to look for? Thank you very much. Mohamed~
Re: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed :
howdy, i'm not sure what classes are defined in your modules or if you're using load-externs and external-library-path when compiling your module projects. but what i have found is that if a module has a class linked in that is the exact same class (and comes from the same swc, say framework.swc) as another module, and you try to cast an object obtained from that module into the exact same class of another module then you will get a type coercion error. so, my guess is that loading the shared content first loads the component into the correct applicationDomain. to avoid guessing when to load what, use load-externs or external-library-path to so you can link in a component into a module when you know that the component is also linked from the code that loaded the module. Specially if the modules have to share objects between each other. alex harui's presentation of the class loading mechanism at 360flex was very helpful. /r http://www.searchcoders.com/flex/?applicationDomain+coercion http://blog.searchcoders.com/ nxzone wrote: Why you think this bug is due to this cause? Why loading the shared content before should solve the Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar ? --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Check out the shared code portion of my modules presentation at blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nxzone Sent: Monday, March 26, 2007 2:27 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : Same problem ... Line 158 of ButtonBarButtonSkin.as... (parent.parent is a ToggleButtonBar not a buttonbar) var bar:ButtonBar = parent ? ButtonBar(parent.parent) : null; --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , lrhazi lrhazi@ wrote: I get this annoying error often: TypeError: Error #1034: Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar My app uses Modules and has a user login/logout functionality... I get the above error systematically when i logout of an account and login to a second one. Any hints on what to look for? Thank you very much. Mohamed~ -- 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
RE: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed :
Because it is a common problem. Try putting a ToggleButtonBar in the main app first to prove it one way or another. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nxzone Sent: Tuesday, March 27, 2007 2:36 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : Why you think this bug is due to this cause? Why loading the shared content before should solve the Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar ? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui [EMAIL PROTECTED] wrote: Check out the shared code portion of my modules presentation at blogs.adobe.com/aharui From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of nxzone Sent: Monday, March 26, 2007 2:27 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : Same problem ... Line 158 of ButtonBarButtonSkin.as... (parent.parent is a ToggleButtonBar not a buttonbar) var bar:ButtonBar = parent ? ButtonBar(parent.parent) : null; --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , lrhazi lrhazi@ wrote: I get this annoying error often: TypeError: Error #1034: Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar My app uses Modules and has a user login/logout functionality... I get the above error systematically when i logout of an account and login to a second one. Any hints on what to look for? Thank you very much. Mohamed~
[flexcoders] Re: TypeError: Error #1034: Type Coercion failed :
Same problem ... Line 158 of ButtonBarButtonSkin.as... (parent.parent is a ToggleButtonBar not a buttonbar) var bar:ButtonBar = parent ? ButtonBar(parent.parent) : null; --- In flexcoders@yahoogroups.com, lrhazi [EMAIL PROTECTED] wrote: I get this annoying error often: TypeError: Error #1034: Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar My app uses Modules and has a user login/logout functionality... I get the above error systematically when i logout of an account and login to a second one. Any hints on what to look for? Thank you very much. Mohamed~
RE: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed :
Check out the shared code portion of my modules presentation at blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nxzone Sent: Monday, March 26, 2007 2:27 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: TypeError: Error #1034: Type Coercion failed : Same problem ... Line 158 of ButtonBarButtonSkin.as... (parent.parent is a ToggleButtonBar not a buttonbar) var bar:ButtonBar = parent ? ButtonBar(parent.parent) : null; --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , lrhazi [EMAIL PROTECTED] wrote: I get this annoying error often: TypeError: Error #1034: Type Coercion failed: cannot convert mx.controls::[EMAIL PROTECTED] to mx.controls.ButtonBar My app uses Modules and has a user login/logout functionality... I get the above error systematically when i logout of an account and login to a second one. Any hints on what to look for? Thank you very much. Mohamed~