[flexcoders] Error #1034: Type Coercion failed: cannot convert JSON Data

2009-03-03 Thread keishalexie
Hi Everyone,

I am fairly new to Flex and am doing a project using Flex 3, the
as3corelib, and a PHP file that is sending json data.  The json data
is not being displayed in my data table and what is coming through is
valid (I checked in the JSON Validator).  I really am not sure where
the problem is: the mxml, php, as3corelib, or what?  Any suggestions
and I will post code if need be.



Re: [flexcoders] Error #1034: Type Coercion failed: cannot convert JSON Data

2009-03-03 Thread Anggie Bratadinata
Have you decoded the JSON data ?

Here's a snippet from a project I'm working on:

public function resultHandler(e:ResultEvent):void{
var rawString:String = String(e.result);
var json:* = JSON.decode(rawString);
var players:Array = json as Array;
_model.leaders = new ArrayCollection(players);
}

I use the AC as a dataProvider for some list component.

hth,
-- 
Anggie Bratadinata | www.masputih.com | Indonesia

On Tue, Mar 3, 2009 at 7:58 PM, keishalexie keishale...@yahoo.com wrote:

 Hi Everyone,

 I am fairly new to Flex and am doing a project using Flex 3, the
 as3corelib, and a PHP file that is sending json data.  The json data
 is not being displayed in my data table and what is coming through is
 valid (I checked in the JSON Validator).  I really am not sure where
 the problem is: the mxml, php, as3corelib, or what?  Any suggestions
 and I will post code if need be.




[flexcoders] Error #1034: Type Coercion failed: cannot convert to Date w/ Datagrid

2008-11-18 Thread timgerr
Hello all, 
I am trying to add a datefield to a datagrid using a itemEditor.  I
have seen that people are having this problem but I canot find a
solution (That I understand).  Has anyone ever had this problem and
what did you do to solve it.  Here is my code:


mx:DataGrid id=CertDG width=528 height=60% editable=true
   mx:columns
mx:DataGridColumn headerText=Name dataField=cert_name/
mx:DataGridColumn headerText=Issuer dataField=issuer/
mx:DataGridColumn headerText=Achieved
dataField=date_achieved editorDataField=text
mx:itemEditor  
mx:Component
  mx:DateField  formatString=DD-MM-YY
yearNavigationEnabled=truetoolTip=Format:DD-MM-YY/ 
 
/mx:Component  /mx:itemEditor
/mx:DataGridColumn
/mx:columns
/mx:DataGrid


Thanks for the read, 
timgerr



RE: [flexcoders] Error #1034: Type Coercion failed: cannot convert to Date w/ Datagrid

2008-11-18 Thread Alex Harui
editorDataField=selectedDate

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of timgerr
Sent: Tuesday, November 18, 2008 9:32 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Error #1034: Type Coercion failed: cannot convert  to 
Date w/ Datagrid


Hello all,
I am trying to add a datefield to a datagrid using a itemEditor. I
have seen that people are having this problem but I canot find a
solution (That I understand). Has anyone ever had this problem and
what did you do to solve it. Here is my code:

mx:DataGrid id=CertDG width=528 height=60% editable=true
mx:columns
mx:DataGridColumn headerText=Name dataField=cert_name/
mx:DataGridColumn headerText=Issuer dataField=issuer/
mx:DataGridColumn headerText=Achieved
dataField=date_achieved editorDataField=text
mx:itemEditor
mx:Component
mx:DateField formatString=DD-MM-YY
yearNavigationEnabled=true toolTip=Format:DD-MM-YY/
/mx:Component /mx:itemEditor
/mx:DataGridColumn
/mx:columns
/mx:DataGrid

Thanks for the read,
timgerr



Re: [flexcoders] Error #1034: Type Coercion failed.... how to solve?

2008-07-17 Thread Guilherme Blanco
Thanks!!!

It did the job. =)
I refactored my application a little and incorporated your code into
it... now it works smoother.

Thanks for the help!


Cheers,

