flash

Local Timer Object Event Handler

允我心安 提交于 2019-12-22 07:07:47
问题 I have the following code in a class function : public function foo():void { var timer:Timer = new Timer(10000,1); timer.addEventListener(TimerEvent.TIMER_COMPLETE,onTimerComplete); timer.start(); } public function onTimerComplete(e:TimerEvent):void { // do stuff } The above code works most of the time but my concern is what happens if timer gets garbage collected? Is it possible that onTimerComplete will never fire because there are no other references to timer? I know timer has an internal

Local Timer Object Event Handler

荒凉一梦 提交于 2019-12-22 07:07:39
问题 I have the following code in a class function : public function foo():void { var timer:Timer = new Timer(10000,1); timer.addEventListener(TimerEvent.TIMER_COMPLETE,onTimerComplete); timer.start(); } public function onTimerComplete(e:TimerEvent):void { // do stuff } The above code works most of the time but my concern is what happens if timer gets garbage collected? Is it possible that onTimerComplete will never fire because there are no other references to timer? I know timer has an internal

building small GUI engine: visible vs. addChild/removeChild

蹲街弑〆低调 提交于 2019-12-22 06:48:50
问题 Currently, i'm experimenting with a very simple GUI drawing ... "engine" (i guess you could call it that). The gist of it: there is a FrontController that gets hit by user requests; each request has a uid each uid (read "page") has a declaration of the components ("modules") that are present on it components are Sprite subclasses and, in essence, are unique Naturally, i need a way of hiding/showing these sprites. Currently, i have it pretty much like Flex has it by default - in the way "if we

Parsing FLV header (duration) of remote file in Java

我们两清 提交于 2019-12-22 06:24:55
问题 I'm looking for an example of parsing an FLV header for duration specifically in Java. Given the URL of an FLV file I want to download the header only and parse out the duration. I have the FLV spec but I want an example. Python or PHP would be OK too but Java is preferred. 回答1: Do you have problems downloading the header or parsing it? if it's downloading then use this code: URL url = new URL(fileUrl); InputStream dis = url.openStream(); byte[] header = new byte[HEADER_SIZE]; dis.read(header

Parsing FLV header (duration) of remote file in Java

点点圈 提交于 2019-12-22 06:24:15
问题 I'm looking for an example of parsing an FLV header for duration specifically in Java. Given the URL of an FLV file I want to download the header only and parse out the duration. I have the FLV spec but I want an example. Python or PHP would be OK too but Java is preferred. 回答1: Do you have problems downloading the header or parsing it? if it's downloading then use this code: URL url = new URL(fileUrl); InputStream dis = url.openStream(); byte[] header = new byte[HEADER_SIZE]; dis.read(header

Does dispatching an event interrupt a function?

白昼怎懂夜的黑 提交于 2019-12-22 05:57:14
问题 Let's say function foo() is executing. Suppose that an external event occurs, for which you have a handler. Will function foo() be interrupted so that the event handler can be executed? What is the order of execution in this situation? 回答1: No, foo() will not be interrupted. Flex is single-threaded, so foo() will continue running. Once foo() finishes and control is returned to the event loop, then the first event in the event queue will be processed. 回答2: This actually can be sorta tricky. I

SWFUpload on HTTPS not working

穿精又带淫゛_ 提交于 2019-12-22 05:47:06
问题 I have trouble uploading files with SWFUpload when target servlet is listening on HTTPS. On HTTP it works fine. The issue is only when using FireFox or Opera. On IE it works fine - not tried other browsers. EDIT: Error message as provided from SWFUpload when in debug mode: SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0 SWF DEBUG: Event: uploadError : IO Error : File ID: SWFUpload_0_0. IO Error: Error #2038 SWF DEBUG: Event: uploadComplete : Upload cycle complete. 回答1:

Find out the character pressed key

雨燕双飞 提交于 2019-12-22 04:43:21
问题 If I add a listener to KeyboardEvent.KEY_DOWN, I can find out the keyCode and the charCode. The keyCode maps to a different character depending on the keyboard. The charCode is just as useless, according to the help: The character code values are English keyboard values. For example, if you press Shift+3, charCode is # on a Japanese keyboard, just as it is on an English keyboard. So, how can I find out which character the user pressed? 回答1: You left out a pretty important part of the quote or

ASP.NET and Flash - can flash talk to .net

半腔热情 提交于 2019-12-22 04:38:28
问题 Can a flash front end talk to a .net backend? 回答1: Yes. We use Adobe Flex to talk to .Net XML web services. Be careful with complex serialised .Net types (for instance DataSets) - ActionScript can't handle them. Instead produce simple XML with primitive types. See also: Flex and ADO.NET Data Services...anyone done it? <mx:WebService id="myDataService" showBusyCursor="true"> <mx:operation name="WebMethodName" resultFormat="object" result="functionFiredOnComplete();"></mx:operation> </mx

Does ExternalInterface work on the file: protocol?

放肆的年华 提交于 2019-12-22 04:38:10
问题 Can anyone confirm that ExternalInterface works on the file: protocol, or point to some docs that say that it will not? 回答1: It's starting to look like this will not work.. this page says: Scripting in either direction between local HTML files and local SWF files--for example, using the ExternalInterface class--requires that both the HTML file and SWF file involved be in the local-trusted sandbox. This is because the local security models for browsers differ from the Flash Player local