flex3

Get URL of current page from Flex 3?

南笙酒味 提交于 2019-12-01 02:32:54
问题 How do I determine the URL of the current page from within Flex? 回答1: Using ExternalInterface ( flash.external.ExternalInterface ), you can execute Javascript in the browser. Knowing this, you can call ExternalInterface.call("window.location.href.toString"); to get the current URL (note that this will be the page url and not the .swf url). hth Koen 回答2: Let's be clear here. 1. If you want the URL of the loaded SWF file, then use one of these. Inside your application: this.url; From anywhere

ActionScript code to convert bytes to kb, mb, gb etc

不问归期 提交于 2019-11-30 21:07:22
I have a utility function that will display a filesize in an appropriate form like Windows Explorer does, i.e; convert it to nearest KB, MB, GB etc. I wanted to know if the code that i wrote is correct, and if it can be made simpler. The function that i wrote is as follows : public static function formatFileSize(bytes:int):String { if(bytes < 1024) return bytes + " bytes"; else { bytes /= 1024; if(bytes < 1024) return bytes + " Kb"; else { bytes /= 1024; if(bytes < 1024) return bytes + " Mb"; else { bytes /= 1024; if(bytes < 1024) return bytes + " Gb"; } } } return String(bytes); } While it

Adobe AIR Keyboard Hook

柔情痞子 提交于 2019-11-30 16:22:35
I'm trying to add a feature to my AIR app that can listen for (configurable) global keyboard events even when the app is minimized. Ex: CTRL-ALT-SHIFT-F12 to grab a screenshot. I can't find any way to register a keyboard hook, and listening for keyboard events only captures them when the app has focus. Suggestions? I don't think that Adobe Air programs can process keypress events unless the application is in focus. http://forums.adobe.com/thread/420446 Even this question regarding a Global handler for keypresses states that the application must be in focus. Try hooking onto the stage's

Adobe AIR Keyboard Hook

…衆ロ難τιáo~ 提交于 2019-11-30 00:13:43
问题 I'm trying to add a feature to my AIR app that can listen for (configurable) global keyboard events even when the app is minimized. Ex: CTRL-ALT-SHIFT-F12 to grab a screenshot. I can't find any way to register a keyboard hook, and listening for keyboard events only captures them when the app has focus. Suggestions? 回答1: I don't think that Adobe Air programs can process keypress events unless the application is in focus. http://forums.adobe.com/thread/420446 Even this question regarding a

Flex 3 file download - Without URLRequest

扶醉桌前 提交于 2019-11-29 17:28:11
My Flex client app has got some data from the back end (RemoteObjects, BlazeDS, Spring). Client has got all the data it needs, it now needs to put some information in a CSV format and make it available for download. Using Flex 3 for this. Any ideas? Thanks, Sri If you are compiling for Flash Player 10 then you can call the FileReference.save() function to save to the local file-system: http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/flash/net/FileReference.html#save() Just make sure you take note of this section: In Flash Player, you can only call this method successfully

Error migrating Flex 3 to Flex 4

☆樱花仙子☆ 提交于 2019-11-29 11:24:38
I imported my Flex 3 project to Flex 4 and removed all the errors and warnings listed in Flex 4 problem windows. I am having the following error in Flex 4 when launching my application. What could be the cause of this? Error: Compatibility version has already been read. at mx.core::FlexVersion$/set compatibilityVersion()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\FlexVersion.as:254] at mx.core::FlexVersion$/set compatibilityVersionString()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\FlexVersion.as:301] at _Screen1Module_mx_core_FlexModuleFactory() Experts, please help me on

How can I make datagrid height is equal to data content in Adobe Flex

梦想与她 提交于 2019-11-29 10:42:40
In adobe Flex datagrid height is equally to fix height . I want to make datagrid height is depend data . You can set each row of the datagrid to fit based on the contents of a particular column of that row by setting the "variableRowHeight" attribute to true on the datagrid and setting the "wordWrap" attribute to true on the dataGridColumn that will contain the variable height content. I don't quite understand your question but if you are asking how to size the DataGrid to the number of rows in the dataProvider, you can try: dataGrid.rowCount = yourCollection.length; or <mx:DataGrid rowCount="

Fastest way to delete one entry from the middle of Array()

假装没事ソ 提交于 2019-11-29 01:13:59
What is the fastest way to delete one specific entry from the middle of Array() Array is large one having Strings. I dont want just to set Array[5] = null, but instead array size should be reduced by one and array[5] should have content of array[6] etc. Don't have any benchmarks to support this, but one would assume that the native Array.splice method would be the fastest... So, to remove the entry at index 5: array.splice(5, 1); If you don't care about the order of the items in the array (but just want it to get 1 shorter) you can copy the last element of the array to the index to be deleted,

Flex 3 file download - Without URLRequest

青春壹個敷衍的年華 提交于 2019-11-28 12:08:57
问题 My Flex client app has got some data from the back end (RemoteObjects, BlazeDS, Spring). Client has got all the data it needs, it now needs to put some information in a CSV format and make it available for download. Using Flex 3 for this. Any ideas? Thanks, Sri 回答1: If you are compiling for Flash Player 10 then you can call the FileReference.save() function to save to the local file-system: http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/flash/net/FileReference.html#save()

ADD COLUMN to sqlite db IF NOT EXISTS - flex/air sqlite?

时光毁灭记忆、已成空白 提交于 2019-11-28 07:40:47
I've got a flex/air app I've been working on, it uses a local sqlite database that is created on the initial application start. I've added some features to the application and in the process I had to add a new field to one of the database tables. My questions is how to I go about getting the application to create one new field that is located in a table that already exists? this is a the line that creates the table stmt.text = "CREATE TABLE IF NOT EXISTS tbl_status ("+"status_id INTEGER PRIMARY KEY AUTOINCREMENT,"+" status_status TEXT)"; And now I'd like to add a status_default field. thanks!