actionscript

.Net/Flex: How to read partial results from URLRequest?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 07:29:46
问题 I'm working on a batch process script that's executed from Flex. The batch script is in a .aspx Page and returns partial results through the following class: public class ResponseLogger { private HttpResponse _response; public ResponseLogger(HttpResponse response) { this._response = response; } public void Start() { _response.Clear(); _response.ContentType = "text/plain"; _response.ContentEncoding = System.Text.Encoding.GetEncoding("ISO-8859-1"); } public void End() { _response.End(); }

Setting Actionscript Object Keys

Deadly 提交于 2019-12-24 07:13:04
问题 If I have an array, I can set the keys by doing the following: var example:Array = new Array(); example[20] = "500,45"; example[324] = "432,23"; If I want to do something with Objects, how would I achieve this? I tried the following: var example:Object = [{x:500, y:45}, {x:432, y:23}]; // Works but keys are 0 and 1 var example:Object = [20: {x:500, y:45}, 324: {x:432, y:23}]; // Compile errors var example:Object = [20]: {x:500, y:45}, [324]: {x:432, y:23}; // Compile errors var example:Object

Actionscript if / else syntax Question

↘锁芯ラ 提交于 2019-12-24 06:49:37
问题 Which of the following best translates the English statement "If it's rainy, we will watch a movie. Otherwise we will go to the park." a. if (rainy = true) { gotoAndStop ("movie"); } b. if (rainy == true) { gotoAndStop ("movie"); } c. if (rainy = true) { gotoAndStop ("movie"); } else { gotoAndStop ("park"); } d. if (rainy == true) { gotoAndStop ("movie"); } else { gotoAndStop ("park"); } My answer would be "d" - is that correct? 回答1: Yes, 'd' is the correct answer. The difference between =

AS2: Calculate days between two dates

余生颓废 提交于 2019-12-24 06:35:33
问题 I use this script currently to determine the difference between two dates: // Slide_Tracker[?].date_int are results from the built in function getTime() var current_date = new Date(Slide_Tracker[i].date_int); var past_date:Date = new Date(Slide_Tracker[i - 1].date_int); var date_diff:Number = Math.round((current_date - past_date) / 86400000); The problem with this is I want to monitor the actual physical day change so if someone accessed the application at 11:59 PM and then came back 5

Problem with handling keyboard events inside a Canvas using Flex

匆匆过客 提交于 2019-12-24 06:04:29
问题 For some reason, the event listener I define never seems to receive any events, although I believe it should. Here's a very short description of the MXML code I'm using: WindowedApplication VBox (root box) MenuBar TabNavigator VBox (first tab) Canvas VBox (second tab) If I add a listener for KEY_DOWN events to WindowedApplication or the root VBox, the handler receives the events just fine. But if I add the listener to the Canvas or the first tab VBox, the handler never seems to receive any.

Flex: DataGrid column formatting of numbers

老子叫甜甜 提交于 2019-12-24 05:26:09
问题 I'm trying to format some numbers in a column of a DataGrid. I'm getting an error in my simplified test program below when I run it. All the examples I've seen so far have column data that are strings. Is there a way to do it using numbers? How to modify the code below to format the checking values? <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"> <fx:Script> <

How to show AdMob ads (iOs and Android) through Actionscript in Flash CC

喜夏-厌秋 提交于 2019-12-24 03:32:38
问题 I am creating a flash game in Actionscript 3 and Flash CC. I intend to publish the game for iOs and Android. I am looking for a way to show AdMob ads in Actionscript. So far I have done those steps but no ads appear anywhere on screen: I have downloaded admob_all_in_one6.6.7.ane from here. I added the ane to my build path. I use the code below when the game is starting, before anything else: import so.cuo.platform.admob.Admob; import so.cuo.platform.admob.AdmobPosition; import so.cuo.platform

Get angle from matrix

和自甴很熟 提交于 2019-12-24 03:27:19
问题 I know a matrix [x scale, y skew, x skew, y scale, trans x, trans y], and would like to get the angle in degrees. thanks! 回答1: Consider the following matrix | x_sc y_sk 0 | | x_sk y_sc 0 | | x_tr y_tr 1 | with sk indicating skew, sc indicating scale and tr indicating translation. This only represents a pure rotation if all three are true y_sk == -x_sk y_sc == x_sc x_sc * y_sc - x_sk * y_sk == 1 In this case, if theta is the angle of rotation, then theta == arcos(x_sc) This will give you the

Download/Save/Write a file on the client's hard disk using flash/flex

自古美人都是妖i 提交于 2019-12-24 01:44:07
问题 I wonder how can I download/save/write a file from my server to a client's computer using flash or flex. An example of what I'm looking for is avilable on http://www.flexdownloads.com Sign up Sign in Click on the ("FREE") button placed on the right of the page. (the orange button) Choose any product (won't cost you anything) Press "BUY NOW" then you'll see a confirmation popup for the download, then you choose where do you want to save the file, and the flash movie saves the file! 回答1: Use

ActionScript 2 vs ActionScript 3 performance

天涯浪子 提交于 2019-12-24 00:47:34
问题 Any benchmarks of Integer, Array, Function, Class, etc, performance in these 2 languages (compilers)? Comparisons would also be helpful. 回答1: Since AS3 runs in a different virtual machine (AVM2) than AS2 (AVM) there have been made significant performance improvements with the introduction of AS3. In general, opcode executed by AVM2 runs about 10x faster than similar opcode running in the old AVM. This of course does not mean that everything in AS3 is 10x times faster than with AS2. With the