actionscript-3

can an actionscript function find out its own name?

冷暖自知 提交于 2019-12-18 03:34:04
问题 given the following function A(b:Function) { } If function A(), can we determine the name of the function being passed in as parameter 'b' ? Does the answer differ for AS2 and AS3 ? 回答1: I use the following: private function getFunctionName(e:Error):String { var stackTrace:String = e.getStackTrace(); // entire stack trace var startIndex:int = stackTrace.indexOf("at ");// start of first line var endIndex:int = stackTrace.indexOf("()"); // end of function name return stackTrace.substring

Is it possible to create a 'command line' swf?

China☆狼群 提交于 2019-12-18 03:23:30
问题 I'd like to be able to write a .swf file that is runnable as a command line app. In other words, I would be able to create actionscript classes which can interact with stdin and stdout, and could then execute that .swf directly in the command line. I suspect that this isn't really possible. Can anyone confirm that? EDIT: A couple of the answers pointed out that using Flash for command line work probably isn't the best choice. I wholeheartedly agree in most situations. The reason I am asking

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

谁说我不能喝 提交于 2019-12-18 03:04:17
问题 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. 回答1: 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); 回答2: If you don't care about the order of the items in the

Flex: Render an unrealized UIComponent to BitmapData?

点点圈 提交于 2019-12-18 02:55:07
问题 What is the best way to render to a UIComponent which hasn't been added to the stage? (I'm using UIComponents as renderers for objects, and want to render new copies for image export, filtering, etc.) Two strategies I've seen/used so far include realizing the component to ensure it calls all the lifecycle methods: Add the component to Application.application , render with BitmapData.draw(), remove component. This is similar to what I've seen done for printing unrealized components as well.

Can ActionScript tell when a SWF was published?

北慕城南 提交于 2019-12-17 22:25:03
问题 I'd like to write a little class that adds a Day/Month box showing the date a SWF was published from Flash. The company I work for regularly produces many, many SWFs and many versions of each, iterating over the course of months. A version-tracking system we've been using to communicate with our clients is a Day/Month date-box that gives the date the SWF was published. Up until now, we've been filling in the publish date by hand. If there's any way I can do this programatically with

as3 externally loaded swf from network to control externally loaded swf from network

喜夏-厌秋 提交于 2019-12-17 21:36:16
问题 I have had several posts like this but I have not gotten down to the final answer so I put this image together to try and explain what I am trying to do. I AM SO CLOSE. if you can help me THANK YOU SOOOO MUCH. Worked days on this so far. HOW DO I CONTROL CHILDREN INSIDE AN EXTERNALLY LOADED SWF FROM CODE IN ANOTHER EXTERNALLY LOADED SWF? EDIT: Below is THEE code located in "ONE.swf" that I need help with. Just one or two lines I know but I JUST CANT get it. function FunctionInOne() { var

Alternative to embedding a font in as3

别来无恙 提交于 2019-12-17 21:19:21
问题 I have quite a basic question to ensure I am not missing something obvious! Does anyone know of an alternative to embedding fonts? I am developing a global app which will change the font for Asian languages. If these fonts are embedded it will result in a massive SWF file, I would like to get the font, when it goes on the Asian system from the windows/fonts folder. Cheers 回答1: You can do this by embeding the font in external SWF files. for example you have: Arial_EN.swf Arial_RU.swf Arial_JP

How to fix this (probably) cross domain policy error using Flash, Socket.IO and NodeJS

爷,独闯天下 提交于 2019-12-17 20:42:24
问题 Error #2044: Unhandled SecurityErrorEvent:. text=Error #2048: Security sandbox violation: http://kipos.bluecodestudio.com/holdthebomb/HoldTheBombWeb.swf cannot load data from http://23.29.126.76:8000/socket.io/1/?t=1356891827452. at io::Socket/doHandshake()[/Users/airrider3/github/AS3-Socket.IO-XHR-Polling/xhr-polling/src/io/Socket.as:139] at io::Socket/connect()[/Users/airrider3/github/AS3-Socket.IO-XHR-Polling/xhr-polling/src/io/Socket.as:110] at io::Socket()[/Users/airrider3/github/AS3

Help with Cross-Domain file for ActionScript 3 Socket

天大地大妈咪最大 提交于 2019-12-17 20:25:44
问题 Here is My ActionScript Code: var S:Socket=new Socket("127.0.0.1",2222); Here is My CrossDomain.XML File (Located at http://127.0.0.1/crossdomain.xml) <?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <allow-access-from domain="*" to-ports="2222"/> </cross-domain-policy> Here is The Error I Am Getting Ignoring policy file at xmlsocket://127.0.0.1:2222 due to incorrect syntax. Having never used one

AS3 NetStream AppendBytes Seek issue

眉间皱痕 提交于 2019-12-17 20:23:23
问题 I'm having trouble with NetStream in AS3. The project I am working on allows users to browse a video (locally) and play it back. The issue I am having is that netStream.seek(0); from what I can tell it doesn't do anything, although I get inside a NetStatusEvent function and NetStream.Seek.Notify is triggered. I'm using NativeProcess and the following function is this makes any difference. public function ProgressEventOutputHandler(e:ProgressEvent):void { videoByteArray = new ByteArray();