actionscript-3

how to sort a flex datagrid according to multiple columns?

I have a datagrid, populated as shown below. When the user clicks on a column header, I would like to sort the rows using a lexicographic sort in which the selected column is used first, then the remaining columns are used in left-to-right order to break any ties. How can I code this? (I have one answer, which I'll post below, but it ...

In Flex/AS3, how do I get a class definition of an embedded asset with getDefinitionByName

I have a class with many embedded assets. Within the class, I would like to get the class definition of an asset by name. I have tried using getDefinitionByName(), and also ApplicationDomain.currentDomain.getDefinition() but neither work. Example: public class MyClass { [Embed(source="images/image1.png")] private static var Image1...

How can you tell programmatically if a Flex App is running in debug mode?

Is it possible to write code in a Flex application that will only be run in a debug build, or when running through the debugger? Does Flex provide a way to actually remove code entirely from release builds, like C-style #defines? The app is not necessarily running in a web page. ...

Change value of attribute on an XML object in AS3

Is there a easy way to do this? Or do I have to parse the file and do some search/replacing on my own? The ideal would be something like: var myXML:XML; // ... load xml data into the XML object myXML.someAttribute = newValue; ...

Streaming audio with Flash / Actionscript 3 - Slow playback problem

I've written a simple Flash player for a Shoutcast stream. At first it seemed to work reliably, however about 5% of the time users experience slow playback where the stream plays at roughly half of normal speed. All files being streamed are MP3, encoded at 128kbps/44.1kHz, the same settings as used in the Shoutcast config files, so the ...

What is a cairngorm "Comparator"

Can anyone explain this in easy to understand terms? ...

Best Resources for Learning AS3

Let me star off by saying I am by NO means a designer. I'm interested in learning AS3, and was wondering what some of the best books/resources there are out there for an absolute beginner. ...

How to read the value of a text input in a Flash SWF from a Flex App?

I have a Flex application, which loads a SWF from CS3. The loaded SWF contains a text input called "myText". I can see this in the SWFLoader.content with no problems, but I don't know what type I should be treating it as in my Flex App. I thought the flex docs covered this but I can only find how to interact with another Flex SWF. The F...

Grab a ProgressEvent from a POST upload in as3

Is there any way to track the status of a posted upload in AS3? There is a ProgressEvent, but it gives data back about the response, not the actual POST upload. I'm posting binary data for an image, so it's usually in the 50-100kb range. The image data was generated inside Flash itself, so I can't use the upload method - at least as fa...

How's the ActionScript2 -> ActionScript3 learning curve?

I knew ActionScript and ActionScript2 inside out, but I've been away from Flash for a couple years. What's the magnitude of becoming fluent in ActionScript3 and the new Flash functionality? From Colin Moock's blog, I heard that some of the fundamental movieclip methods have changed... ...

Flash should open window in new tab, but instead it opens a new pop up on mac

using target="_blank" in the navigateToUrl with firefox on windows it opens in new tab, with firefox on mac it opens a 'popup', anyway how to make the window popup in a new tab on ff on mac as well? ...

What's the best way to port an application from ActionScript2 to ActionScript3?

Our application is written in ActionScript2 and has about 50.000+ lines of code. We want to port it to ActionScript3 and we're trying to find out what our options are. Do we have to do it manually or can we use a converter, and what problems can we expect? ...

Multiple local connections in flash - what's the better architecture?

I'm using localConnection in AS3 to allow several flash applications to interact with a central application. (Some are AS2, some AS3). The central application must use a seperate localConnection variable for each receiving connection (otherwise the second app that tries to connect will be rejected). But what about sending messages back...

Flex Builder 3 design view, css not being applied

I have Flex Builder 3 installed on two Windows machines and the same project on both of them. On one computer, the CSS styles I defined are shown in design view; on the other computer they are not applied. Is there any reason why it might not work on one? ...

AMFPHP service new service error

I am trying to add a new hello world service to amfphp, I am developing locally <?php /** * First tutorial class */ class HelloWorld { /** * first simple method * @returns a string saying 'Hello World!' */ function sayHello() { return "Hello World!"; } } ?> when exploring in the amfphp browser i ge...

Flash - Drag Two Movieclips at Once?

I'm trying to create a map application similar to this. Click the SWF Preview tab on the left of the image. Specifically, noticed how you can pan around, and the clickable buttons on the map move with it. Basically, how do they do that? My application has a map that you can click and pan around using a startDrag() function. I have a sep...

Anybody got an Actionscript 3 Youtube API / wrapper?

Google / Youtube has an API for Youtube for javascript and Actionscript 2. Unfortunately this API is not compatible with Actionscript 3 without a wrapper - which google does not themselves provide. Has anybody got an actionscript 3 wrapper they can make available? ...

Can Flash save content without server-side help?

As far as I know, Flash has to pass info off to another external process in order to save files - POSTing to PHP or talking to an executable, right? But every once in a while I hear rumors that Flash is able to open a file, make changes, then save/write those changes, all on its own - is it possible? ...

How do I use FlashVars with ActionScript 3.0?

I found this guide for using the flash parameters, thought it might be useful to post here, since Flash CS3 lacks a usage example for reading these parameters. See answers for the link ...

Problems with accessing FlashVars via parameters in AS3

I keep getting compiler errors when I try to access flashVars in an AS3 class. Here's a stripped version of the code: package myPackage { import flash.display.Loader; import flash.display.LoaderInfo; import flash.display.Sprite; public class myClass { public function CTrafficHandler() { var myVar:String = LoaderInfo(this.root.l...