Re: [flexcoders] Capturing an event in a separate component
Thanks Alex. I was able to do this only by using the code-behind technique from labs.adobe.com, but at least it works! On 26 Mar 2007 11:22:17 -0700, Alex Harui [EMAIL PROTECTED] wrote: Make sure you set the bubbles=true when you construct the Event object. The parent should be able to listen to itself and still see it. parent.as class ParentComponent { public function ParentComponent() { addEventListener(bubbler, bubblerEventHandler); } } child3.as class Child3 { private function doSomething():void { var event:Event = new Event(bubbler, true); dispatchEvent(event); } } -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Marlon Moyer *Sent:* Monday, March 26, 2007 9:26 AM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Capturing an event in a separate component Given this scenario: Parent Componet Child1 Child2 (child of Child1) Child3 (child of Child3) and Child3 dispatches an event, how can I make the parent see that event without having to pass it up between each child? I've made the event bubble, but I can't seem to make the parent see it. I can't seem to get the syntax for the addEventListener correct. Thanks -- I walk the shore in isolation, While at my feet eternity, Draws ever sweeter plans for me.
[flexcoders] Capturing an event in a separate component
Given this scenario: Parent Componet Child1 Child2 (child of Child1) Child3 (child of Child3) and Child3 dispatches an event, how can I make the parent see that event without having to pass it up between each child? I've made the event bubble, but I can't seem to make the parent see it. I can't seem to get the syntax for the addEventListener correct. Thanks
[flexcoders] Defer a databinding update
I've got an xml document that I've finally figured out exactly how to databind every element. (I don't get the element is not an IEventDispatcher error ! :) ) The problem is now that when, for example, you're on tab 3 line 5 and you input a value, Flex needs to redraw everything on the screen and loses the tab focus. You stay on the correct tab, but there's a noticeable pause while it redraws and the focus indicator goes away. Is there any way to defer this, or even halt it until you specifically call it? Thanks
[flexcoders] Re: Initializing components in views
Nevermind, I was editing the wrong component file :( creationcomplete on the base component in the view works fine. On 1/26/07, Marlon Moyer [EMAIL PROTECTED] wrote: I've got a component, a simple form, that I need to figure out how to clear out the contents between uses. The first time the view is activated, the fields are clear. The second time the view in activated, the old values are prefilled. What event do I need to tie into so that the form is cleared every time it's activated? Thanks Marlon
[flexcoders] Initializing components in views
I've got a component, a simple form, that I need to figure out how to clear out the contents between uses. The first time the view is activated, the fields are clear. The second time the view in activated, the old values are prefilled. What event do I need to tie into so that the form is cleared every time it's activated? Thanks Marlon
Re: [flexcoders] Re: Is there a way to find an object if you know the name
believe me, I've tried to attack this problem from a number of ways :)here's the quick description:My form design:Policy 1: accordionDivision 1: accordionState 1: TabVBox Code 1: text inputCode 2: text inputCode 3: text inputAdd Code: button/VBoxState 2: TabVBoxCode 1: text inputCode 2: text input /VboxState 3: TabDivision 2: accordionState 1: tabState 2: tab .etcThis is directly created from an XML doc read in the e4x format. I've got the code working so that I'm able to add code via the button in the state tab. Whendebugging,Icanseethatthevbox'srepeateritemnowreflectsthechangedXML,butthescreenisnotredrawntoreflectthenewlineforthecode. My first plan was to just reset the dataProvider for the the entire form. Bad idea, it causes the whole form to redraw and loses the current location within the form. My next plan was to reference the vbox's repeater and reset it's dataProvider to be mine XML snippet. So far no go :( My next planistotrytofigureouthowtocreateadatamodelforadynamicxmldocument.Ifigurethisisgoingtobejustassuccessfulasthefirsttwoplans.:) MarlonOn 10/17/06, Tracy Spratt [EMAIL PROTECTED] wrote: Yes, you should probably back up a little and think about what you are trying to do. Directly accessing elements of data-driven controls is usually a bad idea, mainly because the controls re-use the visual elements when you scroll. Tracy From: [EMAIL PROTECTED]ups.com [mailto: flexcoders@yahoogroups.com] On Behalf Of Michael LabriolaSent: Monday, October 16, 2006 8:19 PM To: [EMAIL PROTECTED]ups.comSubject: [flexcoders] Re: Is there a way to find an object if you know the name ..one more note.. You may want to also check out Referencing repeated child components in the help docs, which is specifically about components within a repeater. --Mike --- In flexcoders@yahoogroups.com , Marlon Moyer [EMAIL PROTECTED] wrote: sorry, I didn't phrase the question correctly. I have the name of a component in a string variable (e.g. I've named a component 'name=repeater_state_{divisionRepeater.currentItem.id}) and now I want to be able to refer to that component dynamically. On 10/16/06, Gordon Smith [EMAIL PROTECTED] wrote: You simply refer to components by their id. You don't have to look them up by it. For example, if you have MyApp.mxml: mx:Application mx::Canvas id=c1 mx:Button id=b1 ... then in the Application's mx:Script methods you can write expressions like b1.label. Technically, what is happening is that the MXML compiler autogenerates var c1:Canvas; var b1:Button; as instance vars of a MyApp class which extends Application. The methods you write in the mx:Script become methods of this MyApp class, so they can acess these instance vars. To access components inside components, you simply use the dot operator. - Gordon -- *From:* flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] *On Behalf Of *Marlon Moyer *Sent:* Sunday, October 15, 2006 7:03 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Is there a way to find an object if you know the name What's the equivalent of _javascript_'s getElementById in Flex? I've searched the help files numerous times and can't seem to find it. Thanks -- Marlon -- Marlon -- Marlon __._,_.___ -- 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 Software development tool Software development Software development services Home design software Software development company Your email settings: Individual Email|Traditional Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___
Re: [flexcoders] Is there a way to find an object if you know the name
sorry, I didn't phrase the question correctly. I have the name of a component in a string variable (e.g. I've named a component 'name=repeater_state_{divisionRepeater.currentItem.id }) and now I want to be able to refer to that component dynamically. On 10/16/06, Gordon Smith [EMAIL PROTECTED] wrote: You simply refer to components by their id. You don't have to look them up by it. For example, if you have MyApp.mxml: mx:Application mx::Canvas id=c1 mx:Button id=b1 ... then in the Application's mx:Script methods you can write expressions like b1.label. Technically, what is happening is that the MXML compiler autogenerates var c1:Canvas; var b1:Button; as instance vars of a MyApp class which extends Application. The methods you write in the mx:Script become methods of this MyApp class, so they can acess these instance vars. To access components inside components, you simply use the dot operator. - Gordon From: [EMAIL PROTECTED]ups.com [mailto: flexcoders@yahoogroups.com] On Behalf Of Marlon Moyer Sent: Sunday, October 15, 2006 7:03 PM To: [EMAIL PROTECTED]ups.com Subject: [flexcoders] Is there a way to find an object if you know the name What's the equivalent of _javascript_'s getElementById in Flex? I've searched the help files numerous times and can't seem to find it. Thanks -- Marlon -- Marlon __._,_.___ -- 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 Software development tool Software development Software development services Home design software Software development company Your email settings: Individual Email|Traditional Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___
[flexcoders] Is there a way to find an object if you know the name
What's the equivalent of javascript's getElementById in Flex? I've searched the help files numerous times and can't seem to find it. Thanks -- Marlon -- 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/
[flexcoders] Am I expecting too much from data binding?
I've got an xml file that I read in as e4x format and create an interface from using repeaters. The interface looks like this: Accordion - Policy Accordion - Division TabNavigator - State Repeating Rows of classcodes Button to add a class code to the current state I've got the logic written so that once the button is pushed, a class code is added in the correct section of the xml document. This alone will not spark a change in the interface. I explicitly have to reset the value of the top databinding variable (an xmllistcollection) to a new xmllistcollection based on the e4x xml variable. This has the nasty side effect of resetting the interface to accordion 0, accordion 0, tab 0. Is this the way it works, or am I missing something Thanks -- Marlon -- 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/
[flexcoders] warnings on XML binding.
I'm trying to figure out why I get a ton of warnings when using databinding to an XML variable. Here's the pertinent snippets of code below. mx:HTTPService url=assets/payroll.xml resultFormat=e4x id=payrollXML result=payrollXMLHandler(event)/ private function payrollXMLHandler(event:ResultEvent):void { payrollXMLVar = event.result as XML; wcPayroll = new XMLListCollection(payrollXMLVar.policy.(@type.toString()=='wc')); } As soon as the 'wcPayroll = new XMLListCollection...' line runs, I get these warnings in the FB2 console. warning: unable to bind to property 'type' on class 'XML' (class is not an IEventDispatcher) warning: unable to bind to property 'name' on class 'XML' (class is not an IEventDispatcher) warning: unable to bind to property 'type' on class 'XML' (class is not an IEventDispatcher) warning: unable to bind to property 'name' on class 'XML' (class is not an IEventDispatcher) I get more as the tabs, repeaters, and accordions render also. I think a side effect of this is that additions of nodes to the underlying XML object are not reflected in the UI. Unless I explicitly set wcPayroll = new XMLListCollection again, I will not see the changes. Of course, if I set that again, I lose the current location in my tab navigator. Help! Thanks! -- Marlon -- 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] Fwd: Pre selecting a combo box
Thanks Shannon, that did the trick. It looks relatively familiar to the way you do it with _javascript_. I really thought there would be an easier way to do it. I guess you could extend the component to include a method that would do that same thing though. On 8/8/06, Shannon Hicks [EMAIL PROTECTED] wrote: It's hard when you haven't done it before :) Here's what your code should basically look like:for (var i:number=0;imyComboBox.dataProvider.length ;i++) { if (userObject.companyID == myComboBox.dataProvider.getItemAt(i).data) { myComboBox.selectedIndex = i; break; }} ShanFrom: [EMAIL PROTECTED] ups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Marlon Moyer Sent: Tuesday, August 08, 2006 7:09 PMTo: [EMAIL PROTECTED]ups.comSubject: [flexcoders] Fwd: Pre selecting a combo box I've got a master detail form that works so far except for a combo box that's giving me fits. The combo box is populated from an xml file that contains a company id and company name relabeled with the label and data headers. The combo box populates correctly and I've verified that it returns the correct company id. Now, for existing users, I want the combo box to automatically go to the correct company they're assigned to. The user object has a company id. I don't believe that I can do it with binding since it's expecting a selectedIndex vs a selected data value. I've been experimenting around with trying to loop through the objects in the combobox, but I haven't had any luck doing so yet. Is it really this hard? -- Marlon-- Marlon--No virus found in this incoming message. Checked by AVG Free Edition.Version: 7.1.405 / Virus Database: 268.10.7/411 - Release Date: 8/7/2006-- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.10.7/411 - Release Date: 8/7/2006 -- Marlon __._,_.___ -- 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. __,_._,___
[flexcoders] Fwd: Pre selecting a combo box
I've got a master detail form that works so far except for a combo box that's giving me fits. The combo box is populated from an xml file that contains a company id and company name relabeled with the label and data headers. The combo box populates correctly and I've verified that it returns the correct company id. Now, for existing users, I want the combo box to automatically go to the correct company they're assigned to. The user object has a company id. I don't believe that I can do it with binding since it's expecting a selectedIndex vs a selected data value. I've been experimenting around with trying to loop through the objects in the combobox, but I haven't had any luck doing so yet. Is it really this hard? -- Marlon -- Marlon __._,_.___ -- 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. __,_._,___