apache-flex

Load JSON Faster in Flex 4

心不动则不痛 提交于 2019-12-18 08:59:13
问题 I have a Flex application,I am loading a JSON file with more than 40,000 items. Does Flex provide a way to load this file faster? 回答1: Target Flash Player 11 and use the new native JSON parse: var obj:Object = JSON.parse( value ); http://www.skyript.com/2011/07/json-parsingencoding-with-native-parser.html 来源: https://stackoverflow.com/questions/7816784/load-json-faster-in-flex-4

URLRequest/URLLoader auto-converting POST request to GET

依然范特西╮ 提交于 2019-12-18 08:31:38
问题 When I execute the following code: var urlRequest:URLRequest = new URLRequest("http://somehost/with/some/path?andsomequerystring=true"); urlRequest.method = 'POST'; var urlLoader:URLLoader = new URLLoader(urlRequest); urlLoader.addEventListener(Event.COMPLETE, function(event:Event):void{ trace('sweet'); }); It turns my explicit POST request to GET due to the presence of the querystring. If I remove the querystring (and serialize as part of the POST body), it successfully makes the

how to work registerClassAlias() method for custom mxml components

微笑、不失礼 提交于 2019-12-18 07:14:31
问题 I have flex mxml custom component(Graphic).According to requirement a need to copy them as copy or cut operation.but problem in the registerClassAlias() method,how it will work for custom graphic or Group(or UIComponents) components. var className:String = getQualifiedClassName(zorder.getItemAt(0)); _saveIn.clear(); registerClassAlias(className, zorder.getItemAt(0) as Class); _saveIn = SharedObject.getLocal("save"); _saveIn.data.value1 = new ByteArray(); _saveIn.data.value1.writeObject(zorder

Flex 3 DataGrid Column Width Problem

廉价感情. 提交于 2019-12-18 07:06:59
问题 I'm pulling xml data to determine which columns are visible, and the widths of each column. My datagrid's width can change sinces its on one side of a HDividedBox. The visibility part works, but setting the width is causing headaches. Heres the code: for(loop through column data retrieve from XML) { newData[i] = dg.columns[Number(columnsOrder[i]) - 1]; newData[i].visible = (Number(columnsVisibility[i]) == 1); newData[i].width = Number(columnsWidth[i]); trace(newData[i].headerText + " w:" +

Scrollbars in dropdownlist inside DataGrid itemEditor not working

旧巷老猫 提交于 2019-12-18 07:02:33
问题 I have a DropDownList inside the itemEditor of my DataGrid. There are enough items in the DropDownList to justify scrollbars. You can see the scrollbars, and the mousewheel works fine. If you move the mouse over the scrollbars, they'll change appearance fine (mouseover is working). If you click on them, the DropDownList closes as if you'd clicked elsewhere in the data grid. There's a comment on the Adobe Forums that describe the same problem, but it is fairly old and has not been answered. I

Date to String <-> String to Date

筅森魡賤 提交于 2019-12-18 05:55:31
问题 I get a Date of my database and I need to show it as a String. So in Flex I do this: public static function dateToString(cDate:Date):String { return cDate.date.toString()+"."+ cDate.month.toString()+"."+ cDate.fullYear.toString()+" "+ cDate.hours.toString()+":"+ cDate.minutes.toString()+":"+ cDate.seconds.toString(); } But I get for example the result: 13.7.2010 0:0:15 How can I fill the day, month, hours, minutes, seconds with padded 0? And, I go back from String to Date with: DateField

Flex: replace all spaces with comma

两盒软妹~` 提交于 2019-12-18 05:45:34
问题 im new with regexp, so can i ask for some assistance Using string.replace function what code that can replace spaces with comma Input:The quick brown fox jumps over the lazy dog. Output:The,quick,brown,fox,jumps,over,the,lazy dog. Thanks 回答1: Like this: str = str.replace(/ /g, ','); Here's a better one which will replace all strings of whitespace: str = str.replace(/\s+/g, ','); 来源: https://stackoverflow.com/questions/2504863/flex-replace-all-spaces-with-comma

Get the current logged in OS user in Adobe Air

北城以北 提交于 2019-12-18 05:43:43
问题 I need the name of the current logged in user in my Air/Flex application. The application will only be deployed on Windows machines. I think I could attain this by regexing the User directory, but am open to other ways. 回答1: There's a couple of small cleanups you can make... package { import flash.filesystem.File; public class UserUtil { public static function get currentOSUser():String { var userDir:String = File.userDirectory.nativePath; var userName:String = userDir.substr(userDir

Embedding Flash / Flex component into Java app

醉酒当歌 提交于 2019-12-18 05:15:09
问题 I'm working on some Flex spike in my company. We are basically evaluating different scenarios etc. What solution would you recommend for embedding Flex components into Java app? Flex <-> Java communication is not (yet...) an issue, just embedding swf into JFrame. 回答1: I've done it with EasyJCom. It's pretty straight forward as long as you're using one of the standard Java windowing libraries (Swing, awt). You can see an example (From the EZJCom site) here: http://www.ezjcom.com/FlashTest.java

Best way to get the color where a mouse was clicked in AS3

别等时光非礼了梦想. 提交于 2019-12-18 04:44:07
问题 I have an image (mx) and i want to get the uint of the pixel that was clicked. Any ideas? 回答1: Here's an even simpler implementation. All you do is take a snapshot of the stage using the draw() method of bitmapData, then use getPixel() on the pixel under the mouse. The advantage of this is that you can sample anything that's been drawn to the stage, not just a given bitmap. import flash.display.Bitmap; import flash.display.BitmapData; import flash.events.*; stage.addEventListener(MouseEvent