flex

setActualSize() with Label components confusion

If you are extending UIComponent and you add a Label component to your custom component it seems you have to use setActualSize() in order for your label to appear. The problem is I don't know what size the label is going to be as it depends on the length of the text and the font size. Sometimes this works: label.setActualSize(label.getE...

Flex: Label.addChild() not working?

I want to make a label that has a tiny title above it, for example so the label say $1,000 with a small retail price or our price above it. I am trying to add the title label to the display list of the main label. I get no error but the title does not show up. I also considered rawChildren but apparently Label has no rawChildren property...

How to place certain files in the root directory of the Grails server?

I am using a grails application as backend for a Flex frontend. To be able to easily develop and debug my applications I would need to place a crossdomain.xml file into the root of the server, i.e. it must be accessible via http://localhost:8080/crossdomain.xml. Similar use cases might be the deployment of a favicon.ico or a robots.txt, ...

Flex: How do I space out items in a HorizontalList control (using a custom ItemRenderer)

I have a HorizontalList control that uses a custom ItemRenderer to represent each item as a toggle-button. The list allows drag and drop, and I used this method to rotate the drop feedback (line) into a vertical position instead of horizontal, but with the buttons mashed together, the drop feedback is pretty subtle. I'd like to space out...

Flex/AS3 Problem listening to an event dispatched from a Singleton Class

I have a singleton class for global access to config information. This singleton class called ConfigurationData extends EventDispatcher. Here is the class (note that I left some things out like variable declarations to keep this short): /** * Dispatched when the config file has been loaded. */ [Event (name="configurationLoaded", type=...

How to create/use themes in a Flex project

I just started out with Flex, and while I have worked with Actionscript2 for a few years, I'm still getting my head around Actionscript3. I've been diving into Flex for the past week, and can't figure this one thing out. I am looking into the best way (or 'a' way) to allow me and other folks working on this project to easily create new ...

Do you know 1024 Overriding a function error on flex (flash )in action script 3?

In my project i used this below function public function createIconMenu():NativeMenu{ var iconMenu:NativeMenu = new NativeMenu(); iconMenu.addItem(new NativeMenuItem("", true));//Separator if(NativeApplication.supportsSystemTrayIcon){ iconMenu.addItem(showCommand); showCommand.addEventListener(Event.SELECT, onShowCommand)...

How does Flex/Flash free its memory ?

What is the best way to Free Memory in Flash ? Does it have a Garbage Collector ? How to invoke that GC ? How to make Objects applicable for Garbage Collection ? I have a Website which displays a lot of charts. I observe that the memory that the IE uses while we display these charts continues to increase and sometimes reaches around 500...

how to store bitmaps into arrary in flex (action script3) ?

In my project i used image array with 16+16 32+32 48+48 128+128 different size of image for system tray icon but i put on bitmes then shows Error #2005: Parameter 0 is of the incorrect type. Should be type BitmapDat. public var imageURLs:Array = ['icon/toy.png','toy32.png','TOY48.png','joy128.png']; NativeApplication.nativeApplicatio...

Flex: bind a label's fontSize to be half the size of another label?

Is there a way to bind a Label's fontSize to be half the fontSize of another label? I tried this: <mx:Label id="mytitle" text="{title}" fontSize="{(mylabel.getStyle('fontSize') as Number)/2}"/> No luck...anyone know a way? Thanks ...

Flex: The CSS type selector was not processed because the type was not used in the application

When I use a custom skin for my app I get these warnings all over the place. Yes I know why. But I don't need to be told this, and I don't like all the yellow icons cluttering up my workspace. I know if I remove the unused classes they will go away but 1) if later I decide to add a component I want the class to be in-place to style it an...

Pass data between flex components

I'm new to flex , so forgive me if this is a dumb question. Right now I'm using custom events to pass data from one component to another. My problem is that events only bubble up. How can I pass data to a component that isn't a parent of the component dispatching the event? Here's the basic layout. I'm trying to get data from compone...

Flex Chart Labels don't update on data refresh? (pic)

Hello all, I am having an issue where the chart labels on my Flex Pie Chart don't go away when the data is refreshed. In the picture above, the left/before chart is how the chart loads by default. By choosing another item from a drop down, the chart changes to the right/after chart, but the "At Risk" label does not go away. The sam...

Using Flash Runtime as Platform (similar to JVM / CLR)

Does anyone know whether any compilers exist to produce programs that will run on the Flash runtime from source code other than Flex? i.e. similar to how Groovy, Scala, etc compilers generate bytecode for the JVM. ...

How do you work around the need to cast an interfaced object back to its base class?

This question is meant to apply to interfaces in general, but I'll use AS3/Flex for my language. It should be [mostly] obvious how to apply it in different languages. If I create a base class, and it extends an interface, there is an explicit contract defined: for every method in the interface, the base class must implement said method...

Mate Framework - Check data before making remote call

Hi, Until recently I have been using cairngorm as a framework for flex. However, in this latest project I have switched to Mate. It's` still confusing me a little as I kind of got used to leaving data in the model. I have a couple of components which rely on the same dataset(collection). In the component the creation complete handler sen...

Why does the Flex compiler generate varying file sizes on successive compilations of the exact same source code?

I'm building a SWF using the command line compiler mxmlc.exe. The compiler writes the output file size as part of it's stdout. If I run the compiler multiple times in succession without changing the actual source code, I see the file size bounce up and down a few bytes at a time. C:\>mxmlc.exe Gallery.as C:\Gallery.swf (28443 bytes) ...

How do I reference a Global class from a class with the same name in ActionScript?

Due to requirements outside of my control (don't ask, it's ridiculous) I need to create an AS3 class called 'Math' that references the Global AS Math class. So, for example: package my.package { public class Math { public static function pow( a:Number, b:Number ):Number { // How do I call the Global.as$Math#...

Scroll content in SWFLoader (Flex 3)

Hi. I have to load huge (3000x3000) pictures in SWFLoader, and no problems with that — everything works fine. But on low resolution displays (like 1024x768) i can see only a part of picture. So i need some kind of scroll bars to scroll around a picture. How can I do that? Please help, because i simple have no idea. Thanks! ...

Flex book recommendations

I am a .NET developer, but I have started learning Flex. I made a basic site in it, but I have never truly mastered the declarative nature of the syntax. Then again, my job is writing C# code so there is quite a difference. I've seen several books, but I am not quite sure which is the best. Also, some of the stuff I lack practise in (b...