'How do I' Category
…remotely compile FLA files for Flex Builder debugging
This is a follow-up to this two-years old post by Daryl Joseph Ducharme.
While Daryl explains how to use Ant and a *.jsfl file to remotely open Flash IDE, have it compile a given *.fla, and then close, his approach creates a release *.swf file, one that contains no debug information. If you want to actually [...]…tell apart missing XML attributes from empty ones
This might be tricky using E4X, which, in an attempt to make the overall XML handling a lot easier, apparently also took some useful “garbage” away: there is no getAttributeNode() method (or similar) in E4X, as it is in DOM.
var dataProvider1 : XML = <Text />;
var dataProvider2 : XML = <Text prompt="" />;
// Suppose you [...]
…convert a decimal
Numberto a hexadecimalString?Don’t go about writing your own decimal to hexadecimal converter. In AS3, the Number.toString(radix : Number) method is all that you need:
var myDeci : Number = 16711680;
var myHexa : String = myDeci.toString (16); // myHexa now holds "ff0000"
Note that you may still need to left pad the resulting value, if you’re operating with color triplets [...]
…scroll an element into view in Flex?
This worked for me:
var myButtonBounds : Rectangle = myButton.getBounds (this);
verticalScrollPosition = myButtonBounds.bottom;
In the above, myButton was the Flex component I needed to bring into view by scrolling up the content of its container.
