actionscript-3

Slow sorting on datagrid column with custom item renderer

We have a Flex DataGrid with 3 columns of which one of them has a custom inline itemrenderer that renders an icon in the cell via an Image component, depending on the data in the row. The problem is now that sorting this column is incredibly slow. It's OK when we only have a few rows of data in there, but as soon as we have a few hundre...

How to modify position of children inside loop in AS3

I'm trying to make a dynamic image gallery from and xml. From my tutorials, right now i've got it so it will constantly add the next thumbnail below the other, which is fine, but I'm trying to figure out how to make it that once it reaches a certain y coordinate, it will move the x coordinate over and stack them again. So that rather one...

Is ActionScript 3 Dictionary a hashmap?

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/ The dictionary does what I need but I do need to care about performance. Does anybody know if the Dictionary is implemented as hashmap? ...

Problems positioning Flash graphic drawn with Graphics Class

I'm using Flash CS3 to build a simple drawing application. When the user clicks a button, they select a particular movieclip. After clicking elsewhere on the stage, the clip is instantiated and added to the stage at the position of the cursor. I've also added the option of being able to click on the added clip and drag it around on the s...

ActionScript 3 event forwarding illegal?

If I do this stuff.addEventListener(FooEvent.NAME, function(e:FooEvent) { dispatchEvent(e); } I get a runtime error saying that Event cannot be converted to FooEvent. However, it works fine if I do: stuff.addEventListener(FooEvent.NAME, function(e:FooEvent) { dispatchEvent(new FooEvent(e.things)); } Why? ...

Actionscript Retrieving BitmapData From Sprite Mouse Event

i've created a bitmap with data and placed it into a sprite so to receive mouse events. however, i'm struggling with reading the BitmapData within the sprite. function showBitmapData(e:Event):void { var bData:BitmapData = new BitmapData(video.width, video.height); bData.draw(video); var bmap:Bitmap = new Bitmap(bData);...

Flash CS4 Actionscript 3.0 --- Make my script loop!

Here is my script... all I want to do is have it continuously loop! import fl.transitions.Tween; import fl.transitions.easing.*; yourwebsite_mc.visible=false; var uptodateFadeTween=new Tween(uptodate_mc,"alpha",Strong.easeOut,0,1,3,true); var uptodateRotateTween=new Tween(uptodate_mc,"rotation",Strong.easeOut,360,0,3,true); var uptod...

Get object identity in ActionScript 3

For debugging purposes I'd like to trace the internal ID of some objects. You know, the stuff you get in error reports sometimes, SuperObject@a8D7a2 Is this possible? ...

Why does obj.getBounds().height give a larger height than obj.height?

I'm new to Flash and ActionScript, but managing quite nicely. One thing that is continuously getting in my way are the width and height properties of DisplayObject(Container)s. I'm finally starting to get my head around them and learned that the width and height of a Sprite are determined solely by their contents for example. I do not u...

as3: using an object to pass arguments in any order - class configuration

I want to pass through configuration arguments to a class. These are all the optional vars that go into configuring the class - and should be able to run in any order. at the moment i just pass through the optional vars the regular way. Supposing the constuctor was like the following: private var _reqVar:String; private var _optVar1:St...

Recording and saving sound from Flash AS3

How can I record and save sound in flash AS3. I have writing access to the server and also access to PHP files. Any ideas? ...

How can I trigger a transition effect when a child control is added or removed in flex?

I've got a custom component that has children components dynamically added and removed to it depending on what button the user clicks. What I would like to do is trigger a transition effect that moves the child component onto the stage when it's added and then moves it off when it's removed. Does anyone have a good example on how to acc...

load library objects by string list, AS3

How do I load library objects by string list using Flash and AS3? I need to understand string lists, arrays, and sprites better. WHAT I WANT TO DO Load enemies to stage using a string list "Orange ball, red ball, green ball etc" EXPLANATION The tutorials I've been given are too basic, or they are incomplete examples that don't explain...

FAMES or AMES for Flash development? Open source alternatives to Flash CS4?

Hi, A brief preface: I'm in a game design class where our project for the next 4-6 weeks will be to create a Flash game. The group is 5 people, one of whom is a digital artist in another department. Our digital artist will be supplying images/music where appropriate, but won't be using Flash CS4 (probably Photoshop or another image ed...

age calculation in Flex

I'm trying to calculate age in flex. I've found this previous question http://stackoverflow.com/questions/41763/what-is-the-best-way-to-calculate-age-using-flex I'm sort of leaning towards this private function calculateAge(dob:Date):String { var now:Date = new Date(); var ageDays:int = 0; var ageYears:int = 0; var ageRmdr:in...

flex: Refrashing cusom mxml component on button click

Hi! I have defined small MXML component which calls web service which returns random number on request, then my component displays the number. How do I refresh the MXML from main application control, so it will recall server again? ...

How can I determine a function's argument count at runtime in Flex 3?

I want to pass an optional data parameter to some callbacks, but only to callbacks that support a single parameter; right now, I have a moderately-sized code base of callbacks that cannot accept a parameter at all. How can I check what parameters a Function object supports? ...

AS3: How to print current class in trace statement for debugging?

Is there a statement in AS3 that will return current class and/or scope? I'd like to use that in trace statements so that I know the exact location of a trace. Thanks. ...

ActionScript 3 in other runtimes besides Flash?

I find ActionScript 3 one of the best high level dynamic languages out there, but because it only runs in Flash/Flex/AIR (to my knowledge) its uses are fairly limited. Are there alternative and/or generic runtimes available which would allow running it on a server, or on the desktop without the Flash API? I suppose not, but is there a c...

Actionscript VerifyError: The ABC data is corrupt, attempt to read out of bounds.

Getting a VerifyError using the TweenMax lib when calling TweenMax.to. This error doesn't seem to be specific to TweenMax (we've found other people having errors with unrelated code). Perhaps someone has some insight into what this error means and what could be causing it. Edit Seems like it's something to do with Anonymous functions: ...