actionscript-3

Flex Builder AS3 Project migration

Hi, I am developing a Flash game using as3, I chose flex Builder with an AS3 project. Now I am thinking that if selecting the project to be a flex project instead of as3 project I would have a lot of flex functionality like a swf loader,preloaders and the popup manager etc. The graphic components would obviously have been made in flash ...

AS3: Element stays on stage after manipulating the index(depth)

Here is the problem I have: after I change the index of one movieclip using this code oldIndex=getChildIndex(DisplayObject(e.target)); setChildIndex(DisplayObject(e.target), numChildren - 1); when I give the object its old index setChildIndex(DisplayObject(e.target), oldIndex); and go to another frame of the movie, this element I ha...

AS3: Showing bufferlength of NetStream

I am trying to show the buffered amount of a video that is playing. I am using netstream.bufferLength to do this and it kinda seems to be right. Exept from the fact that it is almost constantly the same amount that is buffered. This can't be right? I want it to be like youtube where you can press pause and the buffer will continue to ri...

Transition Manager event complete

Hi, I have the following code TransitionManager.start(babyPreloader,{type:Fade, direction:Transition.OUT, duration:0.5, easing:Regular.easeOut}); var tempPreloader:DisplayObject = babyPreloader as DisplayObject; this.removeChild(tempPreloader); But since this does not wait for the transition to complete. I can...

What language/API to use for a standalone live-input audio visualizer app?

I develop with Actionscript and was glad to see that AIR 2.0 was going to give access to mic input data. I planned to use this to create a visualizer set to the tempo of the incoming live audio. After doing a few days of google research it seems unlikely that it will be possible to analyze the data of the mic input in Flash/AIR. If anyon...

Multilingual Flash

How do you make a Flash movie (using Haxe, or Actionscript code rather than the IDE) that supports multiple languages? Can you detect the browser's language? Are there utility classes for managing the strings and selecting the appropriate one based on language? ...

In-game GUI in a Flash game

Hi! I'm currently working on my first flash title using Flex and AS3. At the moment I'm designing my in game GUI. The game is using double buffered rendereing using bitmaps and I want to add a textbox type control. Is it possible to use one of the flex controls in the rendering pipeline (while maintaining the text editing properties) so...

Arranging MC that is called from XML backwards.

I'm loading my MC from XML backwards, and its separated by 10 per pages. When it's loaded to the stage it could not be arrange accordingly to grids. And when I click at other pages to let it run another 10 before the previous loaded XML object, it does not add in to the Array(I've clear off the array before reload the XML) private funct...

moving between states I get an error in Flex.

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. so i have a function that runs in state1 and has a while(myCanvas.rawChildren.numChildren > 0){ myCanvas.rawChildren.removeChildAt(0); } //this code is definitely the problem.... I can move to state2, but when I move back to state1 i get the err...

Ambiguous reference when getter/setter have different visibilities

The following code raises an ambiguous reference to value at compile time: import flash.display.Sprite; public class Main extends Sprite { private var _value : Number = 0.; public function get value() : Number { return _value; } private function set value(v : Number) : void { _value = v; } public function...

Fast or asynchronous AS3 JPEG encoding

I'm currently using the JPGEncoder from the AS3 core lib to encode a bitmap to JPEG var enc:JPGEncoder = new JPGEncoder(90); var jpg:ByteArray = enc.encode(bitmap); Because the bitmap is rather large (3000 x 2000) the encoding takes a long while (about 20 seconds), causing the application to seemingly freeze while encoding. To solve...

Selecting text and focusing on a textbox

I'm trying to programmatically select the text in a textbox, and focus on it too, so that when the form is launch the user only has to start typing and it will replace what is already there. I've been using the code: stage.focus = _finalScoreTF; _finalScoreTF.setSelection(0, _finalScoreTF.text.length - 1); but it doesn't work...any i...

pass a number value to a Timer, XML and AS3

I want to pass a number value to a Timer. How do I do this? My number and integer values for other variables work fine. Error I get null object reference and coercion of value, because I'm not passing to 'timer' properly. I don't want to say my variable's a number, I want to say it has a number value. Variable //what I have now var t...

RangeError 2066, XML and AS3

I'm working with XML and Flash. I tried to pass XML values to my timer and got a Range Error. How do I fix this? My Error RangeError: Error #2066: The Timer delay specified is out of range. at Error$/throwError() at flash.utils::Timer() at svrReadyXML_fla::MainTimeline/frame1() My SWF 'Receives XML for Timer function' impo...

Flash Navigation - TV Remote control

What would be the best way to set up a navigation system that acts like a TV remote control using Flash and AS3? I'm building an interactive demo that will simulate playing content and voting on your TV, using navigation similiar to say "Direct TV's remote control". Navigating each page through your remote with assigned keyboard command...

ActionScript 3 Read JPEG quality

I am developing image uploader for Flash 10. Is there a way to read jpeg quality of the browsed images. ...

ActionScript 3.0 / AIR Cannot Convert VideoEvent to VideoEvent ?!?!?! HELP

I have made an AIR app that brings in local SWF files and displays them in an interface. One particular local SWF file contains a FLVPlayback component. On this component I've placed some event Listeners. vod.player_flvp.addEventListener(fl.video.VideoEvent.PLAYHEAD_UPDATE, vodPlayheadUpdate); vod.player_flvp.addEventListener(fl.video....

How to create a share button in AS3

I was wondering if anyone knew a good way of creating an AS3 Facebook share button? I need to be able to customize the title, description and picture. Thanks! ...

Understanding Flash SWC's imported into Flex Builder 3 and key framed animation

I am trying to understand what is going on in a SWC that I am importing from Flash CS4 into Flex Builder 3. Specifically I am using a SWC supplied by a Designer as the animation for a custom preloader (a subclassed DownloadProgressBar). The issue I am trying to understand is, once the FlexEvent.INIT_COMPLETE is fired, I cleanup by remov...

AS3 Regular Expression Question...

Can someone give me a regular expression that will verify if all the letters in the word "cat" were also in the word "coating" in the proper sequence? So for the word "coating", the RegEx will test true for "cat" but false for "act". ...