Jun 25
The Flex’s Charting component has a property called labelRotation that tilts / rotates the chart labels for them not to overlap each other and make a mess of your pretty charts. This will not work automatically. You have to first embed the font outline into Flash and the rotation will finally be applied.
Here’s the sample code:
@font-face
{
fontFamily: myFont;
src: local("Verdana");
}
LineChart
{
fontFamily: myFont;
}
Jun 21
By default, Flex does not implement the PageUp, PageDown, Home, End, ArrowUp and ArrowDown scrolling like most browsers do. These functions will try to make keystroke/keyboard scrolling happen.
First, invoke registerGlobalKeyHandler() upon applicationComplete. Got this from the Adobe Flex Cookbook by Kristopher Schultz.
A point for improvement - this scrolling script will only work after the user clicks on the flash app itself. I do not know how to set focus on the app after it has loaded. Maybe you can help?
Code:
public function registerGlobalKeyHandler() :void
{
stage.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
}
public function handleKeyDown(event:KeyboardEvent) :void
{
var newKeyCode:uint = event.keyCode;
switch(newKeyCode)
{
case 33: // PAGE UP
Application.application.verticalScrollPosition -= 200;
break;
case 34: // PAGE DOWN
Application.application.verticalScrollPosition += 200;
break;
case 35: // END
Application.application.verticalScrollPosition = Application.application.maxVerticalScrollPosition;
break;
case 36: // HOME
Application.application.verticalScrollPosition = 0;
break;
case 38: // UP
Application.application.verticalScrollPosition -= 50;
break;
case 40: // DOWN
Application.application.verticalScrollPosition += 50;
break;
}
}