apache-flex

How to use line breaks in Flex with PHP string

你离开我真会死。 提交于 2020-01-04 09:57:07
问题 This is the MXML I have <mx:Text id="name" styleName="textStyle" maxWidth="400"></mx:Text> Then in the same file I have : <mx:Script> <![CDATA[ private function init():void { name.text = data.string; } ]]> </mx:Script> data.string comes from the DB and it contains this : "This is a string \n with two lines." I also tried this : "This is a string with two lines." None of them create a new line in flex they are both rendered to the screen as \n and . How can I create a new line with a

Converting Hierarchical Data to XML in Flex

谁说胖子不能爱 提交于 2020-01-04 09:21:55
问题 How to convert a flat/hierarchical data to XML format in Flex. The following is my Hierarchical Data:(Table format) Asia India Chennai TN Category1 Product1 100 Asia India Mumbai MH Category1 Product1 100 Asia India Calcutta CT Category1 Product1 100 Asia India Calcutta CT Category2 Product2 200 EMEA UK London LN Category3 Product1 123 EMEA UK London LN Category3 Product2 455 EMEA UK Reading RN Category1 Product1 500 EMEA UK Reading RN Category1 Product2 430 I need to format/convert this to

Serialize circular object networks using writeObject / readObject

怎甘沉沦 提交于 2020-01-04 07:35:10
问题 I'm about to implement public function writeExternal( output:IDataOutput ):void {...} public function readExternal( input:IDataInput ):void {...} to make a set of object serializable. Although I'm pretty sure, that I implemented all correctly, readExternal(..) at a certain point complains about too few data left to read: RangeError: Error #2006: The supplied index is out of bounds. at flash.filesystem::FileStream/readObject() I wonder, if I have a circular object network like A = { left -> B,

C# / ActionScript with AxShockwaveFlash

让人想犯罪 __ 提交于 2020-01-04 05:54:09
问题 I am new to ActionScript and am trying to communicate between AS and C#. Every tutorial/explanation I find seems to be exactly the same, but I simply cannot get it to work. callFunction throws a COM exception ("E_FAIL"), and when I try calling ExternalInterface.call() from the AS, it never seems to. I've gotten this to work in JavaScript/HTML, but I'm out of ideas for C#; I suspect I'm doing something wrong/not allowed in my AS. I compile the AS file with Adobe Flex 4.6 and mxmlc. Edit: Just

Parse string pattern into Date in Flex

☆樱花仙子☆ 提交于 2020-01-04 05:27:30
问题 Is there some way in flex to parse strings to date. I want it to support custom formats similar to 'dateformatter'. Using 'dateformatter' class we can parse date object in various string formats as specified by 'formatString property'. I want it other way round, from string to date. The parse method 'Date.parse(my_string)' does string parsing but for a very limited set of formats. Can't we have something similar to following, where user can specify his/her own formats. someformatter

Using ASDoc with Bindable metatag and mxml

瘦欲@ 提交于 2020-01-04 05:24:33
问题 I am creating the documentation of my flex project using ASDoc and having some issues with the bindable metatag. ASDoc doesn't document public Bindable values unless the Bindable tag has an event name associated with it. For example: //This is documented correctly [Bindable("someEvent")] /* * public bindable with event name * */ public var test1:String; //This is not documented at all [Bindable] /* * public bindable without event name * */ public var test2:String; ASDoc prepends random

Complex Maven2 with Flex4 Setup

五迷三道 提交于 2020-01-04 02:43:08
问题 I have been struggling to get Maven2 to cooperate with me, and was wondering if anyone out there had any ideas on how to get this working.... I am working on a Flash project, and we are considering switching from our hybrid Flex4/FlashCS4 to a pure Flex4 solution. We would like to use the Maven2 build system, so that our developers do not have to manually download, install, and configure Flex4 on their machines. I have managed to create a single-module project using Maven2 with Flex4 (I am

open local files in AS3

╄→гoц情女王★ 提交于 2020-01-04 02:35:10
问题 How do i open file and get its content as a ByteArray in AS3. I saw examples, using FileStream & File classes from flex.filesystem, but the doc says it's for AIR only. Thanks, Nava 回答1: You can try either URLLoader with content set for binary, or use URLStream. What do you need to load ? 回答2: You can use a FileReference object to browse for a file and then access the raw bytes via the "data" property on the FileReference when the "complete" event is dispatched. 回答3: Flex security prevents

How to use out-of-datagrid scope variable inside an ItemRenderer?

末鹿安然 提交于 2020-01-04 01:39:27
问题 I'm binding an array of items to a data grid using ItemRenderer . I use the data variable to control the bindable data. I also have someComponentVariable that need be inserted into every row but its declared at the component scope, so the data grid doesn't seem to reconize it (compile error). How can I use this variable ( someComponentVariable ) inside the ItemRenderer ? Code Example <mx:DataGrid id="userBonusesGrid" width="100" height="248" showHeaders="false" wordWrap="true"> <mx:columns>

Force all item renderers to commitProperties?

安稳与你 提交于 2020-01-03 20:44:41
问题 I have an item renderer that checks an external source for display information. If that information changes, I want to force all item renderer instances to check it. What's the best way for force all the item renderers in a list or grid to either commitProperties or execute some other method? I've read that resetting the grid.itemRenderer property will make them all initialize. I've also received the suggestion to iterate recursively through all the grid's children and call