On Thu, Jul 17, 2008 at 2:50 AM, Alex Harui [EMAIL PROTECTED] wrote:
 The modules presentation describes appdoms and shared code problems.



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Guilherme Blanco
 Sent: Wednesday, July 16, 2008 7:40 AM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Error #1034: Type Coercion failed how to
 solve?



 Could you please point me to the right post?

 I've looked at this page (after researched Google for your blog), and
 could not find it... http://blogs.adobe.com/aharui/

 Thanks in advance,

 On Wed, Jul 16, 2008 at 11:33 AM, Alex Harui [EMAIL PROTECTED] wrote:
 Shared code problem. See my blog



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Guilherme Blanco
 Sent: Wednesday, July 16, 2008 7:19 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Error #1034: Type Coercion failed how to solve?



 Hi all,

 I'm in troubles here... researching the internet furiously while post it
 here.
 I have in my application that loads a module and instantiate it inside
 an instance of class core.controls.ModalDialog, class that I wrote
 extended from TitleWindow.

 The source is really simple... here is the implementation of module load
 event:

 protected function handleCreateCompanyModuleLoad(event:ModuleEvent):void
 {
 var dialog:ModalDialog =
 ModalDialog(PopUpManager.createPopUp(Application(Application.application),
 ModalDialog, true));

 // Dialog customization
 dialog.title = Create Company;
 dialog.width = 450;
 dialog.height = 270;
 dialog.showCloseButton = true;

 // Dialog content customization
 var ui:* = event.module.factory.create();
 dialog.addChild(ui);
 }

 One of the buttons inside the module closes the ModalDialog, which
 should be accessible through this.parent or this.owner. Since I know
 I'm always inside of it, I cast the property to prevent Flex from
 popping my errors...

 mx:Button label=Cancel click=close();/

 protected function close():void
 {
 //ModalDialog(parent).close();
 ModalDialog(owner).close();
 }

 Everytime I execute the code and click in the Cancel button... it
 throws this runtime error:

 TypeError: Error #1034: Type Coercion failed: cannot convert
 core.controls::[EMAIL PROTECTED] to core.controls.ModalDialog.

 Any ideas how do I solve this?

 PS: Inside the application module (it's 100% modular) I already
 imported the ModalDialog and inside the module too researching the
 internet I saw someone telling that missing this might be a problem
 (solved the requester' issue), but didn't have any effect for me...

 []s,

 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil



 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil

 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


[flexcoders] Error #1034: Type Coercion failed.... how to solve?

2008-07-16 Thread Guilherme Blanco
Hi all,


I'm in troubles here... researching the internet furiously while post it here.
I have in my application that loads a module and instantiate it inside
an instance of class core.controls.ModalDialog, class that I wrote
extended from TitleWindow.

The source is really simple... here is the implementation of module load event:

protected function handleCreateCompanyModuleLoad(event:ModuleEvent):void
{
   var dialog:ModalDialog =
ModalDialog(PopUpManager.createPopUp(Application(Application.application),
ModalDialog, true));

   // Dialog customization
   dialog.title = Create Company;
   dialog.width = 450;
   dialog.height = 270;
   dialog.showCloseButton = true;

   // Dialog content customization
   var ui:* = event.module.factory.create();
   dialog.addChild(ui);
}


One of the buttons inside the module closes the ModalDialog, which
should be accessible through this.parent or this.owner. Since I know
I'm always inside of it, I cast the property to prevent Flex from
popping my errors...

mx:Button label=Cancel click=close();/


protected function close():void
{
   //ModalDialog(parent).close();
   ModalDialog(owner).close();
}


Everytime I execute the code and click in the Cancel button... it
throws this runtime error:

TypeError: Error #1034: Type Coercion failed: cannot convert
core.controls::[EMAIL PROTECTED] to core.controls.ModalDialog.


Any ideas how do I solve this?


PS: Inside the application module (it's 100% modular) I already
imported the ModalDialog and inside the module too researching the
internet I saw someone telling that missing this might be a problem
(solved the requester' issue), but didn't have any effect for me...


[]s,

-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


RE: [flexcoders] Error #1034: Type Coercion failed.... how to solve?

2008-07-16 Thread Alex Harui
Shared code problem.  See my blog

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Guilherme Blanco
Sent: Wednesday, July 16, 2008 7:19 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Error #1034: Type Coercion failed how to
solve?

 

Hi all,

I'm in troubles here... researching the internet furiously while post it
here.
I have in my application that loads a module and instantiate it inside
an instance of class core.controls.ModalDialog, class that I wrote
extended from TitleWindow.

The source is really simple... here is the implementation of module load
event:

protected function handleCreateCompanyModuleLoad(event:ModuleEvent):void
{
var dialog:ModalDialog =
ModalDialog(PopUpManager.createPopUp(Application(Application.application
),
ModalDialog, true));

// Dialog customization
dialog.title = Create Company;
dialog.width = 450;
dialog.height = 270;
dialog.showCloseButton = true;

// Dialog content customization
var ui:* = event.module.factory.create();
dialog.addChild(ui);
}

One of the buttons inside the module closes the ModalDialog, which
should be accessible through this.parent or this.owner. Since I know
I'm always inside of it, I cast the property to prevent Flex from
popping my errors...

mx:Button label=Cancel click=close();/

protected function close():void
{
//ModalDialog(parent).close();
ModalDialog(owner).close();
}

Everytime I execute the code and click in the Cancel button... it
throws this runtime error:

TypeError: Error #1034: Type Coercion failed: cannot convert
core.controls::[EMAIL PROTECTED] to core.controls.ModalDialog.

Any ideas how do I solve this?

PS: Inside the application module (it's 100% modular) I already
imported the ModalDialog and inside the module too researching the
internet I saw someone telling that missing this might be a problem
(solved the requester' issue), but didn't have any effect for me...

[]s,

-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED] mailto:guilhermeblanco%40hotmail.com 
URL: http://blog.bisna.com http://blog.bisna.com 
Rio de Janeiro - RJ/Brazil

 



Re: [flexcoders] Error #1034: Type Coercion failed.... how to solve?

2008-07-16 Thread Guilherme Blanco
Could you please point me to the right post?

I've looked at this page (after researched Google for your blog), and
could not find it... http://blogs.adobe.com/aharui/

Thanks in advance,

On Wed, Jul 16, 2008 at 11:33 AM, Alex Harui [EMAIL PROTECTED] wrote:
 Shared code problem.  See my blog



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Guilherme Blanco
 Sent: Wednesday, July 16, 2008 7:19 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Error #1034: Type Coercion failed how to solve?



 Hi all,

 I'm in troubles here... researching the internet furiously while post it
 here.
 I have in my application that loads a module and instantiate it inside
 an instance of class core.controls.ModalDialog, class that I wrote
 extended from TitleWindow.

 The source is really simple... here is the implementation of module load
 event:

 protected function handleCreateCompanyModuleLoad(event:ModuleEvent):void
 {
 var dialog:ModalDialog =
 ModalDialog(PopUpManager.createPopUp(Application(Application.application),
 ModalDialog, true));

 // Dialog customization
 dialog.title = Create Company;
 dialog.width = 450;
 dialog.height = 270;
 dialog.showCloseButton = true;

 // Dialog content customization
 var ui:* = event.module.factory.create();
 dialog.addChild(ui);
 }

 One of the buttons inside the module closes the ModalDialog, which
 should be accessible through this.parent or this.owner. Since I know
 I'm always inside of it, I cast the property to prevent Flex from
 popping my errors...

 mx:Button label=Cancel click=close();/

 protected function close():void
 {
 //ModalDialog(parent).close();
 ModalDialog(owner).close();
 }

 Everytime I execute the code and click in the Cancel button... it
 throws this runtime error:

 TypeError: Error #1034: Type Coercion failed: cannot convert
 core.controls::[EMAIL PROTECTED] to core.controls.ModalDialog.

 Any ideas how do I solve this?

 PS: Inside the application module (it's 100% modular) I already
 imported the ModalDialog and inside the module too researching the
 internet I saw someone telling that missing this might be a problem
 (solved the requester' issue), but didn't have any effect for me...

 []s,

 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil

 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


RE: [flexcoders] Error #1034: Type Coercion failed.... how to solve?

2008-07-16 Thread Alex Harui
The modules presentation describes appdoms and shared code problems.  

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Guilherme Blanco
Sent: Wednesday, July 16, 2008 7:40 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Error #1034: Type Coercion failed how to
solve?

 

Could you please point me to the right post?

I've looked at this page (after researched Google for your blog), and
could not find it... http://blogs.adobe.com/aharui/
http://blogs.adobe.com/aharui/ 

Thanks in advance,

On Wed, Jul 16, 2008 at 11:33 AM, Alex Harui [EMAIL PROTECTED]
mailto:aharui%40adobe.com  wrote:
 Shared code problem. See my blog



 

 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of Guilherme Blanco
 Sent: Wednesday, July 16, 2008 7:19 AM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] Error #1034: Type Coercion failed how to
solve?



 Hi all,

 I'm in troubles here... researching the internet furiously while post
it
 here.
 I have in my application that loads a module and instantiate it inside
 an instance of class core.controls.ModalDialog, class that I wrote
 extended from TitleWindow.

 The source is really simple... here is the implementation of module
load
 event:

 protected function
handleCreateCompanyModuleLoad(event:ModuleEvent):void
 {
 var dialog:ModalDialog =

ModalDialog(PopUpManager.createPopUp(Application(Application.application
),
 ModalDialog, true));

 // Dialog customization
 dialog.title = Create Company;
 dialog.width = 450;
 dialog.height = 270;
 dialog.showCloseButton = true;

 // Dialog content customization
 var ui:* = event.module.factory.create();
 dialog.addChild(ui);
 }

 One of the buttons inside the module closes the ModalDialog, which
 should be accessible through this.parent or this.owner. Since I know
 I'm always inside of it, I cast the property to prevent Flex from
 popping my errors...

 mx:Button label=Cancel click=close();/

 protected function close():void
 {
 //ModalDialog(parent).close();
 ModalDialog(owner).close();
 }

 Everytime I execute the code and click in the Cancel button... it
 throws this runtime error:

 TypeError: Error #1034: Type Coercion failed: cannot convert
 core.controls::[EMAIL PROTECTED] to core.controls.ModalDialog.

 Any ideas how do I solve this?

 PS: Inside the application module (it's 100% modular) I already
 imported the ModalDialog and inside the module too researching the
 internet I saw someone telling that missing this might be a problem
 (solved the requester' issue), but didn't have any effect for me...

 []s,

 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
mailto:guilhermeblanco%40hotmail.com 
 URL: http://blog.bisna.com http://blog.bisna.com 
 Rio de Janeiro - RJ/Brazil

 

-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED] mailto:guilhermeblanco%40hotmail.com 
URL: http://blog.bisna.com http://blog.bisna.com 
Rio de Janeiro - RJ/Brazil

 



[flexcoders] Error #1034: Type Coercion failed in EventDispatcher/dispatchEventFunction()

2008-02-05 Thread toofah_gm
I am seeing a very strange problem that I am unable to track down.

I have a custom Event class called ControllerEvent.  Essentially it
wraps Event and hangs onto some custom data for me.

I've been using it without issue for a long time...now today in one
case in my code when I call dispatchEvent with my ControllerEvent it
throws the following error:

TypeError: Error #1034: Type Coercion failed: cannot convert
mr.mvc.controller::[EMAIL PROTECTED] to Array.
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()

I don't understand what is happening here.  The event that is being
passed in is no different than any other instance that I have
previously passed in.  It's like something else is EventDispatcher is
in a bad state in this case or something.  Sure wish there was a way
to see inside of the flash.events.EventDispatcher code so that I could
debug this.

Any ideas?

Thanks!



[flexcoders] Error #1034: Type Coercion failed

2007-04-26 Thread rdeijkers
I'm trying to fill a Tile with the contents of an xml file. This is my
mxml code:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute width=100% height=100% backgroundAlpha=0
applicationComplete=srv.send(); horizontalScrollPolicy=off
verticalScrollPolicy=off
mx:Script
![CDATA[
private function xmlLoaded():void {
categorienAC = srv.lastResult.categorien.categorie;
}   
]]
/mx:Script

mx:Model id=categorienAC/
mx:HTTPService id=srv url=categorien.xml useProxy=false
result=xmlLoaded(); /
mx:Tile label=categorienTile width=945 height=100%
backgroundColor=#FF
mx:Repeater id=list dataProvider={categorienAC}
mx:VBox backgroundColor=#00
mx:Image source={list.currentItem.foto} 
width=75 height=70/
mx:Label text={list.currentItem.naam}/
/mx:VBox
/mx:Repeater
/mx:Tile
/mx:Application

My XML looks like this:

categorien
categorie id=19
naam/naam
omschrijvingtest/omschrijving
foto/foto
/categoriecategorie id=1
naamArizona/naam

omschrijvingtest/omschrijving
foto/foto
/categoriecategorie id=36
naamARIZONA / GREY/naam
omschrijving/omschrijving
foto/foto
/categoriecategorie id=20

naamAtrium/naam
omschrijvingtest/omschrijving
foto/foto
/categoriecategorie id=59
naamAvant Garde/naam
omschrijvingtest/omschrijving
foto/foto

/categorie
/categorien

I'm receiving the following error when I try to execute my code :

TypeError: Error #1034: Type Coercion failed: cannot convert
mx.collections::[EMAIL PROTECTED] to mx.utils.ObjectProxy.
at categorie/categorie::xmlLoaded()[Z:\project\categorie.mxml:6]

Anybody an idea what's going wrong ?

Anyhelp would be greatly appreciated.

Thanks

Regards

Ries



Re: [flexcoders] Error #1034: Type Coercion failed

2007-04-26 Thread Michael Wills
Would it help to make your HTTPService resultFormat e4x and not use 
mx:Model for categorienAC, but rather use an XMLList?


mx:Script
![CDATA[
*  var **categorienAC  : XMLList = new XMLList();*
 private function xmlLoaded():void {
   categorienAC = srv.lastResult.categorien.categorie;
 }
]]
/mx:Script

mx:HTTPService id=srv url=categorien.xml useProxy=false
result=xmlLoaded(); *resultFormat=e4x*/

Hope that helps,

Michael

rdeijkers wrote:


I'm trying to fill a Tile with the contents of an xml file. This is my
mxml code:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml 
http://www.adobe.com/2006/mxml

layout=absolute width=100% height=100% backgroundAlpha=0
applicationComplete=srv.send(); horizontalScrollPolicy=off
verticalScrollPolicy=off
mx:Script
![CDATA[
private function xmlLoaded():void {
categorienAC = srv.lastResult.categorien.categorie;
}
]]
/mx:Script

mx:Model id=categorienAC/
mx:HTTPService id=srv url=categorien.xml useProxy=false
result=xmlLoaded(); /
mx:Tile label=categorienTile width=945 height=100%
backgroundColor=#FF
mx:Repeater id=list dataProvider={categorienAC}
mx:VBox backgroundColor=#00
mx:Image source={list.currentItem.foto} width=75 height=70/
mx:Label text={list.currentItem.naam}/
/mx:VBox
/mx:Repeater
/mx:Tile
/mx:Application

My XML looks like this:

categorien
categorie id=19
naam/naam
omschrijvingtest/omschrijving
foto/foto
/categorie categorie id=1
naamArizona/naam

omschrijvingtest/omschrijving
foto/foto
/categorie categorie id=36
naamARIZONA / GREY/naam
omschrijving/omschrijving
foto/foto
/categorie categorie id=20

naamAtrium/naam
omschrijvingtest/omschrijving
foto/foto
/categorie categorie id=59
naamAvant Garde/naam
omschrijvingtest/omschrijving
foto/foto

/categorie
/categorien

I'm receiving the following error when I try to execute my code :

TypeError: Error #1034: Type Coercion failed: cannot convert
mx.collections::[EMAIL PROTECTED] to mx.utils.ObjectProxy.
at categorie/categorie::xmlLoaded()[Z:\project\categorie.mxml:6]

Anybody an idea what's going wrong ?

Anyhelp would be greatly appreciated.

Thanks

Regards

Ries