[flexcoders] Quick Question?
I have loaded an image into a mx:Image/ component, how do I get the dimentions of the source image in the file it comes from. when I try contentWidth contentHeight I just get the current displayed width and hight, not the image files width and height? - Stephen
Re: [flexcoders] Quick Question?
Hi Stephen, You'll find those values in the Image component's contentHeight and contentWidth properties. Tibor. www.tiborballai.com criptopus wrote: I have loaded an image into a mx:Image/ component, how do I get the dimentions of the source image in the file it comes from. when I try contentWidth contentHeight I just get the current displayed width and hight, not the image files width and height? - Stephen -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 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: flexcoders-dig...@yahoogroups.com flexcoders-fullfeatu...@yahoogroups.com * To unsubscribe from this group, send an email to: flexcoders-unsubscr...@yahoogroups.com * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Quick Question: How do i control the number of item renderers to be created as
a buffer in all directions... I forget how to do that, please? Thanks, Patrick
RE: [flexcoders] Quick Question: How do i control the number of item renderers to be created as
I do not know that you can, without re-writing the List controls. Why do you want to do this? Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of djhatrick Sent: Thursday, April 16, 2009 6:21 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Quick Question: How do i control the number of item renderers to be created as a buffer in all directions... I forget how to do that, please? Thanks, Patrick
RE: [flexcoders] Quick question about Mixins and internal class scope
Interesting, what name did you use for the look up? How was the class set up? It doesn't surprise me though. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Sunday, August 31, 2008 10:43 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Quick question about Mixins and internal class scope I was just hoping it was something that'd been tried and there's be an answer. The answer for anybody following this however, is that getDefinitionByName() returns null, and you NPE inside SystemManager :) -Josh On Mon, Sep 1, 2008 at 3:28 PM, Alex Harui [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote: In case you were hoping I had the answer, I don't. Should be a 10 minute experiment though. However, an internal class can certainly be handed the SM by the first [mixin] that uses it From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On Behalf Of Josh McDonald Sent: Sunday, August 31, 2008 5:43 PM To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com Subject: [flexcoders] Quick question about Mixins and internal class scope Hey guys, I'm miles from compiling and testing what I'm writing at the moment, so I thought I'd just ask in case somebody knows- will getDefinitionByName(foo) fail on an internal class when SystemManager is trying to call init() on the mixins? I have a class I'd like to make internal, but it needs to be a mixin as well in order to get a reference to SystemManager ASAP. Cheers, -Josh -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED]
Re: [flexcoders] Quick question about Mixins and internal class scope
package pkg { public class Class1 { private var ref:Class2; } } package pkg { [Mixin] internal class Class2 { public static function init(foo:*) : void { trace(Class2.init called with foo = + foo); } } } There's a ref to Class1 from Application. I would have thought that getDefinitionByName(pkg.Class2) would throw an exception, but it's just returning null. Perhaps that's the behaviour for found but hidden, or it might be just special behaviour on behalf of SM or because it's frame1... -Josh On Mon, Sep 1, 2008 at 3:59 PM, Alex Harui [EMAIL PROTECTED] wrote: Interesting, what name did you use for the look up? How was the class set up? It doesn't surprise me though. *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Josh McDonald *Sent:* Sunday, August 31, 2008 10:43 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Quick question about Mixins and internal class scope I was just hoping it was something that'd been tried and there's be an answer. The answer for anybody following this however, is that getDefinitionByName() returns null, and you NPE inside SystemManager :) -Josh On Mon, Sep 1, 2008 at 3:28 PM, Alex Harui [EMAIL PROTECTED] wrote: In case you were hoping I had the answer, I don't. Should be a 10 minute experiment though. However, an internal class can certainly be handed the SM by the first [mixin] that uses it *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Josh McDonald *Sent:* Sunday, August 31, 2008 5:43 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Quick question about Mixins and internal class scope Hey guys, I'm miles from compiling and testing what I'm writing at the moment, so I thought I'd just ask in case somebody knows- will getDefinitionByName(foo) fail on an internal class when SystemManager is trying to call init() on the mixins? I have a class I'd like to make internal, but it needs to be a mixin as well in order to get a reference to SystemManager ASAP. Cheers, -Josh -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
Re: [flexcoders] Quick question about Mixins and internal class scope
I was actually hoping the compiler would either generate a public alias to put into info()[mixins]; or leave that class out of the list entirely, maybe with a warning... Might file a bug some time :) -Josh On Mon, Sep 1, 2008 at 4:10 PM, Josh McDonald [EMAIL PROTECTED] wrote: package pkg { public class Class1 { private var ref:Class2; } } package pkg { [Mixin] internal class Class2 { public static function init(foo:*) : void { trace(Class2.init called with foo = + foo); } } } There's a ref to Class1 from Application. I would have thought that getDefinitionByName(pkg.Class2) would throw an exception, but it's just returning null. Perhaps that's the behaviour for found but hidden, or it might be just special behaviour on behalf of SM or because it's frame1... -Josh On Mon, Sep 1, 2008 at 3:59 PM, Alex Harui [EMAIL PROTECTED] wrote: Interesting, what name did you use for the look up? How was the class set up? It doesn't surprise me though. *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Josh McDonald *Sent:* Sunday, August 31, 2008 10:43 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Quick question about Mixins and internal class scope I was just hoping it was something that'd been tried and there's be an answer. The answer for anybody following this however, is that getDefinitionByName() returns null, and you NPE inside SystemManager :) -Josh On Mon, Sep 1, 2008 at 3:28 PM, Alex Harui [EMAIL PROTECTED] wrote: In case you were hoping I had the answer, I don't. Should be a 10 minute experiment though. However, an internal class can certainly be handed the SM by the first [mixin] that uses it *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Josh McDonald *Sent:* Sunday, August 31, 2008 5:43 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Quick question about Mixins and internal class scope Hey guys, I'm miles from compiling and testing what I'm writing at the moment, so I thought I'd just ask in case somebody knows- will getDefinitionByName(foo) fail on an internal class when SystemManager is trying to call init() on the mixins? I have a class I'd like to make internal, but it needs to be a mixin as well in order to get a reference to SystemManager ASAP. Cheers, -Josh -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
RE: [flexcoders] Quick question about Mixins and internal class scope
The compiler isn't that smart. Did you ever call getQualifiedClassName() on the internal class to see what its name might be? Could be decorated some way, but then I think you should have gotten an exception. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Sunday, August 31, 2008 11:12 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Quick question about Mixins and internal class scope I was actually hoping the compiler would either generate a public alias to put into info()[mixins]; or leave that class out of the list entirely, maybe with a warning... Might file a bug some time :) -Josh On Mon, Sep 1, 2008 at 4:10 PM, Josh McDonald [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote: package pkg { public class Class1 { private var ref:Class2; } } package pkg { [Mixin] internal class Class2 { public static function init(foo:*) : void { trace(Class2.init called with foo = + foo); } } } There's a ref to Class1 from Application. I would have thought that getDefinitionByName(pkg.Class2) would throw an exception, but it's just returning null. Perhaps that's the behaviour for found but hidden, or it might be just special behaviour on behalf of SM or because it's frame1... -Josh On Mon, Sep 1, 2008 at 3:59 PM, Alex Harui [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote: Interesting, what name did you use for the look up? How was the class set up? It doesn't surprise me though. From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On Behalf Of Josh McDonald Sent: Sunday, August 31, 2008 10:43 PM To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com Subject: Re: [flexcoders] Quick question about Mixins and internal class scope I was just hoping it was something that'd been tried and there's be an answer. The answer for anybody following this however, is that getDefinitionByName() returns null, and you NPE inside SystemManager :) -Josh On Mon, Sep 1, 2008 at 3:28 PM, Alex Harui [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote: In case you were hoping I had the answer, I don't. Should be a 10 minute experiment though. However, an internal class can certainly be handed the SM by the first [mixin] that uses it From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On Behalf Of Josh McDonald Sent: Sunday, August 31, 2008 5:43 PM To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com Subject: [flexcoders] Quick question about Mixins and internal class scope Hey guys, I'm miles from compiling and testing what I'm writing at the moment, so I thought I'd just ask in case somebody knows- will getDefinitionByName(foo) fail on an internal class when SystemManager is trying to call init() on the mixins? I have a class I'd like to make internal, but it needs to be a mixin as well in order to get a reference to SystemManager ASAP. Cheers, -Josh -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED]
[flexcoders] Quick question about Mixins and internal class scope
Hey guys, I'm miles from compiling and testing what I'm writing at the moment, so I thought I'd just ask in case somebody knows- will getDefinitionByName(foo) fail on an internal class when SystemManager is trying to call init() on the mixins? I have a class I'd like to make internal, but it needs to be a mixin as well in order to get a reference to SystemManager ASAP. Cheers, -Josh -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
RE: [flexcoders] Quick question about Mixins and internal class scope
In case you were hoping I had the answer, I don't. Should be a 10 minute experiment though. However, an internal class can certainly be handed the SM by the first [mixin] that uses it From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Sunday, August 31, 2008 5:43 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Quick question about Mixins and internal class scope Hey guys, I'm miles from compiling and testing what I'm writing at the moment, so I thought I'd just ask in case somebody knows- will getDefinitionByName(foo) fail on an internal class when SystemManager is trying to call init() on the mixins? I have a class I'd like to make internal, but it needs to be a mixin as well in order to get a reference to SystemManager ASAP. Cheers, -Josh -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED]
Re: [flexcoders] Quick question about Mixins and internal class scope
I was just hoping it was something that'd been tried and there's be an answer. The answer for anybody following this however, is that getDefinitionByName() returns null, and you NPE inside SystemManager :) -Josh On Mon, Sep 1, 2008 at 3:28 PM, Alex Harui [EMAIL PROTECTED] wrote: In case you were hoping I had the answer, I don't. Should be a 10 minute experiment though. However, an internal class can certainly be handed the SM by the first [mixin] that uses it *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Josh McDonald *Sent:* Sunday, August 31, 2008 5:43 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Quick question about Mixins and internal class scope Hey guys, I'm miles from compiling and testing what I'm writing at the moment, so I thought I'd just ask in case somebody knows- will getDefinitionByName(foo) fail on an internal class when SystemManager is trying to call init() on the mixins? I have a class I'd like to make internal, but it needs to be a mixin as well in order to get a reference to SystemManager ASAP. Cheers, -Josh -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
[flexcoders] Quick question - who calls UIComponent.measure()?
Hey guys, Since UIComponent.measure() is protected, does the container invoke it via a round-about way, or is it simply called from a ResizeEvent.RESIZE handler somewhere in UIComponent? -J -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
RE: [flexcoders] Quick question - who calls UIComponent.measure()?
It is called by LayoutManager via validateSize() From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 4:33 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Quick question - who calls UIComponent.measure()? Hey guys, Since UIComponent.measure() is protected, does the container invoke it via a round-about way, or is it simply called from a ResizeEvent.RESIZE handler somewhere in UIComponent? -J -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
Re: [flexcoders] Quick question - who calls UIComponent.measure()?
Thanks Alex, as usual you're quick and bring exactly the answer I'm after. It's much appreciated. -J On Wed, May 14, 2008 at 10:07 AM, Alex Harui [EMAIL PROTECTED] wrote: It is called by LayoutManager via validateSize() -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Josh McDonald *Sent:* Tuesday, May 13, 2008 4:33 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Quick question - who calls UIComponent.measure()? Hey guys, Since UIComponent.measure() is protected, does the container invoke it via a round-about way, or is it simply called from a ResizeEvent.RESIZE handler somewhere in UIComponent? -J -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
RE: [flexcoders] Quick question - who calls UIComponent.measure()?
Question - is it part of the lifecycle of the component ? Mansour :-) -Original Message- From: flexcoders@yahoogroups.com on behalf of Alex Harui Sent: Tue 5/13/2008 8:07 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Quick question - who calls UIComponent.measure()? It is called by LayoutManager via validateSize() From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 4:33 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Quick question - who calls UIComponent.measure()? Hey guys, Since UIComponent.measure() is protected, does the container invoke it via a round-about way, or is it simply called from a ResizeEvent.RESIZE handler somewhere in UIComponent? -J -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] winmail.dat
Re: [flexcoders] Quick question - who calls UIComponent.measure()?
If it's in a container that uses a LayoutManager (not Canvas IIRC), and if the component in question isn't of a fixed size. If you need to measure and position stuff in a component that's not always of a fluid size, you need to move your code into another method, and call it both from measure() and on CreationComplete and whenever you add a component. I'm not sure if it could be attached to invalidateDisplayList somehow, in case you do something that triggers an endless loop ;-) It's something I'll look into when I have more time, as I'm doing all my component adding in createChildren() and haven't had to deal with post CreationComplete changes. Alex, please correct me if I'm wrong in there somewhere, too! -J On Wed, May 14, 2008 at 10:18 AM, Mansour Raad [EMAIL PROTECTED] wrote: Question - is it part of the lifecycle of the component ? Mansour :-) -Original Message- From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com on behalf of Alex Harui Sent: Tue 5/13/2008 8:07 PM To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: RE: [flexcoders] Quick question - who calls UIComponent.measure()? It is called by LayoutManager via validateSize() From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com [mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 4:33 PM To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: [flexcoders] Quick question - who calls UIComponent.measure()? Hey guys, Since UIComponent.measure() is protected, does the container invoke it via a round-about way, or is it simply called from a ResizeEvent.RESIZE handler somewhere in UIComponent? -J -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] josh%40gfunk007.com mailto: [EMAIL PROTECTED] josh%40gfunk007.com -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
RE: [flexcoders] Quick question - who calls UIComponent.measure()?
Yes. The key lifecycle methods are createChildren() commitProperties() measure() updateDisplayList() Gordon Smith Adobe Flex SDK Team -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mansour Raad Sent: Tuesday, May 13, 2008 5:18 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Quick question - who calls UIComponent.measure()? Question - is it part of the lifecycle of the component ? Mansour :-) -Original Message- From: flexcoders@yahoogroups.com on behalf of Alex Harui Sent: Tue 5/13/2008 8:07 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Quick question - who calls UIComponent.measure()? It is called by LayoutManager via validateSize() From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 4:33 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Quick question - who calls UIComponent.measure()? Hey guys, Since UIComponent.measure() is protected, does the container invoke it via a round-about way, or is it simply called from a ResizeEvent.RESIZE handler somewhere in UIComponent? -J -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
RE: [flexcoders] Quick question - who calls UIComponent.measure()?
Measure() is called on Canvas as well because a Canvas's measuredWidth/Height are dictated by the position and size of its children. You should always measure your children in the measure() method, and position them in updateDisplayList. Anything you do in creationComplete can cause something to be invalidated and cause another pass of commitProperties/measure/updateDisplayList. I'm not sure what you mean by attached to invalidateDisplayList. It is possible to create invalidation loops where by the time we finish validating, something is invalidated again. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 5:54 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Quick question - who calls UIComponent.measure()? If it's in a container that uses a LayoutManager (not Canvas IIRC), and if the component in question isn't of a fixed size. If you need to measure and position stuff in a component that's not always of a fluid size, you need to move your code into another method, and call it both from measure() and on CreationComplete and whenever you add a component. I'm not sure if it could be attached to invalidateDisplayList somehow, in case you do something that triggers an endless loop ;-) It's something I'll look into when I have more time, as I'm doing all my component adding in createChildren() and haven't had to deal with post CreationComplete changes. Alex, please correct me if I'm wrong in there somewhere, too! -J On Wed, May 14, 2008 at 10:18 AM, Mansour Raad [EMAIL PROTECTED] wrote: Question - is it part of the lifecycle of the component ? Mansour :-) -Original Message- From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com on behalf of Alex Harui Sent: Tue 5/13/2008 8:07 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: RE: [flexcoders] Quick question - who calls UIComponent.measure()? It is called by LayoutManager via validateSize() From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 4:33 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Quick question - who calls UIComponent.measure()? Hey guys, Since UIComponent.measure() is protected, does the container invoke it via a round-about way, or is it simply called from a ResizeEvent.RESIZE handler somewhere in UIComponent? -J -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] mailto:josh%40gfunk007.com mailto:[EMAIL PROTECTED] mailto:josh%40gfunk007.com -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
Re: [flexcoders] Quick question - who calls UIComponent.measure()?
What I meant was, I didn't want to do my sizing / positioning in a handler that's triggered by invalidateDisplayList() - which is only updateDisplayList() according to my limited knowledge, because I was worried that moving or resizing a component would trigger another invalidateDisplayList() - but it sounds like I was wrong, which is good to know =) Does Canvas use a LayoutManager? What's it do? Is that what interprets the style information on the children such as top or horizontalCenter? I'm building a component based on Canvas that never adjusts its own measuredWidth / measuredHeight. It does only what it inherits from Canvas, and positions all children and sets their width and height explicitly based on its own dimenisions. Based on how I'm interpreting your post, I shouldn't be overriding measure at all, and move my child-position code into invalidateDisplayList()? It's working fine now, but I hate doing things the wrong way ;-) I tell you what, I'd sell my left nut for some flow charts of how a well behaved complex component behaves, showing when invalidateXXX() is flagged, and what determines whether or not things are invalidated. Does anything that detailed exist? Would people out there find it useful if I take a few hours to work on a preliminary one over the weekend? I know there's a few lifecycle of a component articles, but I'm thinking of something more verbose. -J On Wed, May 14, 2008 at 1:58 PM, Alex Harui [EMAIL PROTECTED] wrote: Measure() is called on Canvas as well because a Canvas's measuredWidth/Height are dictated by the position and size of its children. You should always measure your children in the measure() method, and position them in updateDisplayList. Anything you do in creationComplete can cause something to be invalidated and cause another pass of commitProperties/measure/updateDisplayList. I'm not sure what you mean by attached to invalidateDisplayList. It is possible to create invalidation loops where by the time we finish validating, something is invalidated again. -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Josh McDonald *Sent:* Tuesday, May 13, 2008 5:54 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Quick question - who calls UIComponent.measure()? If it's in a container that uses a LayoutManager (not Canvas IIRC), and if the component in question isn't of a fixed size. If you need to measure and position stuff in a component that's not always of a fluid size, you need to move your code into another method, and call it both from measure() and on CreationComplete and whenever you add a component. I'm not sure if it could be attached to invalidateDisplayList somehow, in case you do something that triggers an endless loop ;-) It's something I'll look into when I have more time, as I'm doing all my component adding in createChildren() and haven't had to deal with post CreationComplete changes. Alex, please correct me if I'm wrong in there somewhere, too! -J On Wed, May 14, 2008 at 10:18 AM, Mansour Raad [EMAIL PROTECTED] wrote: Question - is it part of the lifecycle of the component ? Mansour :-) -Original Message- From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com on behalf of Alex Harui Sent: Tue 5/13/2008 8:07 PM To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: RE: [flexcoders] Quick question - who calls UIComponent.measure()? It is called by LayoutManager via validateSize() From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com [mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 4:33 PM To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: [flexcoders] Quick question - who calls UIComponent.measure()? Hey guys, Since UIComponent.measure() is protected, does the container invoke it via a round-about way, or is it simply called from a ResizeEvent.RESIZE handler somewhere in UIComponent? -J -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] josh%40gfunk007.com mailto: [EMAIL PROTECTED] josh%40gfunk007.com -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
RE: [flexcoders] Quick question - who calls UIComponent.measure()?
At each level (commitProperties, measure, updateDisplayList), their equivalent invalidators (invalidateProperties, invalidateSize, invalidateDisplayList) are blocked such that work you do in those methods will not trigger another call to those methods. But work you do in updateDisplayList can call invalidateSize and trigger another measure() which could in turn call invalidateDisplayList and trigger another updateDisplayList. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 9:46 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Quick question - who calls UIComponent.measure()? What I meant was, I didn't want to do my sizing / positioning in a handler that's triggered by invalidateDisplayList() - which is only updateDisplayList() according to my limited knowledge, because I was worried that moving or resizing a component would trigger another invalidateDisplayList() - but it sounds like I was wrong, which is good to know =) Does Canvas use a LayoutManager? What's it do? Is that what interprets the style information on the children such as top or horizontalCenter? I'm building a component based on Canvas that never adjusts its own measuredWidth / measuredHeight. It does only what it inherits from Canvas, and positions all children and sets their width and height explicitly based on its own dimenisions. Based on how I'm interpreting your post, I shouldn't be overriding measure at all, and move my child-position code into invalidateDisplayList()? It's working fine now, but I hate doing things the wrong way ;-) I tell you what, I'd sell my left nut for some flow charts of how a well behaved complex component behaves, showing when invalidateXXX() is flagged, and what determines whether or not things are invalidated. Does anything that detailed exist? Would people out there find it useful if I take a few hours to work on a preliminary one over the weekend? I know there's a few lifecycle of a component articles, but I'm thinking of something more verbose. -J On Wed, May 14, 2008 at 1:58 PM, Alex Harui [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Measure() is called on Canvas as well because a Canvas's measuredWidth/Height are dictated by the position and size of its children. You should always measure your children in the measure() method, and position them in updateDisplayList. Anything you do in creationComplete can cause something to be invalidated and cause another pass of commitProperties/measure/updateDisplayList. I'm not sure what you mean by attached to invalidateDisplayList. It is possible to create invalidation loops where by the time we finish validating, something is invalidated again. From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 5:54 PM To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com Subject: Re: [flexcoders] Quick question - who calls UIComponent.measure()? If it's in a container that uses a LayoutManager (not Canvas IIRC), and if the component in question isn't of a fixed size. If you need to measure and position stuff in a component that's not always of a fluid size, you need to move your code into another method, and call it both from measure() and on CreationComplete and whenever you add a component. I'm not sure if it could be attached to invalidateDisplayList somehow, in case you do something that triggers an endless loop ;-) It's something I'll look into when I have more time, as I'm doing all my component adding in createChildren() and haven't had to deal with post CreationComplete changes. Alex, please correct me if I'm wrong in there somewhere, too! -J On Wed, May 14, 2008 at 10:18 AM, Mansour Raad [EMAIL PROTECTED] wrote: Question - is it part of the lifecycle of the component ? Mansour :-) -Original Message- From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com on behalf of Alex Harui Sent: Tue 5/13/2008 8:07 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: RE: [flexcoders] Quick question - who calls UIComponent.measure()? It is called by LayoutManager via validateSize() From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 4:33 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Quick question - who calls UIComponent.measure()? Hey guys, Since UIComponent.measure() is protected, does the container invoke it via a round-about way, or is it simply called from a ResizeEvent.RESIZE handler somewhere in UIComponent? -J -- Therefore, send not to know For whom
Re: [flexcoders] Quick question - who calls UIComponent.measure()?
Supoib! :) -J On Wed, May 14, 2008 at 3:38 PM, Alex Harui [EMAIL PROTECTED] wrote: At each level (commitProperties, measure, updateDisplayList), their equivalent invalidators (invalidateProperties, invalidateSize, invalidateDisplayList) are blocked such that work you do in those methods will not trigger another call to those methods. But work you do in updateDisplayList can call invalidateSize and trigger another measure() which could in turn call invalidateDisplayList and trigger another updateDisplayList. -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Josh McDonald *Sent:* Tuesday, May 13, 2008 9:46 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Quick question - who calls UIComponent.measure()? What I meant was, I didn't want to do my sizing / positioning in a handler that's triggered by invalidateDisplayList() - which is only updateDisplayList() according to my limited knowledge, because I was worried that moving or resizing a component would trigger another invalidateDisplayList() - but it sounds like I was wrong, which is good to know =) Does Canvas use a LayoutManager? What's it do? Is that what interprets the style information on the children such as top or horizontalCenter? I'm building a component based on Canvas that never adjusts its own measuredWidth / measuredHeight. It does only what it inherits from Canvas, and positions all children and sets their width and height explicitly based on its own dimenisions. Based on how I'm interpreting your post, I shouldn't be overriding measure at all, and move my child-position code into invalidateDisplayList()? It's working fine now, but I hate doing things the wrong way ;-) I tell you what, I'd sell my left nut for some flow charts of how a well behaved complex component behaves, showing when invalidateXXX() is flagged, and what determines whether or not things are invalidated. Does anything that detailed exist? Would people out there find it useful if I take a few hours to work on a preliminary one over the weekend? I know there's a few lifecycle of a component articles, but I'm thinking of something more verbose. -J On Wed, May 14, 2008 at 1:58 PM, Alex Harui [EMAIL PROTECTED] wrote: Measure() is called on Canvas as well because a Canvas's measuredWidth/Height are dictated by the position and size of its children. You should always measure your children in the measure() method, and position them in updateDisplayList. Anything you do in creationComplete can cause something to be invalidated and cause another pass of commitProperties/measure/updateDisplayList. I'm not sure what you mean by attached to invalidateDisplayList. It is possible to create invalidation loops where by the time we finish validating, something is invalidated again. -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Josh McDonald *Sent:* Tuesday, May 13, 2008 5:54 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Quick question - who calls UIComponent.measure()? If it's in a container that uses a LayoutManager (not Canvas IIRC), and if the component in question isn't of a fixed size. If you need to measure and position stuff in a component that's not always of a fluid size, you need to move your code into another method, and call it both from measure() and on CreationComplete and whenever you add a component. I'm not sure if it could be attached to invalidateDisplayList somehow, in case you do something that triggers an endless loop ;-) It's something I'll look into when I have more time, as I'm doing all my component adding in createChildren() and haven't had to deal with post CreationComplete changes. Alex, please correct me if I'm wrong in there somewhere, too! -J On Wed, May 14, 2008 at 10:18 AM, Mansour Raad [EMAIL PROTECTED] wrote: Question - is it part of the lifecycle of the component ? Mansour :-) -Original Message- From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com on behalf of Alex Harui Sent: Tue 5/13/2008 8:07 PM To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: RE: [flexcoders] Quick question - who calls UIComponent.measure()? It is called by LayoutManager via validateSize() From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com [mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 4:33 PM To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: [flexcoders] Quick question - who calls UIComponent.measure()? Hey guys, Since UIComponent.measure() is protected, does the container invoke it via a round-about way, or is it simply called from a ResizeEvent.RESIZE handler somewhere in UIComponent? -J -- Therefore, send not to know
[flexcoders] Quick Question List XMLList
Hello Everyone, I have a list bound to a XMLList and I delete an element from the list and it wouldn't automatically refresh the list So I reset the dataprovider doing something like this delete(tvMaster.userList[i]); tvMaster.masterObject.userDispList.dataProvider = tvMaster.userList; I am just checking if there is a more efficient way to do this. -Christopher
RE: [flexcoders] Quick Question List XMLList
XMLList methods, like Array(), do not dispatch the events necessary to automaticlly update the UI. Wrap the XMLList in and XMLListCollection, then use the XMLListCollectionAPI to modify the dataProvider. var xlData:XMLList = myXML.children(); //or whatever e4x expression _xlcDataProvider = new XMLListCollection(xlData); //this var is an instance var typed as XMLListCollection and the list dataProvider is bound to it. xlcDataProvider.removeItemAt(i); //will update the UI without re-assigning the dataProvider, avoiding a full refresh. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Christopher Olsen Sent: Thursday, October 04, 2007 9:51 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Quick Question List XMLList Hello Everyone, I have a list bound to a XMLList and I delete an element from the list and it wouldn't automatically refresh the list So I reset the dataprovider doing something like this delete(tvMaster.userList[i]); tvMaster.masterObject.userDispList.dataProvider = tvMaster.userList; I am just checking if there is a more efficient way to do this. -Christopher
[flexcoders] Quick Question
Hello, Quick question may sound a bit silly But if I include a .as file in my project it can't directly reference variables in the mxml file that's imported it... this.parent.variable doesn't seem to work either... is there a special way to reference parents objects? -Christopher
Re: [flexcoders] Quick Question
On Thursday 24 May 2007, Christopher Olsen wrote: Quick question may sound a bit silly But if I include a .as file in my project it can't directly reference variables in the mxml file that's imported it... You need to either have both the AS and MXML include a common place to store variables (like Cairngorm's ModelLocator), or have the MXML set properties in the AS class. -- Tom Chiverton Helping to adaptively transform out-of-the-box designs on: http://thefalken.livejournal.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com. -- 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/ * 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] Quick Question
Tom, Thanks... I'm a bit new to AS... But I'll tell you one thing... It's a very different way to program compared to what I'm used to... It's not a simple transition from c/c++ -Christopher Tom Chiverton wrote: On Thursday 24 May 2007, Christopher Olsen wrote: Quick question may sound a bit silly But if I include a .as file in my project it can't directly reference variables in the mxml file that's imported it... You need to either have both the AS and MXML include a common place to store variables (like Cairngorm's ModelLocator), or have the MXML set properties in the AS class.
RE: [flexcoders] Quick Question
merely importing doesnt makes the mxml the parent of the .as class. u'd need an object of the .as class in the mxml to call it via .Parent.Variable it would work that way. Best Regards, Nikhil Tuli. Fidelity Business Services India Pvt. Ltd., 7th Floor, Tower D, Uni TechWorld, Sector 39, Gurgaon - 122 001. Phone (India) : +91 124 283 3209 Phone (US): 8 804 4395 il n'y a rien tel que noir ou blanc, toutes sont différentes dégradés de gris Any comments or statements made in this email are not necessarily those of Fidelity Business Services India Pvt. Ltd. or any of the Fidelity Investments group companies. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you have received this in error, please contact the sender and delete the material from any computer. All e-mails sent from or to Fidelity Business Services India Pvt. Ltd. may be subject to our monitoring procedures. _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Christopher Olsen Sent: Thursday, May 24, 2007 5:53 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Quick Question Hello, Quick question may sound a bit silly But if I include a .as file in my project it can't directly reference variables in the mxml file that's imported it... this.parent.variable doesn't seem to work either... is there a special way to reference parents objects? -Christopher
Re: [flexcoders] Quick Question
On Thursday 24 May 2007, Christopher Olsen wrote: It's not a simple transition from c/c++ Oh, no, not at all. import != include - there is an include that does what you want though. Must be nice not having to care about pointers or malloc() though, right ? -- Tom Chiverton Helping to ensure a[i] != i[a] on: http://thefalken.livejournal.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com. -- 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/ * 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] Quick Question
Yes a little easier to keep organized... Over time I'll get a little more rounded with AS Are you familiar with modules? Tom Chiverton wrote: On Thursday 24 May 2007, Christopher Olsen wrote: It's not a simple transition from c/c++ Oh, no, not at all. import != include - there is an include that does what you want though. Must be nice not having to care about pointers or malloc() though, right ?
Re: [flexcoders] Quick Question
On Thursday 24 May 2007, Christopher Olsen wrote: Are you familiar with modules? As in ModuleManager ? Not really. I played with the feature when it was introduced, so I have it in the tool box so to speak, but not used it in anger. -- Tom Chiverton Helping to synergistically supply bricks-and-clicks content on: http://thefalken.livejournal.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com. -- 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/ * 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] Quick Question: Conditional Operator ?:
The difference you point out is the only difference. The trinary operator (?:) is an operator so it can be used in expressions (it evaluates to something). if/else is control flow and thus does not evaluate to anything nor can it be used inside of an expression. For certain situations, it can make the code easier to read and more compact than a control flow statement. It could possibly make the generated code faster if only because the byte code is simpler or more compact (more cache coherent). But I can't imagine it'd make a huge difference. Personally, I prefer it for the situations you mentioned... whenever I see if x return y else return z I always think, could this be more concisely written with the trinary operator? The place I most often use it, though, is in initialization of variables passed into function parameters, e.g. this.x = (x) ? x : 0; will set this.x to x if x is valid (not null, not undefined) otherwise it'll set it to zero. I'm sure its not an accident that it almost reads like a sentence with a question mark... ;-) Troy. On 2/27/07, camlinaeizerous [EMAIL PROTECTED] wrote: I know using ?: does the same thing as if else but is there an actual benefit of one over the other besides a difference in typing a few characters? Not that I would go through all my code an chance one to the other just curious if someone knows. something really simple for example return (a==b)?Yes:No vs if(a==b) {return Yes} else {return No}
[flexcoders] Quick Question: Conditional Operator ?:
I know using ?: does the same thing as if else but is there an actual benefit of one over the other besides a difference in typing a few characters? Not that I would go through all my code an chance one to the other just curious if someone knows. something really simple for example return (a==b)?Yes:No vs if(a==b) {return Yes} else {return No}
Re: [flexcoders] Quick Question
- Original Message - From: Kumar To: flexcoders@yahoogroups.com Sent: Tuesday, February 20, 2007 7:35 AM Subject: [flexcoders] Quick Question Hi All, Just a quick one guys just had a little confusion in two statements below First: mx:Button x=23 y=242 label=Button click=myFunction() / This is just calling myFynction() in response to the button click. Second: mx:Button x=23 y=242 label=Button click={myFunction()} / Here, you have the same as above, but you are (for some reason) trying to wrap the function call in a binding which is having no effect in this context, so the effect is the same. Perhaps some research on Flex binding will help. Paul Both Buttons give the same result. Just a bit confused.
Re: [flexcoders] Quick Question
As far as I remember someone once told me... :) When you write: mx:Button x=23 y=242 label=Button click={myFunction()} / or mx:Button x=23 y=242 label=Button click={foo = bar;} / the event handler (function) is generated dynamically. So writing mx:Button x=23 y=242 label=Button click={myFunction()} / means that some method will be generated by compiler and it will call myFunction(). If you don't use braces myFunction used for handling event and no additional function is generated. Am I right? R. On 2/20/07, Paul Andrews [EMAIL PROTECTED] wrote: - Original Message - *From:* Kumar [EMAIL PROTECTED] *To:* flexcoders@yahoogroups.com *Sent:* Tuesday, February 20, 2007 7:35 AM *Subject:* [flexcoders] Quick Question Hi All, Just a quick one guys just had a little confusion in two statements below First: mx:Button x=23 y=242 label=Button click=myFunction() / This is just calling myFynction() in response to the button click. Second: mx:Button x=23 y=242 label=Button click={myFunction()} / Here, you have the same as above, but you are (for some reason) trying to wrap the function call in a binding which is having no effect in this context, so the effect is the same. Perhaps some research on Flex binding will help. Paul Both Buttons give the same result… Just a bit confused…
Re: [flexcoders] Quick Question
There's no point in having binding braces, in either example. Paul - Original Message - From: Roman Protsiuk To: flexcoders@yahoogroups.com Sent: Tuesday, February 20, 2007 9:36 AM Subject: Re: [flexcoders] Quick Question As far as I remember someone once told me... :) When you write: mx:Button x=23 y=242 label=Button click={myFunction()} / or mx:Button x=23 y=242 label=Button click={foo = bar;} / the event handler (function) is generated dynamically. So writing mx:Button x=23 y=242 label=Button click={myFunction()} / means that some method will be generated by compiler and it will call myFunction(). If you don't use braces myFunction used for handling event and no additional function is generated. Am I right? R. On 2/20/07, Paul Andrews [EMAIL PROTECTED] wrote: - Original Message - From: Kumar To: flexcoders@yahoogroups.com Sent: Tuesday, February 20, 2007 7:35 AM Subject: [flexcoders] Quick Question Hi All, Just a quick one guys just had a little confusion in two statements below First: mx:Button x=23 y=242 label=Button click=myFunction() / This is just calling myFynction() in response to the button click. Second: mx:Button x=23 y=242 label=Button click={myFunction()} / Here, you have the same as above, but you are (for some reason) trying to wrap the function call in a binding which is having no effect in this context, so the effect is the same. Perhaps some research on Flex binding will help. Paul Both Buttons give the same result… Just a bit confused…
[flexcoders] Quick Question
Hi All, Just a quick one guys just had a little confusion in two statements below First: mx:Button x=23 y=242 label=Button click=myFunction() / Second: mx:Button x=23 y=242 label=Button click={myFunction()} / Both Buttons give the same result. Just a bit confused.
RE: [flexcoders] Quick question I can't find the answer too.
As in you want to capture when the dataProvider has been set so you can adjust the size? What are you binding the dataProvider to? If it's a service result you could just use the result event handler to set the size. The binding will fire before the result handler is called. Otherwise you could extend the DataGrid and override the setDataProvider method: function setDataProvider(dP : Object) : Void { super.setDataProvider(dP); //do width stuff } Matt -Original Message- From: soulpositions [mailto:[EMAIL PROTECTED] Sent: Friday, April 30, 2004 12:50 PM To: [EMAIL PROTECTED] Subject: [flexcoders] Quick question I can't find the answer too. Hey guys/ladies, Looking for some quick help. I've got a demoflex app i'm working on and I'm trying to capture the databinding event for a datagrid so I can dynamically grow the datagrid. Anyone have any ideas? Thanks, Jason