actionscript

Save encoded .mp3 to applicationStorageDirectory Adobe Air iOS

风格不统一 提交于 2019-12-06 04:40:30
I'm developing an iOS iPad app w/ Flash CS5.5 AIR v.3.1 I'm using ShineMp3Encoder to encode a Wav to a Mp3 from: https://github.com/kikko/Shine-MP3-Encoder-on-AS3-Alchemy Basically it converts a byteArray (wav) to a byteArray (mp3) or "mp3encoder.mp3Data" in the code. I have no trouble saving this using a (new FileReference()).save(mp3Data, filename); but because this is being used in a iOS AIR app I wanted to switch to using the File.applicationStorageDirectory so that I could put the saved mp3 into it's own folder to keep organized. When I run the code it goes through all the steps, converts

Accessing .NET Web Service securely from Flex 3

試著忘記壹切 提交于 2019-12-06 04:22:40
We can successfully consume a .NET 2.0 web service from a Flex/AS3 application. Aside from SSL, how else can we make the security more robust (i.e., authentication)? You can leverage ASP.Net's built in session management by decorating your webmethods with <EnableSession()> Then, inside your method, you can check that the user still has a valid session. If you're talking about securing the information going over the wire, you can use Web Service Extensions (WSE) to encrypt the body of the soap message so that you don't have to secure the channel. This way the message can get passed around from

In Ruby, is there a way to accomplish what `with` does in Actionscript?

大城市里の小女人 提交于 2019-12-06 03:46:55
In Ruby, I would like to select a default object for a block. An example in Actionscript is: with (board) { length = 66; width = 19; fin_system = 'lockbox'; } Which is equivalent to: board.length = 66; board.width = 19; board.fin_system = 'lockbox'; Here is the documentation for this statement in Actionscript: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/statements.html#with How can I accomplish this in Ruby? Hash.new.tap do |h| h[:name] = "Mike" h[:language] = "Ruby" end #=> {:name=>"Mike", :language=>"Ruby"} You could try Object#tap with Ruby 1.9. So in your case: board.tap do

How are methods found in AVM2 bytecode?

允我心安 提交于 2019-12-06 03:36:09
问题 I've been playing around with ABC bytecode and was hoping someone could clear up a point of confusion for me. I have a simple flash file that places a clip on the stage and has a tiny script to update its position on each frame. The code looks something like: package { import flash.display.MovieClip; import flash.events.Event; public class RedCircle extends MovieClip { public function RedCircle() { this.addEventListener(Event.ENTER_FRAME, moveit); } function moveit(e:Event) { this.x -=1; } }

Pass JSON to a Flash movie

旧街凉风 提交于 2019-12-06 03:25:08
问题 What is the best way to pass JSON to and from a Flash movie? Currently to communicate between javascript and Flash : I'm using 'flashvars' to pass data to the flash movie when it initially loads I'm using 'ExternalInterface' at runtime to transfer single values, such as booleans at runtime I want to move to the next level and do this with JSON now. Initially I just want the ability to send JSON to the flash movie on instantiation, but later i will need to send data back and forth. I just want

Grab a ProgressEvent from a POST upload in as3

耗尽温柔 提交于 2019-12-06 03:16:25
问题 Is there any way to track the status of a posted upload in AS3? There is a ProgressEvent, but it gives data back about the response, not the actual POST upload. I'm posting binary data for an image, so it's usually in the 50-100kb range. The image data was generated inside Flash itself, so I can't use the upload method - at least as far as I know. Thanks! 回答1: Perhaps you can use a function at the server side to send progress events to the flash object? 回答2: He's not asking about the

Is it possible to profile CPU / memory inside an Adobe AIR application?

大兔子大兔子 提交于 2019-12-06 00:39:44
Couldn`t find any ActionScript native APIs even in the beta documentation, am I right supposing that this means the only way to measure CPU / memory consumption is by cooking up a custom native solution, hooking it up with AIR and making it work on each targeted platform? Basically the aim is to be able to have this information available inside AIR and not having to use an external application for profiling, not even Flex / Flash builder. Thanks for the helpful answers, System.totalMemory sneakily eluded me! Seems for the CPU load the only solution will be some command line scraping using

How to make a Timer accurate? (Flash / ActionScript 3.0)

廉价感情. 提交于 2019-12-05 23:21:32
I'm using the following method to dispatch a sound in X times/minute (X is determined through bpm, which is a NumericStepper object) var mainTimer:Timer = new Timer(60 / (bpm.value * 1000),0); mainTimer.addEventListener(TimerEvent.TIMER, fl_TimerHandler,false, 0, true); mainTimer.start(); function fl_TimerHandler(event:TimerEvent):void { metroTransform.volume = vol; flash.media.SoundMixer.soundTransform = metroTransform; metroChannel = metro.play(); mainTimer.delay = 60 / bpm.value * 1000; } According to this http://www.metronomeonline.com/ the sound is not sitting well. Is there something I

How to play a sound in Actionscript 3 that is not in the same directory as the SWF?

前提是你 提交于 2019-12-05 22:04:44
I have a project with a bunch of external sounds to a SWF. I want to play them, but any time I attempt load a new URL into the sound object it fails with either, Error #2068: Invalid Sound or raises an ioError with Error #2032 Stream Error // Tried with path prefixed with "http://.." "file://.." "//.." and "..") var path:String = "http://../assets/the_song.mp3"; var url:URLRequest = new URLRequest( path ); var sound:Sound = new Sound(); sound.addEventListener( IOErrorEvent.IO_ERROR, ioErrorHandler); sound.addEventListener( SecurityErrorEvent.SECURITY_ERROR, secHandler); sound.load(url); Well,

Flex: Call function from included component

感情迁移 提交于 2019-12-05 21:58:03
This is similar to my previous posting. But this time I want to call a function that exists on the main mxml page. This is my main mxml page: main.mxml <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="*"> <mx:Script> <![CDATA[ public function changeText(currentText:String):void{ switch (currentText){ case "changeText": lblOne.text = "More Text"; } } ]]> </mx:Script> <mx:HBox x="137.5" y="10" width="100%" height="100%"> <ns1:menu id="buttons"> </ns1:menu> </mx:HBox> <mx:Canvas x="137" y="88" width="408.5" height="200"> <mx:HBox x="0" y="10" width="388.5"