actionscript

ActionScript 3 Profiler & Memory Analysis Tool

别等时光非礼了梦想. 提交于 2019-12-10 15:22:26
问题 I'm using Adobe Flash CS 4 and would like to know are there any profiler or memory analysis tools available for it ? (actionscript 3). I know there are available tools for Flex, but are there for Flash CS 4 instead? Thanks. 回答1: I'm sure there is a program out there, still looking myself, but I found this on a forum: Most AS3 beginners have programmed something and then heard about memory leaks. So first I'm going to cover ways to detect and fix leaks in preexisting code, and then talk about

Hebrew/Jewish date conversion

99封情书 提交于 2019-12-10 15:07:14
问题 I would like to convert Gregorian dates (the ones that we usually use on America) to Hebrew (Jewish) dates. I'm using Adobe Flash CS5 for an Adobe AIR application. Is there some code for this already developed on ActionScript 3.0? After some time researching I discovered that windows applications created on Visual Studio have built-in functions for such need. Is there some way of calling a function on a windows form or something from AIR? Best, Lucas 回答1: Unfortunately after searching around,

What exactly does var x:* mean in actionscript?

◇◆丶佛笑我妖孽 提交于 2019-12-10 14:58:17
问题 Its a little tricky to search for 'var:*' because most search engines wont find it. I'm not clear exactly what var:* means, compared to say var:Object I thought it would let me set arbitrary properties on an object like : var x:* = myObject; x.nonExistantProperty = "123"; but this gives me an error : Property nonExistantProperty not found on x What does * mean exactly? Edit: I fixed the original var:* to the correct var x:*. Lost my internet connection 回答1: Expanding on the other answers,

reading simple INI file with AS3

孤人 提交于 2019-12-10 13:41:41
问题 What AS3 class should I use to read a simple property/ini file into memory to configure some settings such as colors easily for the project. format could be key=value <newline> I like to access it with this kind of API: trace ( Settings.get("key") ) 回答1: There is no built-in way to do this in AS3, but we have support for loading and parsing properties files in Spring ActionScript. Here are the direct links to the sources: Properties PropertiesParser (used internally in Properties) 回答2: I you

How to send a GET request in AS3?

◇◆丶佛笑我妖孽 提交于 2019-12-10 13:38:36
问题 I see this example here: http://damn.ihateblue.net/2011/09/24/actionscript-3-send-getpost/ Which looks pretty good. But the loader seems overly complicated. What if I don't need to listen for a response? Can this be simplified? 回答1: If you don't want to listen for a response then you can remove the dataFormat, the listener and its handler function. You can also leave out the request.method because GET is the default. import flash.net.*; var url:String = "http://192.168.1.1:1234/"; var request

Actionscript object number of properties

女生的网名这么多〃 提交于 2019-12-10 12:56:14
问题 How can I get the number of properties in a generic Actionscript Object? (Like Array length) 回答1: You will have to loop over all element to count them: function objectLength(myObject:Object):int { var cnt:int=0; for (var s:String in myObject) cnt++; return cnt; } var o:Object={foo:"hello", bar:"world"}; trace(objectLength(o)); // output 2 回答2: Even shorter code here: var o:Object={foo:"hello",bar:"world",cnt:2}; trace(o.cnt); // output 2; Just remember to update the very last argument in the

Securely provide a unique secret code to winner of flash game?

放肆的年华 提交于 2019-12-10 12:43:49
问题 Here's what I want to do: when a player wins a game (coded in flash/actionscript), they are given a personalized secret key, which they can email to me in exchange for a prize. I can then validate the key on my end using a private algorithm. I need to design it so that it is practically impossible for hackers to generate a valid prize key without winning the game. Is this even possible? I assume that any SWF file is basically vulnerable to decompilation, but I don't know exactly how

Flex - XMLSocket truncates the final closing tag of the XML - why?

左心房为你撑大大i 提交于 2019-12-10 12:16:58
问题 I have a project which tries to send an XML using XMLSocket to a server listening to it on the other side. The application file is: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ import MyConnection; [Bindable] public var conn:MyConnection = new MyConnection(33333); ]]> </mx:Script> <mx:VBox> <mx:Button label="Click me" buttonDown="conn.sendXml()" /> </mx:VBox> </mx:Application> And MyConnection.as is:

How to trace a full Display List with a recursive function?

℡╲_俬逩灬. 提交于 2019-12-10 11:44:42
问题 I want to see all instances on the Display List of a specific DisplayObjectContainer. How to do it with a recursive function to see beyond the first depth ? 回答1: This is the simplest code that you can recursively see all the parents of a DisplayObject going to top from bottom. Add numChildren tweak and you can see all other children of the parent too. function traceD(mc:DisplayObject) { trace(mc); if(mc.parent!=null) traceD(mc.parent); } 回答2: Here a simple recursive function to trace a

Patterns for propagating changes to nested objects

可紊 提交于 2019-12-10 11:38:25
问题 I am implementing a game/application where the player's account/state is synced to the server. I am contemplating a general framework communicating modifications of nested objects of an entity (the entity being the users's account). Let us assume for discussions of computation/reflection that both the client and server are written in Java (in reality client is in Actionscript which can modify properties dynamically) Take for instance Firebase. Modifications to any object of the root object (a