actionscript

Sending JSON in ActionScript 2

别等时光非礼了梦想. 提交于 2019-12-08 10:23:33
问题 anyone know how to send JSON in ActionScript 2? I tried using XML() but it changes all " into " before sending it. Ex: var callout = new XML({ "name": "John"}) callout.sendAndLoad('http://api.app.com', new XML()); but what gets sent is { "name": "John"} also cannot upgrade to AS3 (wish i could) 回答1: Here's how you do it Create a new class that extends LoadVars and override the "toString" method to return the JSON. You can then use load() and sendAndLoad() to send JSON to an URL Example: class

Screenshot of stage

蹲街弑〆低调 提交于 2019-12-08 09:36:48
问题 Is it possible to take a screenshot (dump image) of the Stage and save it to my web server? 回答1: This should do the trick: var myBitmapData:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight); myBitmapData.draw(stage); (actually i'm not sure if you can do a draw() on the stage directly, you might need to do this on whatever is on top of your DisplayList instead) Then use something like this code: http://henryjones.us/articles/using-the-as3-jpeg-encoder var jpgEncoder:JPGEncoder =

ByteArray Type Coercion failure when reading from Javascript ExternalInterface call

不羁的心 提交于 2019-12-08 08:12:49
问题 I am reading in a ByteArray object from an ExternalInterface call which is obtaining the ByteArray from another SWF . The reason for the Javascript conduit is because the ByteArray data exceeds the 40k limit of the LocalConnection class . I'm getting the following error: TypeError : Error #1034: Type Coercion failed: cannot convert Object@d6f48e1 to flash.utils.ByteArray. with this line of code: swfBytes = ExternalInterface.call("getBytes", cacheIdx); swfBytes is an initialized ByteArray

Sonoport how to play audio (actionscript)

£可爱£侵袭症+ 提交于 2019-12-08 08:12:35
问题 There is manual http://sonoport.com/manual/ how to use as3 library to play audio with audio filters. I need tool AudioStretch but firstly try simple to play an audio external link. What i do. I use mxmlc compiler, so includes SonoportCollection.swc Import com.sonoport.MP3PlayerSound; Try create and play code: mp3PlayerSnd = new MP3PlayerSound(); mp3PlayerSnd.audioFile = "http_url_link.mp3"; mp3PlayerSnd.play(); So, nothing play. I see that http get to server for link http_url_link.mp3 is sent

Flash TextField HTML - How do I prevent the error dialogue for missing images? (Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found)

可紊 提交于 2019-12-08 07:53:01
问题 I'm using a Flash TextField control to display some HTML content inside a Flash presentation to be shown on a large touch-screen kiosk. Unfortunately, if any image tag in the displayed HTML content points to a non-existent image, a dialogue is shown with the error message Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found. I am trying to avoid having that dialogue pop up. The solution for loading content through a loader class is to catch IOErrorEvent.IO_ERROR , but I've

How to generate the ActionScript 3 source code of an OpenLaszlo LZX SWF runtime app

人走茶凉 提交于 2019-12-08 07:35:43
问题 When developing OpenLaszlo applications, it's sometimes useful to generate the ActionScript 3 source code of an application written in lzx, e.g. when you want to compile OpenLaszlo into an Adobe AIR application. What is the simplest way to generate the ActionScript 3 source code into a predefined folder? 回答1: The lzc command line tool which can be found in the $LPS_HOME/WEB-INF/lps/server/bin/ has on option for that: --lzxonly for as3 runtime, emit intermediate as files, but don't call

ActionScript Get All Network Activity?

ⅰ亾dé卋堺 提交于 2019-12-08 07:32:47
问题 Is there a way within ActionScript 3.0 to: Get all URLRequests() that are made within the application? Get all RTMP:// connections to a Flash Media server? Since my application contains SWC files which were compiled by another developer, I cannot directly access the ActionScript which creates the URL requests and RTMP connections. Thank your for your time. 回答1: You can use a web debugging proxy to monitor all messages that are sent over the wire. I like to use Charles because it deserializes

Request data in a Flash movie from PHP, at run-time

∥☆過路亽.° 提交于 2019-12-08 07:19:01
问题 Is it possible to request some data in a Flash movie from PHP at run-time? Maybe my real-world implementation can clarify some things: I use a Flash movie to store a Local Shared Object (because for some reason I need LSO's instead or regular PHP cookies). Now, when I load up a PHP file I want to somehow retrieve the data from the LSO at runtime, assign it to some variables, and use the variables through the rest of the script. Doing some research makes me believe it's not possible in the way

flex preloader not working with # in the url (deep linking)

烈酒焚心 提交于 2019-12-08 04:32:29
问题 I can't get flash preloaders to work when there is a a # in the url of my page (even without any deep linking libraries or logic). I am using flex 3.3. Flash plugins 9 and 10, all browsers. There is this bug regarding # in the url preventing preloaders from working: http://bugs.adobe.com/jira/browse/SDK-14162 However, somehow, someone, somewhere has ways around this. Here are somewhat working examples (remember to clear your cache to ensure you see the preloader awesomeness) : http://www

Actionscript 3D engine

老子叫甜甜 提交于 2019-12-08 03:57:59
问题 I'm new to 3D, so asking for help. I need to make walking simulator on AS3: first-person view, moving through rooms and corridors. I don't need any physics, only moving and looking. Could someone tell me, what's the best actionscript-3 3d framework to implement needed functionality? Explanation is welcome :) Thanks! 回答1: Away3D. Best open source (and probably best of all) 3D engine on flash. You can either do this using the old away3D version for flash player 10 and under, or using away3D for