actionscript-3

Pitch detection with computeSpectrum() return FFT values

无人久伴 提交于 2020-01-21 00:27:06
问题 I'm developing using Actionscript 3.0 for Flash Player 10.3 I'm using computeSpectrum() on a loaded .mp3 Running *Event.ENTER_FRAME* to get snapshots of each sample in an byteArray The ByteArray contains 512 values (256 for each channel). These values are FFT Spectrum, ranging from 0 to 1. I can't use the peak frequency for each of the samples (as I found found out!) because the highest value is not necessarily the fundamental frequency! As a result I'm getting lots of random values all over

How to Save X Y Position Object in Variable and in Array by AS3?

微笑、不失礼 提交于 2020-01-17 23:11:21
问题 how to put Value for X and Y Position in Variable and Array object = (XPosition , YPosition) box_mc.x = 300 , box_mc.y = 200 回答1: Try to improve your question. Is that what you wanna do? import flash.geom.Point; var p:Point = new Point(200,300); box_mc.x = p.x; box_mc.y = p.y; You may also store your values in a bi-dimensional Array as here bellow : var a:Array = [[200,300],[150,200]]; box_mc.x = a[0][0]; //200 box_mc.y = a[0][1]; //300 or in this case as you have stored two values for posx

How to Save X Y Position Object in Variable and in Array by AS3?

一笑奈何 提交于 2020-01-17 23:10:04
问题 how to put Value for X and Y Position in Variable and Array object = (XPosition , YPosition) box_mc.x = 300 , box_mc.y = 200 回答1: Try to improve your question. Is that what you wanna do? import flash.geom.Point; var p:Point = new Point(200,300); box_mc.x = p.x; box_mc.y = p.y; You may also store your values in a bi-dimensional Array as here bellow : var a:Array = [[200,300],[150,200]]; box_mc.x = a[0][0]; //200 box_mc.y = a[0][1]; //300 or in this case as you have stored two values for posx

How to Save X Y Position Object in Variable and in Array by AS3?

时光毁灭记忆、已成空白 提交于 2020-01-17 23:08:28
问题 how to put Value for X and Y Position in Variable and Array object = (XPosition , YPosition) box_mc.x = 300 , box_mc.y = 200 回答1: Try to improve your question. Is that what you wanna do? import flash.geom.Point; var p:Point = new Point(200,300); box_mc.x = p.x; box_mc.y = p.y; You may also store your values in a bi-dimensional Array as here bellow : var a:Array = [[200,300],[150,200]]; box_mc.x = a[0][0]; //200 box_mc.y = a[0][1]; //300 or in this case as you have stored two values for posx

Textured text in Actionscript

梦想与她 提交于 2020-01-17 14:03:33
问题 There is any way to make a text "textured" - with a result similar to this: http://www.entheosweb.com/fireworks/patterned_text.asp In Flex (so using AS3)? I though it was a simple issue, but I'm stuck: i'm googling it from days and was not able to find aa way or workaround to do it... 回答1: The rough idea is this: Create a TextField with whatever font you need, and write whatever text you want in there. Create a new BitmapData object and draw() the TextField so that you get a bitmap

Adobe AIR camera slow

与世无争的帅哥 提交于 2020-01-17 13:57:27
问题 I am having issues with using the camera on Adobe AIR mobile devices . The performance of the camera is ok on newer phones, but on galaxy s2 for example it is impossible to use. I am using the camera like this: _camera = Camera.getCamera("0"); if (_camera != null) { // _video = new Video(); _video = new Video(_camera.width, _camera.height); // _video.width = _cameraHeight; _video.width = _cameraHeight; _video.height = Starling.current.nativeStage.fullScreenWidth; _camera.addEventListener

How to make an object network serialize to a file, not a SharedObject?

若如初见. 提交于 2020-01-17 08:34:31
问题 Currently, I do serialize my model object to the SharedObject instance : try { var mySo:SharedObject = SharedObject.getLocal("sig"); mySo.clear(); mySo.data.model = _model; mySo.flush(); } catch ( e:Error ) { Alert.show( 'Leider konnte kein Modell geladen werden.' ); } Likewise, I load the saved model using the SharedObject instance. Works great. Ultimately, I'd like to serialize it to a file - which fails. Here is how: var fp: File = File.applicationStorageDirectory; fp = fp.resolvePath(

Movieclips Overlapping

青春壹個敷衍的年華 提交于 2020-01-17 08:24:31
问题 I've been learning as3 for about 2 weeks I'm trying to make a combo generator for personal uses The problem is that if the same MovieClip inside the array is displayed twice or more it just overlapps it. for example when the elbow is displayed a second time ,it just overlaps the 1st elbow movieclip! http://imageshack.us/scaled/landing/208/17797019.png Here's my code var punch:Punch = new Punch(); var kick:Kick = new Kick(); var knee:Knee = new Knee(); var elbow:Elbow = new Elbow(); var holder

Flex actionscript code for activitylevel

梦想的初衷 提交于 2020-01-17 06:59:35
问题 Can any one indicata me a small piece of code for making this progress bar move on mic activitylevel. i.e, When spoken on the microphone the progressbar should indicate it.Also which works on internet explorer <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="300" height="100" creationComplete="init()"> <mx:Script> <![CDATA[ import mx.controls.Alert; import flash.net.NetStream; private var myMic:Microphone; private var

AS3 - Event.ENTER_FRAME - error 1119

守給你的承諾、 提交于 2020-01-17 06:43:37
问题 I'm trying to develop a simple game in Adobe Animate and AS3. I have a class GameCore where I want to add an ENTER_FRAME event listener. package as3 { import flash.display.Stage; import flash.display.MovieClip; import flash.events.*; import as3.movieclips.RocketShip; public class GameCore { var rocket:RocketShip; var stage:Stage; var timeline:MovieClip; var i:int; public function GameCore( stage:Stage ) { // constructor code this.rocket = new RocketShip(); this.stage = stage; this.timeline =