mxml

Flex Custom Components Tutorial

I'm just getting started out with flex. Are there any easy to follow tutorials that give examples of creating custom components that pass data with custom events? ...

Mandatory attributes in MXML?

Is it possible, through some kind of metadata presumably, to force a property of an object to be set? We have a number of non-visual components that simply doesn't do anything unless one or more properties are set, such as: <ToolTip target="{this}"> <mx:Image source="foo.png" /> </ToolTip> In this case, the target property would b...

Using functions defined in other MXML files

Hello, I've got a Main.mxml file and a RoutePlanner.xmlm file. The RoutePlanner defines a custom Canvas components, and the Main.mxml uses that custom component. The problem is the RoutePlanner componetns contains alot of events, such as Click() and MouseMove() etc. However the functions those events reference to are all defined in Mai...

How do I set a focus property on a TextInput that is built using AddChild?

I have the following MXML: <mx:State name="myState"> <mx:AddChild relativeTo="{myhbox}" position="after"> <mx:Box verticalAlign="middle" horizontalAlign="center" width="100%" height="100%"> <mx:Form id="myForm" width="479" verticalScrollPolicy="off" horizontalScrollPolicy="off"> <mx:FormItem label="My Label:" fontW...

Best Practices: How do you code layouts in Flex?

Hi there. I want to code a simple form layout in flex. Something like the following: [label] [text field] [label] [text field] Initially, I've tried coding this using vboxes and hboxes for my layout. Like the following <hbox> <vbox> <label /> <textfield /> </vbox> <vbox> <label /> <textfield /> ...

Flex Warning: Unable to bind to property 'foo' on class 'Object' (class is not an IEventDispatcher)

I know this is a fairly simple question, but I'm sure I'm not the first to have it, and won't be the last, so I thought it might be a good idea to get the answer in Stack Overflow for the benefit of everyone else, as well as not bugging my local Flex guru. I've got an object that contains a dozen or so fields I want to bind to form elem...

React to change on a static property

I'm re-writing an MXML item renderer in pure AS. A problem I can't seem to get past is how to have each item renderer react to a change on a static property on the item renderer class. In the MXML version, I have the following binding set up on the item renderer: instanceProperty={callInstanceFunction(ItemRenderer.staticProperty)} Wha...

Get MXML and ActionScript Classes out of swf

Hi there I want to know how secure Flex is. Is there a possibility to generate the source out of the swf-file? I mean for example if I have my Actionscript and MXML files and compile them to a swf, can I get the source back out of the swf file? With kind regards Sebastian ...

Is it possible to create a MovieClip using ActionScript 3 code or MXML?

I'm using the Flex 3 SDK and the free FlashDevelop IDE. As I don't have FlexBuilder or Flash CS4 Professional I cannot make MovieClips graphically. So instead I want to create a simple MovieClip using code or MXML. For example, lets say I want to create a MovieClip with 3 frames, and load a bitmap into each frame to create a simple ani...

Dictionary declaration in MXML, is it possible?

In MXML it's possible to declare object instances, even for dynamic objects, like so: <mx:Object> <mx:foo>bar</mx:foo> <mx:bar>foo</mx:bar> </mx:Object> Is it possible to do the same with the Dictionary class without using some MXML wrapper class? ...

Is it possible to get a custom ItemRenderer to scroll the DataGrid rather than its cell?

I'm having an issue with a custom ItemRenderer I've written for a DataGrid. With this ItemRenderer, it's possible that the contents could exceed the width and height of the DataGrid cell - and when this happens, scroll bars appear, letting me scroll the individual cell. What I would like, however, is that when the contents of the cell a...

Flex design view not working for components with custom base class

I have a Flex component that, instead of inheriting directly from Canvas, inherits from a custom class (MyBaseComponent ) that I wrote which in turn inherits from Canvas: Canvas > MyBaseComponent > MyComponent (mxml) Design view does not work for this control. I just get a blank gray screen. (It works if I use Canvas instead of my cu...

How to split text by lines

Flex 3. I created a TextArea object. Then I typed some text in it. Then i got this text useing TextArea.text property. How can I split text I got by lines and convert it to the array of strings? ...

How do I compile multple independent mxml files at one time?

Our application has over 15 different top-level mxml files to create individual controls that are used in our pages. We are using Ant to do our automated builds, and are calling the mxmlc task for each mxml file separately (See question 78230 similar example). Running the compiler separately for each mxml file, however, is already ad...

How I can split AS code and MXML in Flex

In Silverlight I can write XAML definition and script logic in different files and it is very convinient are there any way to do same stuff in Flex? ...

Actionscript 3 and mxml... blocking while waiting for an event

I am writing a mxml component <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" preinitialize="onPreInitialize();" "creationComplete()"> <mx:Script> <![CDATA[ private function onPreInitialize():void { addEventListener( "RemoteResourceLoaded", remoteResourceLoaded ); loadARemoteResource(); } ]]> </mx:Script> I have ...

Flex/AS3 - does anyone know how to take an AS3 display list, and create mxml from it?

I've been struggling with how I can build mxml from the displaylist created within an application. For example, create a number of components on a canvas, then click a button to get a formatted xml document, in mxml, of the canvas and its properties. Is there a simple method for this? Many thanks for any help... ...

Flex: What's the difference between an MXML "Component" and an MXML "Module"?

As the title suggests, what's the difference between a "Component" (New –> MXML Component) and a "Module" (New –> MXML Module)? Thanks, David ...

Change column width in Flex Grid

I'm using a mx.containers.Grid to layout some data, and the last column is a set of checkboxes. MXML Code snippet: <mx:Grid width="95%" height="50%"> <mx:GridRow id="row1"> <mx:GridItem> <mx:Label id="label1" ... /> </mx:GridItem> <mx:GridItem> <mx:Label id="textValue1" ... /> </mx:GridItem> <mx:GridIte...

What does {variable} do in flex

I have been using { } around variables in MXML without really understanding what they are for. I am now needing to know if I should use it around a variable..what does that do? example: <mx:label text="{variable}"/> ...