apache-flex

How can I have HTML5 FileApi Support in Flex?

人走茶凉 提交于 2019-12-24 11:34:13
问题 I need Flex code to support HTML5 File API. Because I need to support File API feature for those browsers that did not support File API. Do you have any code or link? Thanks in advance... 回答1: I a few things to say. First most of the Flash File API is AIR only, so will not work in a browser based application. FileReference will work in a browser app, but depends on what you're trying to do explicitly. To communicate between JavaScript and ActionScript; you can use ExternalInterface. You can

singleton class in Flex

孤街醉人 提交于 2019-12-24 11:22:07
问题 I know singleton class is not supporting in Flex.Because it does not access private constructor. But i want to make a class is singleton class. Please anyone can explain with example. Thanks, Ravi 回答1: A singleton is a class of which only one instance will be created. This instance will be shared by all other code in the program. A singleton in the strictest sense is not supported in ActionScript because a constructor cannot be marked private . Consequently, additional instances of the class

How can I catch the fontSize change event?

懵懂的女人 提交于 2019-12-24 10:58:19
问题 I am writing a skin for a TextInput control, and I want it to change when the fontSize style changes dynamically. I see this is done in the default TextInputSkin but couldn't decipher the behavior form the code. How is this done? thanks, 回答1: override fontSize setter, and dispatch a CHANGE event there. 来源: https://stackoverflow.com/questions/3692094/how-can-i-catch-the-fontsize-change-event

Transitioning from FlexBuilder 3 to FlashBuilder 4 … there and back again

淺唱寂寞╮ 提交于 2019-12-24 10:57:55
问题 It's growing pains time again. Some of our stuff requires FlashBuilder 4 and some still requires FlexBuilder 3. Both are installed OK, and no projects use both IDEs. The trouble is, when I go back to work on a FlexBuilder 3 project it takes freakin' forever to build and I get weird errors like these: This doesn't seem to cause any identifiable problems except to throw up a modal dialog at various points in the build process, forcing user interaction. But I do notice that memory fills up fast

Get a static property from class in actionscript

旧巷老猫 提交于 2019-12-24 10:49:15
问题 I have this class package somePackage { public class SomeClass { public static const FOO: SomeClass = new SomeClass("0"); public static const BAR: SomeClass = new SomeClass("1"); } } I want to be able to get those static property given it's name. Example: public static function getProperty(propertyName: String): SomeClass { //don't know what goes here } var property1:SomeClass = SomeClass.getProperty("FOO"); // property1 == SomeClass.FOO var property2:SomeClass = SomeClass.getProperty("BAR");

how to keep a nativewindow on top

懵懂的女人 提交于 2019-12-24 10:49:03
问题 I need to keep a NativeWindow I am creating on top of the main window of the application. Currently I am using alwaysInFront = true, which is not limited to the windows in the application. I can successfully synchronize the minimize/restore/move/resize actions, so the top window behaves appropriately in those cases. Even though using this option has the drawback that if I alt-tab to other application the window goes on top of the other application. Because of the above I am trying to get it

How to restrict a Flex application to only run from my website?

人盡茶涼 提交于 2019-12-24 10:47:56
问题 is it possible to make a Flex-application to only run from my domain? So a user can't copy the .swf and start it locally. 回答1: In a lot of cases this won't work because of the security model associated with the crossdomain.xml. http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html Say for example, I have a flex app that has a service call and login to my backend database (perhaps PHP and mysql). Unless I explicitly enable it in crossdomain.xml policy file the app will not be

Flex: Custom Item Renderer For Combobox controls truncates text

偶尔善良 提交于 2019-12-24 10:31:25
问题 I've implemented a custom item renderer that I'm using with a combobox on a flex project I'm working on. It displays and icon and some text for each item. The only problem is that when the text is long the width of the menu is not being adjusted properly and the text is being truncated when displayed. I've tried tweaking all of the obvious properties to alleviate this problem but have not had any success. Does anyone know how to make the combobox menu width scale appropriately to whatever

Export flex chart and datagrid to excel

扶醉桌前 提交于 2019-12-24 09:59:15
问题 I need to export a pie chart and a datagrid in flex 4.5 to Microsoft Excel format. I was able to export the datagrid using as3xls. But it doesn't allow to export any chart or even add an image to excel file. Can anyone recommend me a way of doing this? 回答1: As far as I know there is no way to export a chart to Excel by means of existing libraries. I would like to suggest you one specific way to do it. We all well know that current Office files are stored as collections of XML structures. The

ExternalInterface.addCallback fails in local environment

浪子不回头ぞ 提交于 2019-12-24 09:59:00
问题 I thought this question would answer my question, but I have applied the following fixes: .as Security.allowDomain("*"); Security.allowInsecureDomain("*"); .html param name="allowScriptAccess" value="always" /> .js params.allowscriptaccess = "always"; And I am still seeing the ExternalInterface.addCallback method fail locally. It works on a web server, or in the dev folder . But not in an arbitrary local folder. 回答1: Add as a trusted location the folder where your swf/html reside. Right click