mxml

changing "enabled" value of a button during runtime in flex

i want to make a button disabled if a datagrid is empty and it should be enabled when there is atleast 1 entry.the entries in the grid are made at runtime.I tried this this is the button: <mx:Button id="update" label="Update Contact" enabled="{isButtonEnabled()}"/> and the function is defined as where dg_contact is the datagrid: publ...

mx:Tree not dispatching "itemClick" event when click on icon

I have a flex tree that worked perfectly fine when we set the defaultLeafIcon={null} and the folderClosedIcon and folderOpenIcon to {null}. We decided to put the icons back in and took out the nulls. Now they show up fine, but if you click on the icon instead of the label or the rest of the row, it seems to change the selected item, show...

Selecting MXML siblings with actionscript, like javascript?

I'm trying to get the sibling of an mxml tag similar to the way siblings are selected in javascript. Is this possible in Actionscript? For example, when I click the TextArea with id textarea1, I need it to tell me that the sibling has an id of rect1 so I can do further processing to it. <s:Group> <s:TextArea id="textarea1" click=...

Selecting id of TextArea (despite RichEditableText)

I'm trying to select the id of a textArea when it's focused in <s:TextArea id="textarea1" focusIn="selectId(event)" /> selectId(event){ event.target.id; } Problem is TextArea is made up of RichEditableText so target doesn't actually refer to TextArea. I've tried event.target.parent.id but still not getting there. Anyone knows how ...

Disabling itemrenderer Hovered state

My itemrenderer has 2 custom states, no hovered state, and no normal state <s:states> <s:State name="state1" /> <s:State name="state2" /> </s:states> When I initialize it, I force it to go to state2. The problem is that when the mouse rolls out away from the item, it relapses back to the first state state1. It's kind of weird ...

Moving Flex MXML Application into Flash

is it possible to move a flex mxml project into flash? i have the project complete in mxml with actionscript but due to the fact that flex is limited in its visual animations ( no timeline! ) i would prefer to switch to using flash. the project is relatively huge, all done in mxml and i cant just re-create it in flash, it will take mon...

Drying out/refactoring flex/actionscript code

I have something like 10 components that have code that's very similar, except for the target that it's applied to and some other minor differences. For example, I return xml to component1 and component2 that differs in this way: component 1: event.result.names.name component 2: event.result.phones.phone I then bind these to a List, ...

Problems with using MXML components as ActionScript classes

I have two MXML component files and try to work with them as classes. One of them has a simple function: GUIFriend.mxml <mx:Script> <![CDATA[ public function createName(f:Friend) { return 'friendProfile: ' + f.uid; } ]]> </mx:Script> And the other tries to use it: GUIFriendContainer.mxm...

Where is the normal button skin

I'm trying to copy/modify the spark skin for the default button, but not sure how to find that skin. When I hover over <s:Button and Ctrl + Click it, it takes me to the Button class, but there isn't any skin information there. ...

Can Rect rounded corners be different

When I use <s:Rect> to create a rectangle, I use radiusX to get rounded corners. Problem is all are the same roundedness. Is there something similar to Rect that lets me control the radius for each corner separately? If not, what's the best way to create this from scratch? graphics library or what? ...

How to set TextArea height to its content height

I have an mx:TextArea and I want its height to be the same as its content height. There is nothing fancy - just a text area and text that is not editable. I need a simple and reliable way to make the control fit and show all the text without vertical scroll - something like auto resizing. Also my control's text will be set only once and ...

Ideal UI markup language

A friend of mine and I are looking to start a project looking into accessible user interface (for blind users) design. There are a number of projects making existing GUI's accessible by tagging them with audio information but we're looking to work from the ground up and actually take input from a ML and create an accessible application....

Finding component's x,y location

I have a component that changes its location based on other elements. I'm trying to find its x and y position at different intervals, so I tried compname.x and compname.y. The x position seems to be working, but the y position is always 0. I'm guessing I need to play with localToGlobal or contentToGlobal or one of those conversions. Is...

Auto-detect position changes

I have a custom component Comp that gets its position changed as a result of interactions with other components, etc. I check for changes in its position by constantly checking its position at fixed intervals. I'm looking for a better solution (maybe an event-based solution) to monitor its position so I don't have to check constantly mys...

Determining which LineSeries a user clicked on within a LineChart, in Flex 4

I have multiple LineSeries within a LineChart, sort of like this: private var data:ArrayCollection = new ArrayCollection( [ { Time: 1, Bob: 5, Joe: 5, Sarah: 6 }, { Time: 2, Bob: 4, Joe: 6, Sarah: 7 } ]); public function doItemClick(event:ChartItemEvent):void { var hi...

Does spark List have something similar to itemsChangeEffect in mx list?

I'm trying to animate a list as I delete the top row. All the examples I can find use itemsChangeEffect to bind to the effect, but this property exists only in MX lists, not spark lists. Any idea how I can get the same effect done in Spark Lists? I'm trying to remove the top most item in the list with a slight fade out effect before t...

Best practice to implement back functionality in flex

I'm not using deep linking, so all the pages/states appear as http://site.com Is it still possible to implement back functionality in this case? It looks like flex has a browser history feature, but not sure if it would still work given that all the pages are at site.com The other option is that I would save information in the main fil...

Passing flashvar into flex 4

I am trying to let the user set the background color of my flex 4 app by setting the colour in the flashvars variable of the calling javascript. However, I don't seem to be able to access the flashvars at all, the best result I can get (from trace) is undefined. The javascript looks like: <script type="text/javascript"> var flashv...

Event Handling from a custom ItemRenderer event in a DataGroup

I have a MXML application with a DataGroup as follows: <s:DataGroup id="productSelector" dataProvider="{products}" itemRenderer="renderers.ProductLineupRenderer" > <s:layout> <s:HorizontalLayout/> </s:layout> </s:DataGroup> I want to know when items in my itemRenderer are manipula...

Dynamically setting xml by string concatenation

I'm trying to read xml fields (with actionscript 3), but the problem is that I choose which field to read dynamically. For example, I may need to read test19 or test39 or test12 or anything else. var value:Number = event.result.test19; var value:Number = event.result.test39; var value:Number = event.result.test12; Is there a way to co...