flex3

How to protect swf file from being decompiled?

一世执手 提交于 2019-12-23 15:46:27
问题 I'm working on important project using Flex framework and i want to keep my algorithms and code secret. Is it possible to somehow protect swf file from being decompiled? I don't want someone extract my code using flash decompilers. Thanks. 回答1: While there is no full-proof way to secure code from decompilers there are some tricks to reduce the chances of this happening. host the .swf on a https server then it doesnt get cached You can obfuscate the code to make it impossible to understand

Calculating Dictionary length in Flex

元气小坏坏 提交于 2019-12-23 08:56:44
问题 What's the best way to calculate the length of a Dictionary object in Flex? var d:Dictionary = new Dictionary(); d["a"] = "alpha"; d["b"] = "beta"; I want to check the length which should be 2 for this Dictionary. Is there any way to do it other than looping through the objects? 回答1: No, there is no way to check the length of an object(Dictionary is pretty much an object that supports non-String keys) other than looping through the elements. http://www.flexer.info/2008/07/31/how-to-find-an

Flex Timer example

老子叫甜甜 提交于 2019-12-23 05:33:05
问题 I am trying to use timer in flex. I referred to this example : Timer : blog.flexexamples.com. Here is what I want to achieve: I want to start the timer, showing minutes elapsed since timer started. It should be independent of the region you are in.( irrespective of whatever zone you are in, timer should work fine in every zone). Timer should continue, unless some button is clicked, where I want to show the time elapsed in minutes, in an Alert Box and then timer should start again from 0

Flex Timer example

孤街浪徒 提交于 2019-12-23 05:33:04
问题 I am trying to use timer in flex. I referred to this example : Timer : blog.flexexamples.com. Here is what I want to achieve: I want to start the timer, showing minutes elapsed since timer started. It should be independent of the region you are in.( irrespective of whatever zone you are in, timer should work fine in every zone). Timer should continue, unless some button is clicked, where I want to show the time elapsed in minutes, in an Alert Box and then timer should start again from 0

Send objects from flex to java servlet

老子叫甜甜 提交于 2019-12-23 05:15:39
问题 This is my method in actionscript var urlVars : URLVariables = new URLVariables(); urlVars.myname = byteArr; var urlReq : URLRequest = new URLRequest('MyServlet'); urlReq.data = urlVars; urlReq.method = 'post'; navigateToURL(urlReq, '_blank'); How do I recieve the byte array on servlet ? Also the byteArr above comes from java side, byte[] byteArr = aMethodWhichReturnsaPDFByteArray(); HttpServletResponse response = FlexContext.getHttpResponse(); ServletOutputStream os = null; try { response

flex 3 component using x y as center, not topleft

三世轮回 提交于 2019-12-23 03:06:42
问题 How can I extend components like buttons to use x and y value as the center of the component, not the top left? 回答1: It's pretty easy in Flex 4 :). They have a transformAround method in the UIComponent, that allows you to transform the position/scale/rotation of a component around any arbitrary pivot. So you could do this: override public function set x(value:Number):void { var pivot:Vector3D = new Vector3D(this.width/2, this.height/2, 0); var translation:Vector3D = new Vector3D(value, this.y

Find the total bytes used by a bitmap in Flex

淺唱寂寞╮ 提交于 2019-12-22 14:52:22
问题 If I load a bitmap using a loader in Flex, I can use the loaderInfo.bytesTotal to get the size, total bytes used, of a bitmap. If I create a bitmap in run time, how can I find out the size, the total bytes used, by that bitmap. Please advice. Thanks 回答1: var bitmapByteSize:int = bitmap.bitmapData.getPixels(bitmap.bitmapData.rect).length; That might do the trick. 回答2: I think a better solution than the one above would be: var bitmapByteSize:uint = bitmap.bitmapData.width * bitmap.bitmapData

Find the total bytes used by a bitmap in Flex

拜拜、爱过 提交于 2019-12-22 14:51:33
问题 If I load a bitmap using a loader in Flex, I can use the loaderInfo.bytesTotal to get the size, total bytes used, of a bitmap. If I create a bitmap in run time, how can I find out the size, the total bytes used, by that bitmap. Please advice. Thanks 回答1: var bitmapByteSize:int = bitmap.bitmapData.getPixels(bitmap.bitmapData.rect).length; That might do the trick. 回答2: I think a better solution than the one above would be: var bitmapByteSize:uint = bitmap.bitmapData.width * bitmap.bitmapData

Flex ModuleLoader component causing memory leak. How can I unload Modules properly?

戏子无情 提交于 2019-12-22 09:03:06
问题 The application is too big to describe here, but I can tell you I have up to 20 modules or more that the client can use at any time. And if I go on loading screen after screen, my application can ocuppy 500MB and more. The script that I use to load and unload modules is: public function createModule(modulo:String):void { if(moduleLoader != null){ moduleLoader.unloadModule(); //moduleLoader.url = null; moduleLoader.url = "com/oss/facturable/components/" + modulo + "?version=" + model.configXML

Flex - Custom Component - Percentage Width/Height

心不动则不痛 提交于 2019-12-22 08:26:13
问题 I am trying to create a Custom Flex Component using the Flex Component framework: http://www.adobe.com/livedocs/flex/3/html/help.html?content=ascomponents_advanced_3.html. All good components allow you to define their dimensions using percentage values using: MXML: TextInput width="100%" or Actionscript at runtime: textinp.percentWidth = 100; My question is how do you implement percentage width/height in the measure() method of your custom component? More specifically, these percentages are