Just throwing this question out there to pick the brains of other Flex developers: Do you have any preferences/standards that you follow for your mxml formatting? Care to share? Here are the formats I seem to come across most:
Single line, common attributes grouped together and listed first:
-
<mx:Image id="thumb" x="10" y="20" width="90" height="90" scaleContent="false" source="" />
Single line, with all attributes in alphabetical order:
-
<mx:Image height="90" id="thumb" scaleContent="false" source="" width="90" x="10" y="20" />
Each attribute listed on a new line:
-
<mx:Image
-
id="thumb"
-
x="10"
-
y="20"
-
width="90"
-
height="90"
-
scaleContent="false"
-
source=""
-
/>
Personally, I don't have a standard yet. I usually go with tags on a single line, but the attribues are in no particular order at all, except in pairs where it make sense, like x & y always together. I do go with each attribute on a single line for the opening tag of a component or the main Application, though...seems to make more sense to do it there.
Usually I go with the first one.
But when the line gets long I switch to the third solution.
I prefer up/down scroll to left/right.