flex3

How to sort an ArrayCollection in Flex

戏子无情 提交于 2020-01-02 03:53:06
问题 I want to sort an Arraycollection by fieldName as ascending. Here's my code and I want to know whether it's right. Do you have any suggestions? public static function arrayCollectionSort(ar:ArrayCollection, fieldName:String, isNumeric:Boolean):void {var dataSortField:SortField = new SortField(); dataSortField.name = fieldName; dataSortField.numeric = isNumeric; var numericDataSort:Sort = new Sort(); numericDataSort.fields = [dataSortField]; arrCol.sort = numericDataSort; arrCol.refresh();}

Pass data between flex components

淺唱寂寞╮ 提交于 2020-01-01 03:39:09
问题 I'm new to flex , so forgive me if this is a dumb question. Right now I'm using custom events to pass data from one component to another. My problem is that events only bubble up. How can I pass data to a component that isn't a parent of the component dispatching the event? Here's the basic layout. I'm trying to get data from component 1 passed to component 3. Application MXML Component 1 Component 2 Component 3 回答1: If a piece of data is required by all components in a graph/tree, your best

xml nodes will not delete despite calling “delete”

南楼画角 提交于 2019-12-30 14:50:13
问题 I'm trying to use the delete keyword to remove nodes from an xml file and it just plain won't work. Here's a stripped down example of what I'm working with. Every node has a child named "deleteme". If its value is equal to 1 I want to remove it from the xml file. If its anything else I want to leave it be. The delete method is deffinately gettig call but it's having no effect. <?xml version="1.0" encoding="utf-8"?> <stuff> <i> <deleteme> 0 </deleteme> </i> <i> <deleteme> 1 </deleteme> </i> <i

How to decode Json using native JSON or actionjson in Flex 3

痞子三分冷 提交于 2019-12-28 12:45:22
问题 I have the below Json (wf.json) { "workflow":{ "template":"Analysis1", "start":{ "instance":"HDA_run1", "user":"symtest", "date":"3-Mar-2012", "timestamp":"1330948220475" }, "host":{ "name":"bartla", "user":"symtest1", "password":"symtest1", "installpath":"", "product":"" }, "javadump":{ "pid":"8989", "corefilename":"", "heapdump":"", "stack":"", "JAVA_HOME":"" }, "mat":{ }, "email":{ "to":"ars@gmail.com", "subject":"", "message":"" }, "end":{ } } } As you can see there are 7 items (or sub

Need the example to use custom component in FLEX application

混江龙づ霸主 提交于 2019-12-25 08:18:21
问题 I want to know that how to create a CustomComponent and how to use that in FLEX Application. Give me just a simple example, i have little bit of knowledge is there so i can understand if u just give me the code. I am using FLEX 3.0 Thanks in advance. 回答1: Nice to see you again. Formatted Stepper.as package component { import flash.events.Event; import flash.events.FocusEvent; import flash.events.MouseEvent; import mx.controls.NumericStepper; import mx.core.mx_internal; import mx.events

Unable to change the column width dynamically in flex datagrid

一笑奈何 提交于 2019-12-25 05:09:22
问题 It's very very frustrating. I am using a singleton class (popup, which means it doesn't forget the last used variables) which contains a datagrid. I am making various columns visible/invisible, setting the widths and headers in accordance to data received from a database call. Everything works fine except that when I put the breakpoints before and after the point where I change width of columns, I do not see the change in width of datagrid at all! Instead I see some values totally out of sync

Modules and Panels issue

只谈情不闲聊 提交于 2019-12-25 04:55:26
问题 I have the following problem. In my application I have several modules and each of them have components CollapsableTitleWindow (extends Panel). After opening the window it is added to the container which is in the main application (CollapsableTitleWindowContainer). In these windows you can open another window (and so on). Now, what is the problem. When I change (reload) any module and I want to open a new window (sub window) with the already loaded window I get this error: TypeError: Error

Create a timeline from date to date in Flex/AS3

江枫思渺然 提交于 2019-12-25 04:39:10
问题 I need to create a timeline between 2 given dates, ie: 2006-01-20 - 2009-02-14 The timeline must be drawn on a given width (can be altered), ie: 600px But I need to add markers, one on year beginning, and others 4 times during the year (each 73 days aprox): Any tips? 回答1: I think the axes in the Flex Charting package allow you to do such formatting by default. If you need to do more, Flex Charts also allow you to draw of them. That might be what you're looking for. Link: http://livedocs.adobe

Access system environment variable in AIR?

牧云@^-^@ 提交于 2019-12-25 03:14:56
问题 How can one access a system environment variable in Flex/AIR (say %appdata%, %userdomain%)? 回答1: There is no API that you can use to get a environment variable in Flex/AIR applications. You will have to pass these as (commandline?) parameters to your application. 来源: https://stackoverflow.com/questions/784490/access-system-environment-variable-in-air

I have RTRIM; how to make LTRIM with regexp

孤人 提交于 2019-12-25 01:47:06
问题 I have RTRIM; how to make LTRIM one? public static function rtrim(string:String):String { return string.replace(/\s+$/,""); } 回答1: Wow, seriously? You're using regular expressions to remove a constant sequence of characters from the ends of a string? Really? I don't know Actionscript/Flex, but this isn't the way to go. After a quick google I found a solution which may or may not be more efficient. 回答2: public static function ltrim(string:String):String { return string.replace(/^\s+/,""); }