[flexcoders] XMLList refrence problem
I have this... mx:XMLList id=types type name=Non Member/ type name=Member/ type name=Instructor/ type name=Administrator/ /mx:XMLList With a datagrid with this in... mx:itemRenderer mx:Component mx:Label text={data.usrstatus}/ /mx:Component /mx:itemRenderer What do I put in the {} to get: Non-Member to show up for data.usrstatus == 0 Member to show up for data.usrstatus == 1 etc. Its been driving me crazy! - Stephen
Re: [Spam] RE: [flexcoders] mx:ControlBar horizontalAlign=right - doesn'twork?
This is a bit old but i had the same problem again and it's quite easy to fix by setting the width of the controlBar :-) mx:ControlBar horizontalAlign=right *width=100%* mx:Button label=Cancel enabled=true click={viewStackSearch. selectedIndex = 0;} / /mx:ControlBar Thanks to my work colleague Gilles! :) 2009/10/6 Nick Middleweek n...@middleweek.co.uk It just stays left aligned... that's odd... Could there be anything that is over riding it? Thanks, Nick 2009/10/5 Alex Harui aha...@adobe.com Works for me. What did you see? Alex Harui Flex SDK Developer Adobe Systems Inc. http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui
[flexcoders] Re: Technique to tell the filterFunction to chill for a sec before going into eff
Actually, this is a non-issue. The visual activity isn't as bad as I thought if I just set the filterfunction to null while I'm doing my editing of the value object. --- In flexcoders@yahoogroups.com, steveb805 quantumcheese...@... wrote: I have a filter function for a List that hides the item if the duedate is larger than a particular number. In a function I call, to change a value object field, as soon as I hit this line below, the filter goes into effect (which is expected since duedate is the field specified in the filter) projectListAC[projectList.selectedIndex].duedate = tempDateNumber; and hides the item, and the selectedIndex goes to -1. (projectListAC is the dp) If I temporarily set filterFunction to null, and then change the duedate, and then set it back to the filter, you get a visual flash of all a sudden a lot of items becoming visible, and then back again. Not really the effect I want. Shouldn't the List only change after calling refresh() on the dataprovider? As soon as i change the List's value object field, the filtering takes place Steve
[flexcoders] Cairngorm store example - newbie binding question #2
Thank you Tracy for answering my previous question. New one: Why is 'handler' bound to 'confirmOrder' in this snippet? util:Observe source={ ShopModelLocator.getInstance().orderConfirmed } handler={ confirmOrder } / confirmOrder is a function in the same file. Is it just a way to set an initial value? Thanks, Norm
RE: [flexcoders] MAC : TextInput focus
Alex, As soon as the application loads up, im getting the login screen(TitlwWindow component) which has got three fields username, password and domain. I'm trying to set the focus to the username field so that user can start typing. The focus is set to username field in IE, Firefox and also in Chrome but not in Safari browser. The weird thing here(in Safari browser) as soon as i click on the application,(ie. somewhere within the browser window) the focus will be set to username field. Is this browser plug-in issue or bug on Flex side ? Thanks, Suman
Re: [flexcoders] How does Button 3 knows that it has been clicked in this example?
Fred: There are multiple ways to listen for events, such as click events. Button 1 and button 2 add the listener inline (click=handleClick(event)) in the MXML markup. For button 3, the author listens for the even using this line: button3.addEventListener(MouseEvent.CLICK, handleClick); It get's called when the app is initialized (initialize=init()) You can delete that line and replace it with the way button 1 and 2 do it if you want, but both do the exact same thing. Thanks! -Pat On Thu, Nov 26, 2009 at 10:06 AM, fred44455 fred44...@yahoo.com wrote: This an example taken out of a Flex 4 book(Amstrong). I pretty understand this code but if you look at button3 at the very end of the code , it has no click(event) associated with it. why is that? Will it be ok to add:click=handleClick(event)/ Like it was done for button2 ?? Thanks. ?xml version=1.0 encoding=utf-8? s:Application xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/halo initialize=init() fx:Script![CDATA[ private function init():void { button3.addEventListener(MouseEvent.CLICK, handleClick); } private function handleClick(event:MouseEvent):void { if (event.target == button2) { label.text += 'Button 2 clicked\n'; } else if (event.target == button3) { label.text += 'Button 3 clicked\n'; } } ]]/fx:Script s:VGroup width=100% s:Button id=button1 label=Button 1 click=label.text += 'Button 1 clicked\n'/ s:Button id=button2 label=Button 2 click=handleClick(event)/ s:Button id=button3 label=Button 3/ s:Label id=label/ /s:VGroup /s:Application
[flexcoders] Counting XML nodes with attributes having specific values (using EX4 perhaps)...
Hello all! I'm creating a charting application in Flex and I have been given XML in the following format... dc r a=x1 b=y1 c=z1 / r a=x1 b=y1 c=z1 / r a=x1 b=y2 c=z2 / r a=x1 b=y2 c=z2 / /dc I need to COUNT the number of nodes/rows that have a value of x1 for attribute a, and say...y2 and y1 for attribute b, etc., so I can aggregate and chart them. Anyone know of an efficient and effective way of doing this in ActionScript 3? Thanks to all in advance! David
RE: [SPAM] [flexcoders] Counting XML nodes with attributes having specific values (using EX4 perhaps)...
The length() of the resultant XML list of the e4x expression will be the count of the nodes found. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of flexfortress Sent: Friday, November 27, 2009 3:39 PM To: flexcoders@yahoogroups.com Subject: [SPAM] [flexcoders] Counting XML nodes with attributes having specific values (using EX4 perhaps)... Hello all! I'm creating a charting application in Flex and I have been given XML in the following format... dc r a=x1 b=y1 c=z1 / r a=x1 b=y1 c=z1 / r a=x1 b=y2 c=z2 / r a=x1 b=y2 c=z2 / /dc I need to COUNT the number of nodes/rows that have a value of x1 for attribute a, and say...y2 and y1 for attribute b, etc., so I can aggregate and chart them. Anyone know of an efficient and effective way of doing this in ActionScript 3? Thanks to all in advance! David
RE: [SPAM] [flexcoders] XMLList refrence problem
Why use an itemRenderer? Looks like a labelFunction would do what you want. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of criptopus Sent: Friday, November 27, 2009 10:33 AM To: flexcoders@yahoogroups.com Subject: [SPAM] [flexcoders] XMLList refrence problem I have this... mx:XMLList id=types type name=Non Member/ type name=Member/ type name=Instructor/ type name=Administrator/ /mx:XMLList With a datagrid with this in... mx:itemRenderer mx:Component mx:Label text={data.usrstatus}/ /mx:Component /mx:itemRenderer What do I put in the {} to get: Non-Member to show up for data.usrstatus == 0 Member to show up for data.usrstatus == 1 etc. Its been driving me crazy! - Stephen
RE: [SPAM] [flexcoders] Multiple Script Files
Another solution to this is to use helper classes, instead of compiling the script block into the component class. I never have more than a single script block in an mxml file, rarely have more than one included script file, and often have none of either. You can use the code-behind technique, or static functions in a separate class, or a normally instantiated helper class. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Dan Pride Sent: Thursday, November 26, 2009 2:41 PM To: flexcoders@yahoogroups.com Subject: [SPAM] [flexcoders] Multiple Script Files A similar question. To simplfy things I have created a script file for each table with the relevant actionscript functions for the table in the file. i.e. mx:Script source=CenterScript.as / mx:Script source=SquareScript.as / mx:Script source=LocaScript.as / etc etc Is this a common way to handle script complexity as an application grows? The app only uses a couple of components so there is a fair bit of actionScript code tied to the main app file. Thanks Dan Pride
RE: [SPAM] RE: [flexcoders] Re: constraintColumns/constraintRows on extended Sprite object REFdn6025643069
The constraints are styles, not properties. So to use constraints in AS, you need to define them in a style sheet, and/or use setStyle(). Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of dennis Sent: Thursday, November 26, 2009 9:48 AM To: flexcoders@yahoogroups.com Subject: [SPAM] RE: [flexcoders] Re: constraintColumns/constraintRows on extended Sprite object REFdn6025643069 Thank you for your reply. I work only with AS, I mean with no MXML. I tried to use the Canvas container but using the mx.containers.Canvas, there is no right property (even top, bottom, left). What do I miss? dennis From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of jamesfin Sent: Wednesday, November 18, 2009 7:01 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: constraintColumns/constraintRows on extended Sprite object REFdn6025643069 You can always do this where the right / top is constraining the item. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. http://www.adobe.com/2006/mxml com/2006/mxml layout=absolute creationComplete=init() mx:Script ![CDATA[ import mx.core.UIComponent; private function init():void{ var spTest:Sprite = new Sprite(); spTest.graphics.beginFill(0xFF); spTest.graphics.drawRect(0, 0, 100, 100); spTest.graphics.endFill(); logo.rawChildren.addChild(spTest); } ]] /mx:Script mx:Canvas width=100 height=100 right=20 top=20 id=logo/ /mx:Application --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, dennis den...@... wrote: Hello people.. I have an extended Sprite object and I put in on the Stage (via addChild). How may I anchor it on runtime on the Stage? How may I constraint it in Columns and Rows? Suppose that I want a Sprite(Panel) object, to be always 20 pixels from right edge of the Stage, even if the Stage resized. Thank in advance. Dennis __ NOD32 4618 (20091118) Information __ This message was checked by NOD32 antivirus system. http://www.eset. http://www.eset.com com
RE: [SPAM] [flexcoders] Multiple Script Files
I have never heard of this before, where could I find out about it (I come from database design not java) Dan Pride --- On Fri, 11/27/09, Tracy Spratt tr...@nts3rd.com wrote: From: Tracy Spratt tr...@nts3rd.com Subject: RE: [SPAM] [flexcoders] Multiple Script Files To: flexcoders@yahoogroups.com Date: Friday, November 27, 2009, 5:21 PM Another solution to this is to use helper classes, instead of compiling the script block into the component class. I never have more than a single script block in an mxml file, rarely have more than one included script file, and often have none of either. You can use the code-behind technique, or static functions in a separate class, or a normally instantiated helper class. Tracy Spratt, Lariat Services, development services available From: flexcod...@yahoogro ups.com [mailto: flexcod...@yahoogro ups.com ] On Behalf Of Dan Pride Sent: Thursday, November 26, 2009 2:41 PM To: flexcod...@yahoogro ups.com Subject: [SPAM] [flexcoders] Multiple Script Files A similar question. To simplfy things I have created a script file for each table with the relevant actionscript functions for the table in the file. i.e. mx:Script source=CenterScrip t.as / mx:Script source=SquareScrip t.as / mx:Script source=LocaScript. as / etc etc Is this a common way to handle script complexity as an application grows? The app only uses a couple of components so there is a fair bit of actionScript code tied to the main app file. Thanks Dan Pride