apache-flex

How to do Flex date deduction and addition

左心房为你撑大大i 提交于 2019-12-22 04:36:09
问题 In flex, I am trying to do date deduction and addition, but couldn't find a way to do it. e.g.: public var dateNow:Date=new Date(); How can I get the Date 3 months earlier than dateNow? Thanks!!! 回答1: You can use the Date constructor for this. The first argument to Date's constructor takes either a year or a timestamp. You can use the Date.time property to get the timestamp from a date object. Once you have the timestamp you can add/subtract some number of seconds from it, and then pass it to

inner class in AS

岁酱吖の 提交于 2019-12-22 01:58:38
问题 for example: package{ public class A { var test:String; public function A() } } class B{ } the code is in the same file, we call B is inner class, then how to call the constructor of class B 回答1: package { public class A { var test:String; public function A() { var b:B = new B(); } } } class B { public function B() { trace('class B'); } } 来源: https://stackoverflow.com/questions/3594013/inner-class-in-as

Disable Flex CSS type selector warning?

江枫思渺然 提交于 2019-12-22 01:57:39
问题 I'm building a somewhat large Flex project that includes several modules (a single Flex project that produces multiple SWFs) Right now, I have a single css file, being loaded in the main SWF tag: <s:Application ... > <fx:Style source="css/main.css" /> ... </s:Application> In the CSS file: /* CSS file */ @namespace s "library://ns.adobe.com/flex/spark"; s|Panel { skinClass: ClassReference("com.skins.DefaultPanelSkin"); } s|Button { skinClass: ClassReference("com.skins.DefaultButtonSkin"); }

clone flex component

不问归期 提交于 2019-12-22 01:01:00
问题 I am trying to duplicate a flex component at run time. For example if i have this mx:Button label="btn" id="btn" click="handleClick(event)"/> i should be able to call a function called DuplicateComponent() and it should return me a UI component thts exactly same as above button including the event listeners with it. Can some one help me please?? Thanks in advance 回答1: Do a Byte Array Copy. This code segment should do it for you: // ActionScript file import flash.utils.ByteArray; private

Assigning an array of objects to a DataGrid

大憨熊 提交于 2019-12-22 00:59:33
问题 When the dataProvider for an DataGrid is an array of objects, how do I set each column's dataField to a property of the object. I have an ArrayCollection (say a) where each item is an object For example a[i] = data:Object Where the object data has some subproperties - data.name , data.title , data.content etc. I have a DataGrid in which I want to display this data. So I put: <mx:DataGrid id="entries" dataProvider="{resultRSS}"> <mx:columns> <mx:Array> <mx:DataGridColumn headerText="Title"

Dynamically Creating Flex Components In ActionScript

你说的曾经没有我的故事 提交于 2019-12-22 00:15:24
问题 Isn't there some way to re-write the following code, such that I don't need a gigantic switch statement with every conceivable type? Also, if I can replace the switch statement with some way to dynamically create new controls, then I can make the code smaller, more direct, and don't have to anticipate the possibility of custom control types. Before: <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> <mx:Script> <![CDATA[

Adding mouseOver/mouseDown/mouseUp/etc. to custom MXML component

╄→гoц情女王★ 提交于 2019-12-21 22:03:46
问题 I'm new to Flex and am porting a pure Flash/AS3 app to Flex 4.5 I've created a custom MXML component based on BorderContainer <?xml version="1.0" encoding="utf-8"?> <s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="160" height="140" > <s:Image id="_avatar" enableLoadingState="true" x="0" y="0" width="160" height="120" /> <s:Label id="_username" x="0" y="125" fontSize="12" fontWeight="bold" /

FlashDevelop - training materials, tutorials, books (Flex/Flash development without FlexBuilder) [closed]

给你一囗甜甜゛ 提交于 2019-12-21 21:49:43
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I want to start Flash/Flex/ActionScript development and got lost with the technologies, documentation and tools available. Searches pointed me to Adobe FlexBuilder and Adobe Flash (Designer, CS3, CS4). Then, I found FlashDevelop, learned that Flex SDK and compilers are free. Also, you can make a complete Flash

How can I draw dotted line in flex

℡╲_俬逩灬. 提交于 2019-12-21 20:47:57
问题 After some search and reading the Graphics class document, I can't find a way to specify the line style of a line. I mean whether the line is a solid one or a dotted one. Could anybody help me? Thanks! 回答1: Well there is no Dashed or Dotted line in flex. However, you can create your own line or border: http://cookbooks.adobe.com/post_Creating_a_dashed_line_custom_border_with_dash_and-13286.html Try and enjoy! 回答2: You can't, well, not just by using Flex library classes anyway. You can do it

Flex/Actionscript White to Transparent

狂风中的少年 提交于 2019-12-21 20:35:08
问题 I am trying to write something in my Flex 3 application with actionscript that will take an image and when a user clicks a button, it will strip out all the white(ish) pixels and convert them to transparent, I say white(ish) because I have tried exactly white, but I get a lot of artifacts around the edges. I have gotten somewhat close using the following code: targetBitmapData.threshold(sourceBitmapData, sourceBitmapData.rect, new Point(0,0), ">=", 0xFFf7f0f2, 0x00FFFFFF, 0xFFFFFFFF, true);