actionscript-3

How to Calculate Frequency & Amplitude in Flash AS3 with Flash Player 9

流过昼夜 提交于 2019-12-24 04:06:08
问题 How can I calculate Frequency & Amplitude in As3 with FP9. I got the all raw byte using SoundMixer.computeSpectrum(_testbytes, false, 0); var g:Graphics = this.graphics; g.clear(); g.lineStyle(0, 0x6600CC); g.moveTo(0, PLOT_HEIGHT); var m:Number = 0; for (var i:int = 0; i < 256; i++) { m = (_testbytes.readFloat() * 100); g.lineTo(i*2 , 100 - m); } g.lineTo(CHANNEL_LENGTH * 2, PLOT_HEIGHT); Now Can I get the frequency & amplitude data from it? 回答1: If you have a closer look at the

Purpose of init function

一世执手 提交于 2019-12-24 04:03:09
问题 I often see constructor functions that just call an init() function. Why have an init() function if you can just put the contents of the init() function in the constructor? 回答1: An object's constructor is called only once per instance, whereas an "init" function may be called multiple times. Consider the following code: public class Foo { private var initialized:Boolean = false; public function Foo(id:String = null) { _id = id; if (id) init(); } private var _id:String = null; public function

seeking not working in flex 4.5 netStream byteArray

杀马特。学长 韩版系。学妹 提交于 2019-12-24 03:40:35
问题 I am trying to play a flv video file in flex 4.5 with netStream byteArray. What I am doing is below: Creating a netStream and video object Attaching a netStream with video Reading flv file in byteArray Append byteArray in netStream using "appendBytes" method Playing video In this scenario Play, Pause, Stop functionalities are working fine with video. But when I am trying to seeking in video then it is not working. You can follow the code what I am doing by clicking on the link http://pastebin

How to create a textbutton in Flash using ActionScript 3?

旧时模样 提交于 2019-12-24 03:18:05
问题 When I tried using a textfield as a button, it seems it is not having the buttonMode property. How can I programatically create a text button using ActionScript in a Flash project. It should be a simple text, which is clickable. 回答1: You can add the TextField to a Sprite and use it as the button. buttonMode is the property of Sprite class. If you really want to use just a TextField , you can assign an anchor tag <a href="event:something">label</a> to its htmlText or listen to mouseOver and

How to set Video Frame Capture Using Bitmap Data

六眼飞鱼酱① 提交于 2019-12-24 03:11:09
问题 I'm implementing an Augmented Reality application for android using Flash. In order to get the application working on my Android Phone (nexus One) the Phone Camera must be activated as well. So I need 2 layers one for the background which is the feed of my phone camera and an other one on top of it which is the view from away3d in this case. So setting up a BitmapData object to hold the information of the most recent webcam still-frame I can make this work. If I use papervision3D library and

fluidly dealing with multiple keypresses in ActionScript3

喜你入骨 提交于 2019-12-24 03:03:37
问题 I'm currently building an engine for a platformer game at the moment, but I've noticed that ActionScript3 is having difficulty in keeping fluid when multiple keypresses are in use. For example; function onKeyDown(event:KeyboardEvent):void { if (event.keyCode == Keyboard.UP || event.keyCode == Keyboard.W || event.keyCode == Keyboard.SPACE) { if (isTouchingGround()) { isJumping = true; yv = -100; } } else if (event.keyCode == Keyboard.DOWN || event.keyCode == Keyboard.D) { if (xv == 0) { player

Flash radiobutton: how do I get the selected radiobutton?

醉酒当歌 提交于 2019-12-24 02:49:06
问题 I have a few radiobuttons I drag and drop within same group. In main.as I added click event listener. How do I get the selected radiobutton ? handler target argument doesn't contain any reference to it. 回答1: Grab a reference to the current RadioButtonGroup and access the selection reference, this will return a reference to the current radio button that is selected in the group. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/controls/RadioButtonGroup.html http://help

Flash is not showing Errors/Stacktraces in debug player (firefox/chrome/whatnot)

一个人想着一个人 提交于 2019-12-24 02:44:26
问题 I am trying to debug application which fails on me silently online. I am a 100% certain that I am running the flash debug player. To even make sure I am not losing it, i throw an Error ON PURPOSE. But flash shows not a single stracktrace in the browsers. I am kind of close of losing it. Any clues ? I am trying this on chrome, and firefox. WTH? Compiling with FDT, debug mode, even set the compiler argument debug=true. This is normally not the case. I think my computer is going nuts or

five3d local3dtoglobal

我怕爱的太早我们不能终老 提交于 2019-12-24 02:42:40
问题 I am trying to use the Five3d package to draw a sprite in 3d and animate it then create a shape on the root of the app and overlay it over the sprite in 3d as it moves. I have tried everything to get it to work but can't seem to get it to line up properly. It looks like the perspective is out. I had it working after inspecting the relationship between the 3d x,y and global x,y which lead me to write the method 'local3dToGlobalXY' shown below but this only worked when the stage was 1024 / 768,

as3 rtmp video stream on localhost red5 path issue

大城市里の小女人 提交于 2019-12-24 02:09:34
问题 Below is a basic code bit in as3 flash.A simple video streaming example using rtmp red5. But i seem to be having issues connecting to the stream.I am using the same video files as given with the red5 server demo installation.( i have verified the installed demo of ofla by running it properly) my output trace traces out as a connection success and the play start of the video file. But i am unable to get its metadata or get it actually playing. netStatusHandler NetConnection.Connect.Success