actionscript

Adding a key listener in Action Script 3

和自甴很熟 提交于 2019-12-11 14:18:25
问题 I am relatively new to Action Script, and I am trying to make a game of Snake. Obviously I need to implement a global key listener, but I am having odd problems. I tried adding the listener to the application tag but it didn't seem to have any effect (the movie was still able to compile). Whenever I call this.stage.addEventListener(KeyboardEvent.KEY_DOWN, key, true); my program crashes. Below is the content of my main.mxml file: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx=

Is there a way to remove listeners easier?

◇◆丶佛笑我妖孽 提交于 2019-12-11 14:08:26
问题 so, there´s a easy way to remove all childs from container like this while (container.numChildren) { container.removeChildAt(0); } is there a way to remove stage.eventListener in plural (dont know if im using the word right), something like stage.eventListeners? something like that? thanks! 回答1: No, there isn't. There is no mechanism, at least publicly available, that keeps track of event listeners. However, you could do it yourself. Basically, you need to keep track of each listener that is

How to link functionality from Class file to DocumentClass and to Movieclips in AS3?

一笑奈何 提交于 2019-12-11 13:53:56
问题 and i am having problem, switching from Timeline code to OOP/Document Class. I managed to build the Fla with AS3 on timeline with no problem. But totally clueless when on OOP. I had been told that Scenes are no good and i should stick to saving my scenes as Movieclips. My situation is as such: I have 8 pages of PSD files, and i imported each PSD into Flash Pro, and each PSD has a few buttons and textinput. First page is Login page, second page is register page etc. My questions are: 1.) How

Execute an external EXE from Flex/AIR or Java Web Application

浪尽此生 提交于 2019-12-11 12:08:12
问题 Need to execute an external EXE from either a Java web app (running on Glassfish on Windows Server) or from an Flex/AIR desktop app. Any suggestions, links? Thanks, 回答1: You cannot execute an executable on the client from a web application on the server. It would be very bad if you could. You also cannot execute something from AIR, since it is outside the security sandbox. You can, however, do so from an AIR2EXE application like Shu or airAveer, but this will change your deployment strategy.

Action Script 3 Swipe Function (Won't Swipe)

别等时光非礼了梦想. 提交于 2019-12-11 11:41:38
问题 I am trying to do a simple swipe motion in AS3 (action script 3). When I run the test through Android 3.6 I get no errors - but nothing happens. The box doesn't move at all. Here's the code I am using... import flash.events.MouseEvent; import flash.net.URLLoader; import flash.ui.Multitouch; import flash.ui.MultitouchInputMode; import flash.events.TransformGestureEvent; Multitouch.inputMode = MultitouchInputMode.GESTURE; //Side Menu Swipe smenu_mc.addEventListener(TransformGestureEvent.GESTURE

Flash AS3 Error controlling button from external actionscript

≯℡__Kan透↙ 提交于 2019-12-11 11:41:04
问题 Help. Basically i have 2 button at different frame. If the button on frame 1 clicked, it will go to and stop at frame 2. If the button on frame 2 clicked, it will go to and stop at frame 1. What I'm trying to do is controlling this button over external actionscript file. The 1st button running with no problem, while the 2nd one seems to not responding properly and have this error message: TypeError: Error #1009: Cannot access a property or method of a null object reference. at src::Main/init(

When External SWF has reached Frame X, how do I unload it?

三世轮回 提交于 2019-12-11 11:22:39
问题 Here's my swf loading code: function loadBall(e:MouseEvent):void{ var mLoader:Loader = new Loader(); var mRequest:URLRequest = new URLRequest("ball.swf"); mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler); mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler); mLoader.load(mRequest); } function onCompleteHandler(loadEvent:Event){ currentMovie = MovieClip(loadEvent.currentTarget.content) addChild(currentMovie); trace(loadEvent); }

Flex Filereference automatically retry when failed (like error #2038)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 11:13:32
问题 Is there a way to automatically retry Fileupload.upload() opertaion if it fails with IO_Error? I tried calling upload() again (and it did reach all the way to the web-service) ==> but it did NOT trigger DataEvent.UPLOAD_COMPLETE_DATA when the Retry was completed (i checked with a sniffer that the retry operation did finish successfully) Thanks for any ideas. 来源: https://stackoverflow.com/questions/10471060/flex-filereference-automatically-retry-when-failed-like-error-2038

1120: Access of undefined property

二次信任 提交于 2019-12-11 10:52:31
问题 Why I'm getting a 1120: Access of undefined property arrMonth. error at the line arrMonth.push and how to correct it? <fx:Script> <![CDATA[ [Bindable] public var arrMonth:Array = new Array(); arrMonth.push({label: "January"}); ]]> </fx:Script> 回答1: The reason for that error is that your logic (the push statement) is not inside a method, hence it is considered to be at class level (i.e. static) instead of at the instance level. Which means there are two ways to fix it : 1/ Make the variable

StageVideo on Android Nexus 7 shows a black square

邮差的信 提交于 2019-12-11 10:36:58
问题 StageVideo in Adobe AIR 15, on a Nexus 7 with Android 4.4.3, exporting in both GPU and DIRECT, shows a black square instead of received video. It is a P2P RTMFP Video Chat. Same project on desktop works perfectly, once exported to Android, instead of remote StageVideo it shows a black square. Audio arrives perfectly, and other P2P features work well. Code is all right since same project compiles on AIR15 for desktop and works lovely. Any idea why this happens? 回答1: The stage video is