mxml

Flex Mxml and property as string, escaping ?? Help

Hi, A simple problem: If i use escape characters for a property such as <mx:Image id="img" toolTip="\\foo{\\bar}" It wont validate toolTip and therefore not compile. What is the solution ? ...

Allow custom text representation of data in MXML

Hello, I have an actionscript class called Dimension, which allows a client to specify a dimension using a value and a unit such as "CM" or "Inches". I want to use an instance of this class as a property in MXML, so a user can write <DimensionView value="2cm"/> How do I make "2cm" an accepted string value for Dimension? I assume I ne...

Mxml and as3 confusion [simple]

Hi, I was wondering i can call an as3 function defined in script from mxml code just like this: <mx:Line x="translateX(xmin);" .. > <mx:Script> <![CDATA[ // do some basic math private function translate ... If not possible do i have to convert everything to as3 ? Thanks ...

How do I implement data binding in an ActionScript Class?

I am having a problem with binding values in my ActionScript components. I basically want to set the value of a a variable in my component to a value in the model, and have the component variable automatically update when the model value is updated. I think that I just don't fully understand how data binding works in Flex - this is not a...

Flex: How does the compiler know about dependencies?

Hi, I'm completely new to Flex and am just having a play with a sample application from the Mate framework. I'm hacking on Linux so I'm using the command prompt and a text editor rather than Flex Builder. The sample app has two folders in its root directory lib & src. Lib contains a dependency. How can I compile the mxml file in src, s...

Flex 3 - Must I add components before setting their attributes when using AS3?

Let us say that I have a Flex 3 mxml component, call it A. A has a get/set attribute called 'b'. Within A I have another internal component C, which is specified using mxml. When "instantiating" component A within mxml, I can specify the value of b at declaration, and everything works fine. However, when I initialize the component using ...

Using HTML formatting to output variables in Flex/MXML

Hi, I'm trying to output a sentence containing 4 variables, with their values emboldened using the following code: <mx:Text width="100%" y="307"> <mx:htmlText> <![CDATA[Showing data from <b>{labelStartTime.text} {labelStartDate.text}</b> to <b>{labelEndTime.text} {labelEndDate.text}</b>]]> </mx:htmlText> </mx:Text> Ho...

MXML without Flex Framework/Components

The Flex compiler can compile "pure AS3" SWF files that don't contain any Flex Component bytecode. So, Would it be possible to create a custom component framework (used in place of the Flex Framework), that can still be visually laid out using MXML (read: markup), and compiled down to a SWF without any dependencies on the Flex Framework...

Can I bind a Flex component property to a function?

I want to set the enabled property on a button based on the return value of a function that has one or more parameters. How can I do this? private function isUserAllowed (userName:Boolean):Boolean { if (userName == 'Tom') return true; if (userName == 'Bill') return false; } <mx:Button label="Create PO" id="createPOBut...

MouseEvent.MOUSE_DOWN over mx:TextInput

I'm working on a simple flex / AIR application with just a mx.TextInput control and some button. I'm not using the system chrome. less or more the mxml is this: <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="495" height="316" creationComplete="init()"> <mx:TitleWindow width="481" height="84" ...

Compc (Actionscript Library Compiler) Doesn't Fail Unless I Delete the File First?

Here's the scenario: I run compc on a source directory to recompile an already existing library after some changes, which completes successfully. Then I remove the library (the .swc file) and re-compile, which causes many errors to be thrown. Nothing changed in the interim - clearly this should have either succeeded both times or failed...

Is it safe to use a component reference in mxml

Consider the following radio button example. <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&gt; <mx:Script> <![CDATA[ private function getRb1():RadioButton { trace(rb1 == null); return rb1; } ]]> </mx:Script> <mx:VBox> <mx:RadioButtonGroup **id="rbg" selection="{getRb1()}*...

flex 3 accessing main mxml from actionscript code

hi, im writting an actionScript class to handle my web service calls. When i retrieve a result i want to call a setter method in my main mxml application. My problem is that i dont know how to access the methods in the actionScript section of my main mxml class from my actionscript class, any ideas? ...

Deleting XML nodes from within a flex repeater doesn't work?

I have the following repeater code: <mx:Repeater id="chapterRepeater" dataProvider="{Library.Book.Chapter}"> <mx:FormItem label="Chapter" direction="horizontal"> <mx:TextInput width="100" text="{ chapterRepeater.currentItem.@Name}" change="event.currentTarget.getRepeaterItem().@Name = event.target.text"/> <m...

Problem with handling keyboard events inside a Canvas using Flex.

For some reason, the event listener I define never seems to receive any events, although I believe it should. Here's a very short description of the MXML code I'm using: WindowedApplication VBox (root box) MenuBar TabNavigator VBox (first tab) Canvas VBox (second tab) If I ad...

With the Adobe Flex SDK 3.0 (most recent), can you create 'charts'?

Just googling on the web, it looks like you can't. It seems you need the Flex builder. I was trying to avoid the fully GUI tool. Is there a way to bypass this? ...

Is it feasible to maintain a Web Application designed in Flash with Flexbuilder

I'm starting a new job Monday and part of the job description is to maintain outsourced Flash web pages that only consist of Rich UI Forms and very little animations. I don't have any experience with Flash or Flex but being a programmer the Flex IDE appears to be much more suitable to me, which brings me to my question: Can I maintain ...

Problem with dispatching custom event in FLEX

Let me start off by saying that I'm pretty new to flex and action script. Anyways, I'm trying to create a custom event to take a selected employee and populate a form. The event is being dispatched (the dispatchEvent(event) is returning true) but the breakpoints set inside of the handler are never being hit. Here is some snippets of my...

Access to elements defined in MXML from External AS

Hi guys, I have a mxml with a form, and inside it, two TextInputs. I hate having any piece of code inside the MXML file (I come from a Javascript formation) so I use a mx:Script source="external.as" tag to include any code used in any MXML file. The problem is that if I have this code on the external.as file: private function popul...

Flex: Passing MXML file as XML Parameter

Hi, Is it Possible to pass MXML it self as parameter(XML param) from external application and load in Flash Player dynamically to create page. For e.g passing xml = <mx:canvas><mx:label text="hello" /></mx:canvas> to Flex and flex should create canvas with label control in it. Is there any example related to it. Thanx ...