flex

Compiling mxml files with ant and flex sdk

I am just getting started with flex and am using the SDK (not Flex Builder). I was wondering what's the best way to compile a mxml file from an ant build script. ...

.NET and AMF

How can I get a ASP.NET (inc MVC) application talking to a Flex UI over AMF. I am wanting to push approx 100+ records around at a time and AMF would appear to be the way forward, but there doesn't appear to be anything obvious. ...

Best way to get the color where a mouse was clicked in AS3

I have an image (mx) and i want to get the uint of the pixel that was clicked. Any ideas? ...

How to handle errors loading with the Flex Sound class

I am seeing strange behaviour with the flash.media.Sound class in Flex 3. var sound:Sound = new Sound(); try{ sound.load(new URLRequest("directory/file.mp3")) } catch(e:IOError){ ... } However this isn't helping. I'm getting a stream error, and it actually sees to be in the Sound constructor. Error #2044: Unhandled IOErrorEvent:....

How to set an HTTP header while using a Flex RemoteObject method ?

I am running blazeds on the server side. I would like to filter http requests using an http header. My goal is to send extra parameters to the server without changing the signatures of my blazeds services. On the client side, I am using Flex RemoteObject methods. With Flex WebService components, it is possible to set an http header us...

Is there another way to integrate PDF viewing in a Flex application?

I'm looking at ways to embed PDF viewing in a Flex application. Currently the only option I've seen is by using the flash.html.HTMLLoader class, which only works if you're using AIR. This isn't a big deal -- I'm willing to use AIR if I have to -- but based on my experimentation with viewing a PDF this way it appears that AIR simply inte...

Time Parsing in Flex

Is there any way to parse a string in the format HH:MM into a Date (or other) object using the standard libraries? I know that I can parse something like "9/17/2008 10:30" into a Date object using var date:Date = new Date(Date.parse("9/17/2008 10:30"); But I want to parse just 10:30 by itself. The following code will not work. var ...

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...

Setting Page Title from a SWF

Is it possible to set the title of a page when it's simply a loaded SWF? ...

Flex Framework - How to tell if user is using cached framework?

I have a public facing application deployed with Flex. I want to switch to using the cached framework (.swz) but need to know if for my user base this is an effective solution or not (most users will only visit the site once and its just not worth it). What I want to do is track whether or not a user has loaded the .swz/.swf file during...

Get Flex app's position on a web page?

Is it possible to get the x,y coordinates of a Flex app within an HTML page? I know you can use ExternalInterface.ObjecID to get the "id attribute of the object tag in Internet Explorer, or the name attribute of the embed tag in Netscape" but I can't seem to get past that step. It seems like it should be possible to get a handle on tha...

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. ...

What is a cairngorm "Comparator"

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

Controlling flex chart axes

I want to use small flex charts with just 3 labels, for example a chart over the past 2 hours , with 3 horizontal label, as shown below: | | | 9:46 10:46 11:46 (of course, there are more than 3 values to display!) I have been told this is not trivial, but how would you do it? Also, do you know of any books ...

Can I generate a Flex web and Air desktop app from the same source code?

I'm new to Air. I've got an existing Flex 2 application which I'm considering bringing into Flexbuilder 3. My question is can I use the same base application (and source code) to make the Air version, or would I have to maintain to separate code trees: one for the Air version and one for the Flex/SWF version? ...

How to get a Flex project to load a plugin at runtime?

I'm looking to have a couple of plugins in a Flex project I'm working on. I know I can load a SWF using the SWFLoader, but I thought in Flex3 you can now have Runtime Shared Libraries or something. Does anyone have any good documentation on loading a plugin at runtime? Ideally I'd like to be able to load a plugin from a URL, then execute...

Sniffing traffic between a Flex app and ColdFusion backend

What is a good strategy for sniffing/tracing function calls between a Flex application and a ColdFusion-based backend running on ColdFusion server? I understand they use AMF protocol. I'm used to using Fiddler to sniff transactions between HTTP clients and servers, and it works great as long as you're using plain text or XML HTTP reques...

Flex best practices ?

I have the feeling that is easy to find samples, tutorials and simple examples on Flex. It seems harder to find tips and good practices based on real-life projects. Any tips on how to : How to write maintainable actionscript code How to ensure a clean separation of concern. Has anybody used an MVC framework such as cairngorm, puremvc o...

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...