Flex public variables in Action Script act as ‘global’ variables – potential for spaghetti code
Popup windows in Flex
http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000701.html
Flex 2 Metadata Tags – [Bindable] etc
http://mxdj.sys-con.com/read/361239.htm
Non-visual components in Flex – in Action Script or MXML:
http://www.nabble.com/Simple-design-question-t3416123.html
“If all they need is a container for non-visual components that is
itself a non-visual component, then just create one that extends
IMXMLObject that accepts any other IMXLObjects as children.
But really, I would recomend doing as much as possible in AS anyway.
AS is going to compile faster so your build times will be shorter. AS
code is easier to debug. And expanding ActionScript skills will only
help you be a better flex developer.”
Polarion – SVN plugin for IDE
26 Apr 07
diff
–ignore-blank-lines –side-by-side –left-column –minimal –width=180
Flex custom centered/positioned renderer
- we want a custom ‘dynamic’ renderer, which shows a picture that depends on data row
- we want it to be horizontally centered
— we cannot center it by padding because it’s used in a DataGrid where width of columns can be resized
— we cannot set alignment in CSS – see http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000761.html#164917
- following uses embedded images; or uncomment the image names and remove the embedded variables
- don’t use override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void in mx:Image because it’s invoked too frequently – every time you move a mouse over the Data Grid.
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Box xmlns:mx=”http://www.adobe.com/2006/mxml” direction=”horizontal” horizontalAlign=”center” verticalAlign=”middle” >
<!– By some good magic of Flex he ’source’ handler in the following mx:Image gets ‘data’ parameter.
However, the actual renderer object is the outer mx:Box and this mx:Image is only a component of it.
–>
<mx:Image id=”image” source=”{getSourceName(data)}” >
<mx:Script>
<![CDATA[
[Embed(source="deploy/resources/admin.gif")]
private var admin_star :Class;
[Embed(source="deploy/resources/not-admin.gif")]
private var admin_blank :Class;
private function getSourceName(data: Object): Object {
if( data.is_admin ) {
return admin_star; //”resources/admin.gif”;
}
else
return admin_blank; //”resources/not-admin.gif”;
}
]]>
</mx:Script>
</mx:Image>
</mx:Box>
Double-click handling in Flex:
<!– If we handle double clicks for data grid, which would display detailed info on user
- same as selecting a user and pressing an info button -
then we can’t handle both single clicks and double clicks. If we have handlers for both
then double click handler is ignored.
doubleClick=”Alert.show(’double click’)” doubleClickEnabled=”true”
==> set doubleClickEnabled
CSS properties supported by Flex:
The actual set depends on current Theme – http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000761.html#190648
List of supported properties – from http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000761.html#164917
-
color -
fontFamily -
fontSize -
fontStyle -
fontWeight -
paddingBottom -
paddingLeft -
paddingRight -
paddingTop -
textAlign -
textDecoration -
textIndent