Converting From Decimal to Hex in Adobe Flex / ActionScript 3.0

In my most recent Adobe Flex project, I am storing color in the database as a hexadecimal number. However, Flex’s color picker widget (mx:ColorPicker) stores color values in decimal format. Now, I could use PHP’s dechex() function to convert the number, but I’d much rather send the data over in the proper format. After much struggling, I came across the following solution (it’s ridiculously easy):

var decimalNumber:int = 123456;
var someVal:String = decimalNumber.toString(16);

Apparently, passing a value of “16” to the toString function will convert a decimal number to hex. Go figure.

–Adam

Flex Tidbits

Just thought that I’d post some tidbits 2015 of knowledge that I’ve learned today:

  • To properly display multi-line ItemRenderers using one of Flex’s list-based controls, you need to set the list control’s "variableRowHeight" property setting to true.
  • If your ItemRenderer’s WordPress, size changes dynamically based for on the supplied content wholesale jerseys (ex: long blocks of text), you’ll need to override the default measure() cheap jerseys function Temizlik in order to set the ItemRenderer’s "measuredHeight" property.
  • To cancel internet an event from propagating, call the event’s "stopPropagation" function.

Sorry for the terse format, but it’s 1997 Friday and Held I’m burnt out cheap jerseys sitting here at work.

–Adam

Changing Mouse Cursor for Flex mx:Label

In cheap jerseys my cheap mlb jerseys current cheap jerseys Flex-based “Kids project, Alexandre I Arizona am creating several labels that act like hyperlinks but was having trouble changing the cursor type to the traditional “hand.”  After some moderate searching, I found out that you have to declare three properties:

useHandCursor = true;
buttonMode = true;
mouseChildren = false;

With these properties set, the mouse cursor will now change to a hand. Simple!.