[flexcoders] Re: unable to bind to property 'width' on class 'Object'
I had to rewrite my mxml component as an actionscript component... although there are some warning: unable to bind to property 'width' on class 'Object' (class is not an IEventDispatcher) the component is shown on the screen... but there is a new issue... this piece of code that worked in the mxml version: _legendWindow = ThemesControl( PopUpManager.createPopUp(this,ThemesControl, false)); now throws the following error: TypeError: Error #1009: No se puede acceder a una propiedad o a un método de una referencia a un objeto nulo. at _ThemesControlWatcherSetupUtil/setup() at ThemesControl/initialize()[ThemesControl.mxml:0] --- In flexcoders@yahoogroups.com, florian.salihovic [EMAIL PROTECTED] wrote: Code? --- In flexcoders@yahoogroups.com, Juan Carlos M. colombia@ wrote: but the problem is that component doesn´t appear on screen... ...it seems that it is unable to add it's child components... (measure method is called in an infinite loop) --- In flexcoders@yahoogroups.com, Vijay Anand Mareddy vam2@ wrote: dont worry its only a warning. You can get ride of it by typecasting your Object into an XML like this: { XML(object).width } --- In flexcoders@yahoogroups.com, Juan Carlos M. colombia@ wrote: Hi... may this is weird I´ve extended a Canvas component using mxml. When I use that component inside a titlewindow it works... but it doesn´t work inside other components and flex's console shows this error: warning: unable to bind to property 'width' on class 'Object' (class is not an IEventDispatcher) (it seems that measure method is in an infinite loop... )
RE: [flexcoders] Re: unable to bind to property 'width' on class 'Object'
That probably means that some child object isn't created yet, although Binding usually ignores such errors. Might you be calling initialize() out of order? There is a recipe for creating components that we recommend you follow. It is written up in the documentation, but also recently in Flex Authority Magazine. As far as binding warning are concerned, sometimes they can be ignored, and sometimes not. The warning is there for a reason. It is unusual for an MXML component that subclasses a display component to not be an IEventDispatcher, so there is something odd about that situation as well.Can you give us an idea of what the MXML version looked like? -Alex From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Juan Carlos M. Sent: Thursday, November 06, 2008 8:11 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: unable to bind to property 'width' on class 'Object' I had to rewrite my mxml component as an actionscript component... although there are some warning: unable to bind to property 'width' on class 'Object' (class is not an IEventDispatcher) the component is shown on the screen... but there is a new issue... this piece of code that worked in the mxml version: _legendWindow = ThemesControl( PopUpManager.createPopUp(this,ThemesControl, false)); now throws the following error: TypeError: Error #1009: No se puede acceder a una propiedad o a un método de una referencia a un objeto nulo. at _ThemesControlWatcherSetupUtil/setup() at ThemesControl/initialize()[ThemesControl.mxml:0] --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, florian.salihovic [EMAIL PROTECTED] wrote: Code? --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Juan Carlos M. colombia@ wrote: but the problem is that component doesn´t appear on screen... ...it seems that it is unable to add it's child components... (measure method is called in an infinite loop) --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Vijay Anand Mareddy vam2@ wrote: dont worry its only a warning. You can get ride of it by typecasting your Object into an XML like this: { XML(object).width } --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Juan Carlos M. colombia@ wrote: Hi... may this is weird I´ve extended a Canvas component using mxml. When I use that component inside a titlewindow it works... but it doesn´t work inside other components and flex's console shows this error: warning: unable to bind to property 'width' on class 'Object' (class is not an IEventDispatcher) (it seems that measure method is in an infinite loop... )
[flexcoders] Re: unable to bind to property 'width' on class 'Object'
finally it worked using BindingUtils.bindProperty and rewriting some code related to [Bindable] get/set methods. It seems that the main error its due to this kind of binding: text={iMap.map.selectedLayer.label} In that case databinding is not handling gracefully the case when iMap is null. Such kind of error causes a total break of the app. --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: That probably means that some child object isn't created yet, although Binding usually ignores such errors. Might you be calling initialize() out of order? There is a recipe for creating components that we recommend you follow. It is written up in the documentation, but also recently in Flex Authority Magazine. As far as binding warning are concerned, sometimes they can be ignored, and sometimes not. The warning is there for a reason. It is unusual for an MXML component that subclasses a display component to not be an IEventDispatcher, so there is something odd about that situation as well.Can you give us an idea of what the MXML version looked like? -Alex From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Juan Carlos M. Sent: Thursday, November 06, 2008 8:11 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: unable to bind to property 'width' on class 'Object' I had to rewrite my mxml component as an actionscript component... although there are some warning: unable to bind to property 'width' on class 'Object' (class is not an IEventDispatcher) the component is shown on the screen... but there is a new issue... this piece of code that worked in the mxml version: _legendWindow = ThemesControl( PopUpManager.createPopUp(this,ThemesControl, false)); now throws the following error: TypeError: Error #1009: No se puede acceder a una propiedad o a un método de una referencia a un objeto nulo. at _ThemesControlWatcherSetupUtil/setup() at ThemesControl/initialize()[ThemesControl.mxml:0] --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, florian.salihovic florian.salihovic@ wrote: Code? --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Juan Carlos M. colombia@ wrote: but the problem is that component doesn´t appear on screen... ...it seems that it is unable to add it's child components... (measure method is called in an infinite loop) --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Vijay Anand Mareddy vam2@ wrote: dont worry its only a warning. You can get ride of it by typecasting your Object into an XML like this: { XML(object).width } --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Juan Carlos M. colombia@ wrote: Hi... may this is weird I´ve extended a Canvas component using mxml. When I use that component inside a titlewindow it works... but it doesn´t work inside other components and flex's console shows this error: warning: unable to bind to property 'width' on class 'Object' (class is not an IEventDispatcher) (it seems that measure method is in an infinite loop... )
[flexcoders] Re: unable to bind to property 'width' on class 'Object'
but the problem is that component doesn´t appear on screen... ...it seems that it is unable to add it's child components... (measure method is called in an infinite loop) --- In flexcoders@yahoogroups.com, Vijay Anand Mareddy [EMAIL PROTECTED] wrote: dont worry its only a warning. You can get ride of it by typecasting your Object into an XML like this: { XML(object).width } --- In flexcoders@yahoogroups.com, Juan Carlos M. colombia@ wrote: Hi... may this is weird I´ve extended a Canvas component using mxml. When I use that component inside a titlewindow it works... but it doesn´t work inside other components and flex's console shows this error: warning: unable to bind to property 'width' on class 'Object' (class is not an IEventDispatcher) (it seems that measure method is in an infinite loop... )
[flexcoders] Re: unable to bind to property 'width' on class 'Object'
Code? --- In flexcoders@yahoogroups.com, Juan Carlos M. [EMAIL PROTECTED] wrote: but the problem is that component doesn´t appear on screen... ...it seems that it is unable to add it's child components... (measure method is called in an infinite loop) --- In flexcoders@yahoogroups.com, Vijay Anand Mareddy vam2@ wrote: dont worry its only a warning. You can get ride of it by typecasting your Object into an XML like this: { XML(object).width } --- In flexcoders@yahoogroups.com, Juan Carlos M. colombia@ wrote: Hi... may this is weird I´ve extended a Canvas component using mxml. When I use that component inside a titlewindow it works... but it doesn´t work inside other components and flex's console shows this error: warning: unable to bind to property 'width' on class 'Object' (class is not an IEventDispatcher) (it seems that measure method is in an infinite loop... )
[flexcoders] Re: unable to bind to property 'width' on class 'Object'
dont worry its only a warning. You can get ride of it by typecasting your Object into an XML like this: { XML(object).width } --- In flexcoders@yahoogroups.com, Juan Carlos M. [EMAIL PROTECTED] wrote: Hi... may this is weird I´ve extended a Canvas component using mxml. When I use that component inside a titlewindow it works... but it doesn´t work inside other components and flex's console shows this error: warning: unable to bind to property 'width' on class 'Object' (class is not an IEventDispatcher) (it seems that measure method is in an infinite loop... )