Re: [flexcoders] accessing styles of children

2008-07-22 Thread [EMAIL PROTECTED]
for (var i:int = 0; i  numChildren; i++) {
StyleClient(videoButtonBox.getChildAt(i)).setStyle(backgroundColor,#FF)
}

1180: Call to a possibly undefined method StyleClient.

Thanks, but I don't get it. Please explain.

Alex Harui wrote:
 
  It is if you cast everything correctly
 
 
 
  IStyleClient(videoButtonBox.getChildAt(i)).setStyle(…).
 
 
 
  The compile is trying to help you out so the return types of methods 
and properties are important
 
 
 
  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
On Behalf Of [EMAIL PROTECTED]
  Sent: Monday, July 21, 2008 10:14 PM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] accessing styles of children
 
 
 
  videoButtonBox. is an VBox with HBoxes for children.
  How do I change styles as I iterate thru children?
  videoButtonBox.getChildAt(i).setStyle() is not a function.
 
  var numChildren:Number = videoButtonBox.numChildren;
  for (var i:int = 0; i  numChildren; i++) {
  videoButtonBox.getChildAt(i)
  }
 
  This page talks about rawChildren as a way to access styles, but I have
  read it 10 times and I have no idea what they are trying to describe.
 





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* 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] accessing styles of children

2008-07-22 Thread Scott Bachman
Alex's email clearly said IStyleClient with a capital I in front. You'll
also need to import it at the top of your file if FlexBuilder doesn't do it
for you: import mx.styles.IStyleClient.

Since getChildAt returns a generic DisplayObject, you have to cast it to a
more specific type to be able to call setStyle. If none of this makes
sense to you, you probably need to do some reading up on the object-oriented
programming concept called polymorphism.

Scott

On Tue, Jul 22, 2008 at 2:34 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 for (var i:int = 0; i  numChildren; i++) {

 StyleClient(videoButtonBox.getChildAt(i)).setStyle(backgroundColor,#FF)
 }

 1180: Call to a possibly undefined method StyleClient.

 Thanks, but I don't get it. Please explain.

 Alex Harui wrote:
  
   It is if you cast everything correctly
  
  
  
   IStyleClient(videoButtonBox.getChildAt(i)).setStyle(…).
  
  
  
   The compile is trying to help you out so the return types of methods
 and properties are important
  
  
  
   From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
 On Behalf Of [EMAIL PROTECTED]
   Sent: Monday, July 21, 2008 10:14 PM
   To: flexcoders@yahoogroups.com
   Subject: [flexcoders] accessing styles of children
  
  
  
   videoButtonBox. is an VBox with HBoxes for children.
   How do I change styles as I iterate thru children?
   videoButtonBox.getChildAt(i).setStyle() is not a function.
  
   var numChildren:Number = videoButtonBox.numChildren;
   for (var i:int = 0; i  numChildren; i++) {
   videoButtonBox.getChildAt(i)
   }
  
   This page talks about rawChildren as a way to access styles, but I have
   read it 10 times and I have no idea what they are trying to describe.
  



 

 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Search Archives:
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
 Links






Re: [flexcoders] accessing styles of children

2008-07-22 Thread [EMAIL PROTECTED]
Thanks for explaining.

 

IStyleClient(videoButtonBox.getChildAt(i)).setStyle(…).



I didn't think it was an I, I actually tried |StyleClient(videoButton..

Scott Bachman wrote:
 Alex's email clearly said IStyleClient with a capital I in front. 
 You'll also need to import it at the top of your file if FlexBuilder 
 doesn't do it for you: import mx.styles.IStyleClient.

 Since getChildAt returns a generic DisplayObject, you have to cast it 
 to a more specific type to be able to call setStyle. If none of this 
 makes sense to you, you probably need to do some reading up on the 
 object-oriented programming concept called polymorphism.

 Scott

 On Tue, Jul 22, 2008 at 2:34 AM, [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
 wrote:

 for (var i:int = 0; i  numChildren; i++) {
 
 StyleClient(videoButtonBox.getChildAt(i)).setStyle(backgroundColor,#FF)
 }

 1180: Call to a possibly undefined method StyleClient.

 Thanks, but I don't get it. Please explain.

 Alex Harui wrote:
  
   It is if you cast everything correctly
  
  
  
   IStyleClient(videoButtonBox.getChildAt(i)).setStyle(…).
  
  
  
   The compile is trying to help you out so the return types of
 methods
 and properties are important
  
  
  
   From: flexcoders@yahoogroups.com
 mailto:flexcoders@yahoogroups.com
 [mailto:flexcoders@yahoogroups.com
 mailto:flexcoders@yahoogroups.com]
 On Behalf Of [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
   Sent: Monday, July 21, 2008 10:14 PM
   To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
   Subject: [flexcoders] accessing styles of children
  
  
  
   videoButtonBox. is an VBox with HBoxes for children.
   How do I change styles as I iterate thru children?
   videoButtonBox.getChildAt(i).setStyle() is not a function.
  
   var numChildren:Number = videoButtonBox.numChildren;
   for (var i:int = 0; i  numChildren; i++) {
   videoButtonBox.getChildAt(i)
   }
  
   This page talks about rawChildren as a way to access styles,
 but I have
   read it 10 times and I have no idea what they are trying to
 describe.
  



 

 --
 Flexcoders Mailing List
 FAQ:
 http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Search Archives:
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo!
 Groups Links


(Yahoo! ID required)

mailto:[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]




 
 No virus found in this incoming message.
 Checked by AVG - http://www.avg.com 
 Version: 8.0.138 / Virus Database: 270.5.3/1565 - Release Date: 7/21/2008 
 6:36 PM
   




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* 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] accessing styles of children

2008-07-21 Thread Alex Harui
It is if you cast everything correctly

 

IStyleClient(videoButtonBox.getChildAt(i)).setStyle(...).

 

The compile is trying to help you out so the return types of methods and
properties are important

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Monday, July 21, 2008 10:14 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] accessing styles of children

 

videoButtonBox. is an VBox with HBoxes for children.
How do I change styles as I iterate thru children?
videoButtonBox.getChildAt(i).setStyle() is not a function.

var numChildren:Number = videoButtonBox.numChildren;
for (var i:int = 0; i  numChildren; i++) {
videoButtonBox.getChildAt(i)
}

This page talks about rawChildren as a way to access styles, but I have 
read it 10 times and I have no idea what they are trying to describe.