Re: [flexcoders] Re: tree multiple select problem
Yes, if selectedIDs is a big array, it could take a while to do run the loop. You could try building up a hash table of ids Var hashIDs:Object = new Object; For (var i:int = 0; I N; i++) hashIDs[selectedIds[i].toString()) = 1; Then query once: var nodes:XMLList = xml.descendants().(hashIDs[@id] == 1) Then copy all the nodes into the final array.. That is more looping, but fewer XML queries and XML queries is usually way slower. Your mileage may vary. -Alex On 8/5/11 10:09 PM, steveroger_flex steveroger_f...@yahoo.com wrote: Thank you Alex. Its really great help. I have do one change. I used var node:XML = xml.descendants().(@id == id)[0]; in place of var node:XML = xml..node(@id == id)[0]; multiple selection is working perfectly. But will this change affect to my application performance? Steve. --- In flexcoders@yahoogroups.com, Alex Harui aharui@... wrote: SelectedItems must be an array. If you have: Var xml:XML = node name=Node 1 id=1 node name=Node 1.1 id=2 / node name=Node 1.2 id=3 node name=Node 1.2.1 id=4 / node name=Node 1.2.2 id=5 / /node /node Var selectedIds:Array = [2, 4, 5]; Then you need something like: Var selItems:Array = new Array(); For (var i:int = 0; I n; i+++ { ! var id:String = selectedIds[i].toString(); var node:XML = xml..node(@id == id)[0]; selItems.push(node); } Then assign selItems to the selectedItems. On 8/5/11 1:12 AM, steveroger_flex steveroger_flex@... wrote: Thanks alex for reply.. but actually I do not getting how it implemented. Can you please provide me any similar kind of example? Is it possible using XMLList? Steve --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: You will have to make a new array of the nodes you want selected. On 8/4/11 9:45 PM, steveroger_flex steveroger_flex@ wrote: I am hav! ing list of nodes in array. My problem is how sho! uld I us e seletedItems with list of node id array.? Data provider of tree component. node name=Node 1 id=1 node name=Node 1.1 id=2 / node name=Node 1.2 id=3 node name=Node 1.2.1 id=4 / node name=Node 1.2.2 id=5 / /node /node Node id Array=(2,4,5). I wanna select Node 1.1, Node 1.2.1 Node 1.2.2 by clicking on button. tree.selectedItems = array; is not working. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: Use selectedItems On 8/4/11 5:08 AM, steveroger_flex stever! oger_flex@ wrote: Hello Friends, I am facing a problem and can't getting any idea to solve this. Problem is, I wanna select one or more tree nodes using actionscript. I have set allowMultipleSelection=true property of tree component. I succeed in selecting one node. But can't in multiple. I had used tree.selectedItem for single node. any idea to solve this? Thanks, Steve. -- Alex Harui Flex SDK Team Adobe System, Inc. ht! tp://blogs.adobe.com/aharui ! ; -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] Interface design
Hello, I have to select 4 values of percentages. The sum of this 4 values should be equal to 100%. How to design an interface (with sliders or other), to select this 4 percentages ? Thank you, Christophe
Re: [flexcoders] Interface design
On 07/08/2011 06:12, cjacquel73 wrote: Hello, I have to select 4 values of percentages. The sum of this 4 values should be equal to 100%. How to design an interface (with sliders or other), to select this 4 percentages ? Have a bar with three dividers. The bar represents 100%. The space between dividers and the edges represents a percentage. Drag the divider bars to set the percentages. or, Have four entryfields. When they don't total 100 colour the background red and mark them as invalid, or, .. Thank you, Christophe -- 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
[flexcoders] Error TooTips in Spark Forms
What I'm discovering about Spark Forms is that error messaging is inside the form item container and unless I make the form large enough to accommodate the error message I might see some unexpected layout issues such as the error text appearing over the form element, etc. Pretty darned ugly. What I'd prefer is to have the error tips appear over the form and not be constrained by the form dimensions. It appears that the only option I have is to roll my own solution using skins and ToolTipManager, etc. I'm prepared to dig in to do this but I just wanted to make sure that I wasn't missing a more straightforward solution. Jeff Battershall Application Architect T 609 520 5637 F 609 520 5370 C 484 477 9900 jeff.battersh...@djindexes.commailto:jeff.battersh...@djindexes.com Dow Jones Indexes 4300 Route 1 North South Brunswick, NJ 08852 www.djindexes.comhttp://www.cmegroup.com/
Re: [flexcoders] Preventing Spark List from scrolling to top when adding / removing items.
See if this will work, // your code var index:int = list.selectedIndex; list.dataProvider.addItem(item); list.validateNow(); moveToIndex(index); protected function moveToIndex(index:int):void { var point:Point = list.layout.getScrollPositionDeltaToElement(index); if (point) { list.scroller.viewport.horizontalScrollPosition = point.x; } } let me know if it works for you On Wed, Aug 3, 2011 at 2:27 PM, vigilsolace sig...@orianmarx.com wrote: ** Any time I add or remove an item from a Spark list, the list resets itself to display the first element at the top. Is there a way to get the list to remember its current location? For example if I'm scrolled half way down a list and remove an item I would like the list to remain scrolled to where it was, rather than resetting. I'm currently listening for change events on the dataprovider and capturing the list layout's lastIndexInView, then using ensureIndexIsVisible to restore that index after the next display update. However, this still results in the list jumping around quite a bit. Is there a better solution? Shouldn't the list handle this by default?
Re: [flexcoders] Error TooTips in Spark Forms
Hi Jeff, Since I've been working on mobile I don't have much room either. I use a label for error messages with includeInLayout and visible set to false and place it inside the FormItem container. If it's a vertical form item then the error label shows up beneath the form item. If it's horizontal layout I need to put both the form item and the error label in a VGroup. This allows the form to flow when error messages are visible. On Sun, Aug 7, 2011 at 8:21 AM, Battershall, Jeff jeff.battersh...@djindexes.com wrote: ** What I’m discovering about Spark Forms is that error messaging is inside the form item container and unless I make the form large enough to accommodate the error message I might see some unexpected layout issues such as the error text appearing over the form element, etc. Pretty darned ugly. ** ** What I’d prefer is to have the error tips appear over the form and not be constrained by the form dimensions. It appears that the only option I have is to roll my own solution using skins and ToolTipManager, etc. I’m prepared to dig in to do this but I just wanted to make sure that I wasn’t missing a more straightforward solution. ** ** * * *Jeff Battershall* Application Architect T 609 520 5637 F 609 520 5370 C 484 477 9900 *jeff.battersh...@djindexes.com* *Dow Jones Indexes* 4300 Route 1 North South Brunswick, NJ 08852 www.djindexes.com http://www.cmegroup.com/
[flexcoders] Newbie Question: Library Path for Using a 3rd-party utility
I'm new to Flex, I've been reading the Adobe Training from the Source book, but am stuck on a simple setup question. I want to integrate SQLite, and figured I'd use probinson's sqlite utilities (https://github.com/probertson/air-sqlite) to manage the connections. My question is where do I download this set of utilities so that I can incorporate them into other projects? I'm modifying the test application FlexGrocer to store the inventory locally rather than via the web, but I don't want to copy the files into the FlexGrocer/src directory, but probably somewhere else that can be more easily used by other projects. I suspect there's a path I need to set somewhere for where to look for the libraries, and then I can just use import com.probertson.data.QueuedStatement; import com.probertson.data.SQLRunner; In the Project Properties, there's an option for adding a source path -- should I use that? Or import the swc file that's available from git? If I do this, how can I then apply these settings to my project, is that something I need to do manually each time I set up a new project? Thanks, sorry for such basic questions! Tac
Re: [flexcoders] Newbie Question: Library Path for Using a 3rd-party utility
Hi Tac, First setup your library project. Then go back to your original project and go into Properties Flex Build Path and click Add Project. A dialog will display available library projects for you to choose. Select your new library and click OK. The workspace will rebuild if it doesn't click Project Clean. From now on your original project will be able to access classes in your library project. Note you may need to open the library project when working in your main project. On Sun, Aug 7, 2011 at 6:59 AM, tacman1123 tac...@gmail.com wrote: ** I'm new to Flex, I've been reading the Adobe Training from the Source book, but am stuck on a simple setup question. I want to integrate SQLite, and figured I'd use probinson's sqlite utilities (https://github.com/probertson/air-sqlite) to manage the connections. My question is where do I download this set of utilities so that I can incorporate them into other projects? I'm modifying the test application FlexGrocer to store the inventory locally rather than via the web, but I don't want to copy the files into the FlexGrocer/src directory, but probably somewhere else that can be more easily used by other projects. I suspect there's a path I need to set somewhere for where to look for the libraries, and then I can just use import com.probertson.data.QueuedStatement; import com.probertson.data.SQLRunner; In the Project Properties, there's an option for adding a source path -- should I use that? Or import the swc file that's available from git? If I do this, how can I then apply these settings to my project, is that something I need to do manually each time I set up a new project? Thanks, sorry for such basic questions! Tac
Re: [flexcoders] Newbie Question: Library Path for Using a 3rd-party utility
BTW Welcome to Flex! :) On Sun, Aug 7, 2011 at 6:59 AM, tacman1123 tac...@gmail.com wrote: ** I'm new to Flex, I've been reading the Adobe Training from the Source book, but am stuck on a simple setup question. I want to integrate SQLite, and figured I'd use probinson's sqlite utilities (https://github.com/probertson/air-sqlite) to manage the connections. My question is where do I download this set of utilities so that I can incorporate them into other projects? I'm modifying the test application FlexGrocer to store the inventory locally rather than via the web, but I don't want to copy the files into the FlexGrocer/src directory, but probably somewhere else that can be more easily used by other projects. I suspect there's a path I need to set somewhere for where to look for the libraries, and then I can just use import com.probertson.data.QueuedStatement; import com.probertson.data.SQLRunner; In the Project Properties, there's an option for adding a source path -- should I use that? Or import the swc file that's available from git? If I do this, how can I then apply these settings to my project, is that something I need to do manually each time I set up a new project? Thanks, sorry for such basic questions! Tac
[flexcoders] Flex 4.5 debugging issue
I am upgrading my projects from Flex 3 to Flashbuilder 4.5. The final swfs are part of a bigger web site that requires authentication. In Flex 3, I could open a IE browser window, log in, leave that window open, then when I debugged an SWF, it opened a new browser window but the authentication that created in the other window was valid for my debugging session. In FB 4.5, it looks like my authentication is lost which makes debugging very difficult or impossible. The authentication is stored in cookies in the browser, any ideas?
[flexcoders] Could AIR create an automation app?
Does AIR have enough hooks to the os to create an automation app? Programs like Automate and WinAutomation script mouse position and clicks to control an app's gui, and Automate automatically recognizes menus and buttons etc if the app to be controlled conforms to something - not sure what. I really need the power of actionscript to control a widget intensive music gui. TIA, Mic.