actionscript-3

How should client Flash(SWF) communicate with server-side .NET?

大憨熊 提交于 2019-12-21 06:06:09
问题 So I have ASP.NET running on the server in IIS7. I think I'm going to use MVC for some static pages and basic dynamic forms - but the majority of the client side is written in Flash/ActionScript. What's the simplest, most succint, most DRY way of building/generating proxies between client and server? Which format should I use? JSON SOAP Binary And which comms protocol should I use? WCF HTTP via MVC Controller actions I'm probably missing some format or protocol, but basically it should be

Flash: Closest point to MovieClip

北城以北 提交于 2019-12-21 05:47:07
问题 I need to constrain a point inside a DisplayObject given to me by the artist. I got it working but only for the occations where the cursor is still inside bounds . The limited object is called limited . function onSqMouseMove(event:MouseEvent) { if(bounds.hitTestPoint(event.stageX, event.stageY, true)) { limited.x = event.stageX; limited.y = event.stageY; } else { /* Find closest point in the Sprite */ } } limited.addEventListener(MouseEvent.MOUSE_DOWN, function(event:MouseEvent) { stage

AIR App that Loads and Runs Existing AIR swf

好久不见. 提交于 2019-12-21 05:41:50
问题 I have an existing AIR app whose main content is App.swf. I would like to have another AIR app that hosts and runs App.swf. When I say run it, I mean displays it's WindowedApplication. Here's the code for the 2 AIR projects (imports are omitted for brevity): // App AIR Project -> App.mxml -> App.swf (it's just a window) <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ public function doSomething():void { trace(

Pause and resume download in flex?

孤者浪人 提交于 2019-12-21 05:38:18
问题 Is it possible in an air application to start a download, pause it and after that resume it? I want to download very big files (1-3Gb) and I need to be sure if the connection is interrupted, then the next time the user tries to download the file it's start from the last position. Any ideas and source code samples would be appreciated. 回答1: Yes, you would want to use the URLStream class (URLLoader doesn't support partial downloads) and the HTTP Range header. Note that there are some onerous

Turning an ImageSnapshot into an Image in Flex

╄→гoц情女王★ 提交于 2019-12-21 05:37:05
问题 Using Flex 3, I would like to take an image snapshot such as this: var logoSnapshot:ImageSnapshot = ImageSnapshot.captureImage(logoContainer); and turn it into something that the Image class can use. I see that there is a property called "data", that holds a byteArray, so I guess my question is: How do I take an image that gets stored as a byteArray and convert it to something the Image class can use to display? 回答1: Simpler implementation that should work: var bm : Bitmap = new Bitmap

Streaming webcam video in Flash using MP4 encoding

孤街浪徒 提交于 2019-12-21 05:35:12
问题 One of the features of the Flash app I'm working on is to be able to stream a webcam to others. We're just using the built-in webcam support in Flash and sending it through FMS. We've had some people ask for higher quality video, but we're already using the highest quality setting we can in Flash (setting quality to 100%). My understanding is that in the newer flash players they added support for MPEG-4 encoding for the videos. I created a simple test Flex app to try and compare the video

Why does calling this function with more than 2 parameters in Actionscript 3 cause stack overflow?

做~自己de王妃 提交于 2019-12-21 05:30:13
问题 function testFunc(val1:int, val2:int, val3:int):int { var returnVal:int = 0; return returnVal; } var val:int = testFunc(1, 2, 3); causes locals: Main int int int * 4:dup VerifyError: Error #1023: Stack overflow occurred. 回答1: This page discusses a similar stack overflow issue. It seems adding a trace somewhere in the function will fix it. It's a known bug 回答2: Thank you for pointing this fact out. Anyways here is what I realize. A function in AS3 is defined as function apply(thisArg:*,

How do I attach camera to Spark.components.VideoDisplay

时光总嘲笑我的痴心妄想 提交于 2019-12-21 05:28:09
问题 I'm using Flash Builder and created a spark-application Flex project that will stream video from the local camera. If I use mx.controls.VideoDisplay ; there is no problem since it has attachCamera(camera) method. But Spark's VideoDisplay component does not have that method. I know I can use mx controls inside a Spark app but I want to know: What is the real difference between spark.components.VideoDisplay and mx.controls.VideoDisplay ? How do I attach camera to spark.components.VideoDisplay ?

What does the “@” do?

你说的曾经没有我的故事 提交于 2019-12-21 04:51:33
问题 Sometimes I see in a project im working at, the following: text="@{myVar}" What does that @ do? Edit: text is a property in, for example, a TextArea component. 回答1: The @ symbol is used for two way binding. Traditional binding is only one way. So, you have something like this in ActionScript: [Bindable] public var myValue:String = 'test'; And this in MXML <s:TextInput id="myInput" text="{myValue}" /> myValue is the source, and the text property on the myInput is the destination. When the

Flex: implementing classic curry function in actionscript?

做~自己de王妃 提交于 2019-12-21 04:27:47
问题 What's the best way to implement a classic curry function in actionscript with a nice syntax? I've tried: Function.prototype.curry = function() { return "helloWorld"; } trace((function():void {}).curry()); ...approach but that didn't work. I guess I'm stuck with a ugly approach such as: FunctionUtils.curry(fp, ... args) ??? 回答1: I must admit I've never understood the difference between "curry" and "partial". I use the following function to do more or less what you want to do: package { public