actionscript-3

Actionscript 3 return types - is a * return type ok to use?

Hi, I have a function in which I'd like to return an Object or false. Is a return type of * ok to use? are there any downfalls to this? (besides it being a bit lazy in some cases). ...

Flex: Bind values in a List with ComboBox as Item Renderer

I am using a List with an ArrayCollection as a DataProvider. The list uses ComboBox as Item Renderer itemRenderer="mx.controls.CheckBox" I would like to bind the values in the List. You have a list with several comboboxes, and those values are loaded dinamically from an ArrayCollection. The ArrayCollection contains Objects with a ...

AS3: Accessing global variables

i'm confused with the term "global" in AS3. within my main controller class, i've defined a variable (myNum) which i would like to access throughout all class .as files within the same package. //Controller class package myApp { public var myNum:int = 24; //try to access myNum in mySprite class public class Main extends Sprite {...

Actionscript not running in nested MovieClips in Swf loaded into AIR app.

I'm loading content swfs into an Air App. The swfs are loaded into the non-app sandbox, and any communication is via the parent/child sandbox bridge. The swfs have timeline code. This code executes fine. The swfs also have mcs on the timeline - any code inside these mcs, or any child mcs of these mcs, is ignored. Simple traces do not ...

What is the display list in Flash 10? Array? Linked list?

I'm working on a game that has many elements on stage, so I'm looking to optimize my loops. I know that Vector is faster than looping an array, but I'm also in some cases using: while (i < numChildren) getChildAt(i) ...to update sprites. My question is when I use getChildAt, is that accessing an Array or Vector or linked list or...

movieClip in Array displays null, and aren't showing up on stage.addChild(Array[i])

i am new to Actionscript3, i need to know why i keep getting Parameter child must be non-null. And my code won't display 5 enemyBlock objects onto the stage but only just one. any tips and help will be much appreciated. thanks in advance. returns: TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayO...

ActionScript3: How to start different moviclips one by one.

i started learning ActionScript3 and now i´ve got a problem: I want to start moviclips one by one on the same stage. For example: mc_A plays and in the end it starts the mc_B to play. than mc_B plays and starts in the end the mc_C .... other idea: the moviclips start at different times with a timer? I hoppe somebody can help me, cause ...

Embed Youtube video in Flash CS4?

Is there any way to play Youtube content in a Flash movie without using a third party plugin? I'm using Flash CS4 and Actionscript 3.0. ...

Is it possible to change the FLV's frame rate programmatically?

I have tried with stage.framerate but It doesn't seem to work. Is there a way to adjust the FLV's framerate at runtime? ...

Button STILL not working with FLASH CS4

Okay, I have absolutely NO Compiler/Output errors anymore...however, the buttons are still not working? Any suggestions? Replay_btn.addEventListener(MouseEvent.CLICK; replay); function replay(event:MouseEvent):void{ gotoAndPlay(25);} WHAT THE HELL IS WRONG!!! PLEASE LET ME KNOW!!! ...

Flex Validator -- Show Red Error Border on DataGrid Cell

I can successfully add a validator on an item in my datagrid, by passing in the particular element in the dataProvider to the validator, but I can't get the red border to show up around the cell if the validation fails. I have stepped through the validator, and confirmed that it is passing back a failure, but I can't figure out why the...

Find closest number in range?

What is the best way to find the closes value in a range... for example i have an array with 0, 90, 180, 270, 360.. And a number 46... What is the best way to find 90 in the array? (in actipnscript 3) ...

Wmode transparent and symbols issue with foreign keyboard

Hello, I have the known issue with wmode transparent and input textfield in my page. I know that the question is often asked but I have a special situation with that case. I need to embed my swf with wmode=transparent but in my swf I have an input textfield and the bug with "@" or "." symbols exists. I have a french keyboard and I dec...

creating button

I managed to put texts on screen now I want to show the text after the button is clicked but the button does not appear. Here is the code. package { import flash.events.MouseEvent; import flash.media.Camera; import mx.controls.Button; import flash.display.Sprite; import flash.text.TextField; public clas...

Default parameters in ActionScript 3.0

I have a function, for example function test(p1:int=7,p2:Boolean=true,p3:uint=0xffff00,p4:Number=55.5) { //instructions } How to change only p4, for example, and parameters p1,p3,p3 was still default? Next time I want to change for example only p2, and parameters p1,p3,p4 was still default? etc. ...

How do you play an external .mov file in actionscript3?

http://stackoverflow.com/questions/840213/how-do-i-load-a-mov-file-into-flash-9 I checked this post out and it looks like the normal way for adding a flv, but it tried it on some sample .movs from apple and doesnt seem to work. Do movs have to be encoded specially for playback in flash? ...

Flex/actionscript 3 equivalents for __FILE__ and __LINE__

Hi all, I'm quite new to flex/actionscript and I was wondering if there is an equivalent for php's (and other languages) FILE and LINE identifiers? Basicly I want to do some custom error logging and would like to something like: var mymessage:String = 'Oops, a hiccup occured at ' + __FILE__ + ', line: ' + __LINE__; Where file and ...

How to handle collisions detection with multiple instances of one movieclip?

I'm using Adobe Flash CS4. The language is Action Script 3 In my library I have 2 items: player wall the player object is already functioning correctly with moving him around. Now when I place multiple wall objects into the stage (wall = 32x32 px) I want to prevent the player from moving when he walks into a wall. I've tried giving...

casting variables to movie clip

How i can convert gecko object to a movie clip function finish(boxname, arrayname:Array):void { for each (var item:String in arrayname) { trace(boxname+"_"+item); var gecko:MovieClip = (boxname+"_"+item) as MovieClip ; trace(typeof(gecko)); gecko.gotoAndPlay("glow"); } } i get the following error high_hsymbol_...

Concat E4X expressions in ActionScript 3

Is there any way to concatenate E4X expressions? If I store "half" a path in a variable, can I concatenate the way I do with Strings? ...