actionscript

Flash connecting to a WCF service

纵然是瞬间 提交于 2019-11-28 01:46:28
问题 I would like ask for guidance on the proper endpoint configuration for my WCF service to enable a Flash app to consume it. Thanks, Keith Rull 回答1: Well you should start with a webHttpBinding and naturally you need to apply the webHttp behavior as well. Then you just need to figure out what serialization format you want to work with. Flash can do JSON or XML, so you need to decide which you prefer and then you set the ReqeustFormat/ResponseFormat properties of the WebInvokeAttribute which are

Unzip and save files using as3?

倾然丶 夕夏残阳落幕 提交于 2019-11-28 01:13:47
I have a list of zip and rar files in a local folder. All I need to do is to extract the contents of the zip as well as rar files and to save them in a folder with the same name of the respective archive file. Since I am new to as3, I have no clue for this. Is there any Library for this??? Thanks in advance... There are a few libraries out there that deal with ZIP files in as3, but beware that this is no easy task for a beginner in ActionScript 3. FZip seems to be the most widely used, but it requires that the ZIP archives have Adler32 checksums . Provided with the library there is a Python

Can Flash action script read and write local file system?

无人久伴 提交于 2019-11-28 00:05:09
I think it can only access the network but not local file system, but from internet some people said it can in the newest version, can anybody confirm? It can reach arbitrarily file or just a specific location? Thanks. Bin In general, an SWF from a web-server cannot read files from the client machine. But it can upload user-selected files from the client machine to the server. An operating-system specific dialog box prompts the user to select the file to be uploaded to the server. Hence Flash cannot read any file it wants, only those that are explicitly permitted by the user. Before Flash

How do you trigger javascript functions from flash?

ⅰ亾dé卋堺 提交于 2019-11-27 22:22:46
问题 How do you trigger a javascript function using actionscript in flash? The goal is to trigger jQuery functionality from a flash movie 回答1: Take a look at the ExternalInterface-Class. From the AS3-Language Reference: The ExternalInterface class is the External API, an application programming interface that enables straightforward communication between ActionScript and the Flash Player container– for example, an HTML page with JavaScript. Adobe recommends using ExternalInterface for all

How do I access a movieClip on the stage using as3 class?

空扰寡人 提交于 2019-11-27 18:49:14
问题 public class MyClass extends MovieClip { public function MyClass():void { my_mc.addEventListener(MouseEvent.CLICK, action); } private function action(e:MouseEvent):void { trace("cliked"); } } Timeline code var myClass:MyClass = new MyClass(); addChild(myClass); I can't able to access the my_mc (placed in FLA) movieclip. How do I access? 回答1: Try this: public class MyClass extends MovieClip { public function MyClass() { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); }//

What is the difference between object main timeline, object Stage and root in as3?

久未见 提交于 2019-11-27 18:16:46
问题 I want to know the difference between [object main timeline] , [object Stage] and root in as3? I have read from the topic How stage, root, and MainTimeline Fit Together. But I didn't get clearly. 回答1: I think the article you linked to sums it up quite nicely (even if it doesn't explain it all that well): To summarize: one stage, one root per SWF (which is the main timeline) and that root is an instance of a document class or the MainTimeline class if a document class isn't provided Stage is

For VS Foreach on Array performance (in AS3/Flex)

六眼飞鱼酱① 提交于 2019-11-27 14:41:53
问题 Which one is faster? Why? var messages:Array = [.....] // 1 - for var len:int = messages.length; for (var i:int = 0; i < len; i++) { var o:Object = messages[i]; // ... } // 2 - foreach for each (var o:Object in messages) { // ... } 回答1: From where I'm sitting, regular for loops are moderately faster than for each loops in the minimal case. Also, as with AS2 days, decrementing your way through a for loop generally provides a very minor improvement. But really, any slight difference here will

Flex's FileReference.save() can only be called in a user event handler — how can I get around this?

感情迁移 提交于 2019-11-27 14:05:52
I need to call FileReference.save() after a web service call has completed, but this method has a restriction: "In Flash Player, you can only call this method successfully in response to a user event (for example, in an event handler for a mouse click or keypress event). Otherwise, calling this method results in Flash Player throwing an Error exception." (from the documentation here ) This restriction is a bit vague. Does it mean that I can only call the FileReference.save() method from within an event handler function that is registered as a listener for certain types of user events? If so

How can I get an instance's “memory location” in ActionScript?

你说的曾经没有我的故事 提交于 2019-11-27 12:38:48
FlexBuilder's debugger will show you the "memory location" (or, I can only assume, something roughly analogous) of any in-scope instance: But I'd like to get this information in code (sort of like Python's id function), so I could very easily trace how objects move through out the system. For example, I might have: trace("Returning", id(foo)); Then somewhere else I could use: trace("Using", id(foo)); To make sure both bits of code are dealing with the same instance. Now, I know that many AS classes implement the IUID interface... But there are also a bunch of classes which don't (plain old

Flash / Actionscript CPU profiler

戏子无情 提交于 2019-11-27 12:35:23
问题 Have you found such a tool and used it successfully? 回答1: I was also looking for a profiler for AS, but I wanted an freeware/open source solution that works with FlashDevelop and Flex SDK. I found none. So I wrote a simple python script and an even simpler AS class. The script essentially takes any AS file and adds profiling code (i.e. calls to measure the total runtime of that function with an accuracy of 1 ms - the resolution of the flash.utils.getTimer() call) to each function definition.