[flexcoders] [v2.0] ItemRenderer error:

2006-07-30 Thread Barry Beattie
I've finally upgraded from Beta3 to current version, and of course
some things broke.

I've traced the latest problem back to a LiveDocs example** I based my
code from which generates the error:

TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at MyRenderers::MyTreeItemRenderer/set data()


// Override the set method for the data property
// to set the font color and style of each node.
override public function set data(value:Object):void {
super.data = value;
if(TreeListData(super.listData).hasChildren) {
setStyle(color, 0xff);
setStyle(fontWeight, 'bold');
}
else {
setStyle(color, 0x00);
setStyle(fontWeight, 'normal');
}
}


I just can't see what's wrong with it what it might be in the Flex 2
changes between Beta 3 and Release
(http://weblogs.macromedia.com/flexteam/archives/2006/06/flex_2_changes.cfm)
It's a bit of a show stopper at the moment...

any suggestions?
thanx


** 
http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Partsfile=0856.html


--
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/
 





Re: [flexcoders] [v2.0] ItemRenderer error:

2006-07-30 Thread Brendan Meutzner



Check for if(data == null) before doing anything inside the implicit set for data...On 7/30/06, Barry Beattie 
[EMAIL PROTECTED] wrote:












  



I've finally upgraded from Beta3 to current version, and of course
some things broke.

I've traced the latest problem back to a LiveDocs example** I based my
code from which generates the error:

TypeError: Error #1009: Cannot access a property or method of a null
object reference.
	at MyRenderers::MyTreeItemRenderer/set data()

// Override the set method for the data property
// to set the font color and style of each node.
override public function set data(value:Object):void {
super.data = "">
if(TreeListData(super.listData).hasChildren) {
setStyle(color, 0xff);
setStyle(fontWeight, 'bold');
}
else {
setStyle(color, 0x00);
setStyle(fontWeight, 'normal');
}
}

I just can't see what's wrong with it what it might be in the Flex 2
changes between Beta 3 and Release
(http://weblogs.macromedia.com/flexteam/archives/2006/06/flex_2_changes.cfm
)
It's a bit of a show stopper at the moment...

any suggestions?
thanx

** http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Partsfile=0856.html


  















__._,_.___





--
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
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  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.



  






__,_._,___



Re: [flexcoders] [v2.0] ItemRenderer error:

2006-07-30 Thread Brendan Meutzner



sorry... if(value == null)On 7/30/06, Brendan Meutzner [EMAIL PROTECTED] wrote:
Check for if(data == null) before doing anything inside the implicit set for data...On 7/30/06, 
Barry Beattie 
[EMAIL PROTECTED] wrote:












  



I've finally upgraded from Beta3 to current version, and of course
some things broke.

I've traced the latest problem back to a LiveDocs example** I based my
code from which generates the error:

TypeError: Error #1009: Cannot access a property or method of a null
object reference.
	at MyRenderers::MyTreeItemRenderer/set data()

// Override the set method for the data property
// to set the font color and style of each node.
override public function set data(value:Object):void {
super.data = "">
if(TreeListData(super.listData).hasChildren) {
setStyle(color, 0xff);
setStyle(fontWeight, 'bold');
}
else {
setStyle(color, 0x00);
setStyle(fontWeight, 'normal');
}
}

I just can't see what's wrong with it what it might be in the Flex 2
changes between Beta 3 and Release
(http://weblogs.macromedia.com/flexteam/archives/2006/06/flex_2_changes.cfm
)
It's a bit of a show stopper at the moment...

any suggestions?
thanx

** http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Partsfile=0856.html


  

















__._,_.___





--
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
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  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.



  






__,_._,___



Re: [flexcoders] [v2.0] ItemRenderer error:

2006-07-30 Thread Barry Beattie
 Brendan Meutzner Sun, 30 Jul 2006 21:14:58 -0700
 sorry... if(value == null)

cheers Brendan. That did indeed fix it. Thankyou.

but I do have to ask why, since the existing code (without the
corrections mentioned on that example) worked fine with B3... (I just
need a better understanding of what to look for in the rest of the B3
code).

I can't seem to find your fix as a specific reference in
http://weblogs.macromedia.com/flexteam/archives/2006/06/flex_2_changes.cfm

any background info is appreciated. I'm still getting used to Flex...


thanx again
barry.b


--
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/
 





Re: [flexcoders] [v2.0] ItemRenderer error:

2006-07-30 Thread Brendan Meutzner



I don't have a solid answer, but I'd guess that the setter is getting called during initialization process before the object exists in the dataProvider... try running in debug mode and look through the stack trace when the error is caught... might provide some answers...
On 7/30/06, Barry Beattie [EMAIL PROTECTED] wrote:













  



 Brendan Meutzner Sun, 30 Jul 2006 21:14:58 -0700
 sorry... if(value == null)

cheers Brendan. That did indeed fix it. Thankyou.

but I do have to ask why, since the existing code (without the
corrections mentioned on that example) worked fine with B3... (I just
need a better understanding of what to look for in the rest of the B3
code).

I can't seem to find your fix as a specific reference in
http://weblogs.macromedia.com/flexteam/archives/2006/06/flex_2_changes.cfm


any background info is appreciated. I'm still getting used to Flex...

thanx again
barry.b

  















__._,_.___





--
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
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  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.



  






__,_._,___