flex 4

States are so much more fun in Flex 4 and 4.5

I'm loving the new Flash Builder and 4.5 SDK. I don't know if everyone came to the same realization that I did... but "states" are awesome now with the 4+ SDK! You can change ANY property on the fly. Take for example a two stage button:

<s:Button icon.viewing="{Icons.PENCIL}" 
	      icon.editing="{Icons.DRIVE}"
	      label.viewing="Edit"
	      label.editing="Save"
	      click.viewing="{currentState='editing'}" 
	      click.editing="{currentState='viewing'}"
	      />

CursorManager Inline

Once again I let my jQuery habits get into my ActionScript code.
this.addEventListener(MouseEvent.MOUSE_OVER,
  function():void{
  cursorId = CursorManager.setCursor(Cursors.MOVE,CursorManagerPriority.HIGH,-16,-16); });

this.addEventListener(MouseEvent.MOUSE_OUT,
  function():void{ CursorManager.removeCursor(cursorId); });
What do you think? Should I leave it?

Migrating to Flex 4, StyleManager

I haven't seen this well documented before, but if you're component was using the style manager and is throwing a bunch of warnings in Flex 4, you need to get the "global" style manager now. You probably see this error:
"3608: 'getStyleDeclaration' has been deprecated since 4.0. Please use 'IStyleManager2.getStyleDeclaration on a style manager instance'."

Syndicate content

Social


profile for Jonathan Rowny at Stack Overflow, Q&A for professional and enthusiast programmers