Apparently I’m the only person who frequently works with MAC Addresses in Flex, because I couldn’t find an existing component for them. Here’s one I rolled recently because you people wouldn’t do it for me. (jerks)
To all the people who understand component development better than me, how would you support different fonts and font sizes? The difficulty is this component is a series of TextInput’s, each manually sized to fit two characters. How would you size these individual inputs to scale properly?
A designer friend of mine wanted a custom flash player built for the videos he has on his website. Given the complexity of his design, I opted for creating the UI nearly entirely in Degrafa rather than trying to skin standard components.
February 25th, 2009 at 6:14 pm
Interesting. Not sure where its getting the MAC address from cause the displayed address is not on my computer. The view source link does not work.
February 25th, 2009 at 6:21 pm
Conceptually you have to calculate the length of the text based on the font and size the text boxes accordingly.
I tend to think this is impossible to do until you actual know the text going in the boxes, because letters / numbers can have different widths depending on the font.
Off the top of my head (with some googling), you probably have to dig into TextLineMetrics via the getTextFormat method.
http://livedocs.adobe.com/flex/201/langref/flash/text/TextField.html#getTextFormat()
http://livedocs.adobe.com/flex/201/langref/flash/text/TextLineMetrics.html
February 25th, 2009 at 6:39 pm
@Jonathan: Sorry, I guess I was a bit vague. The component is for the entry of mac-addresses…basically like a TextInput or DateInput.
March 10th, 2009 at 2:19 am
very nice info here. happy to read it.
December 10th, 2009 at 4:23 pm
Really interesting one.
March 6th, 2010 at 6:50 am
Does my mac adresse change if I upgrade my computer with some other hardware? For example change the graphic card?
April 3rd, 2010 at 6:51 am
What made you want to blog? Not complaining, in fact I really enjoyed it; just curious.
Green Energy Information
September 4th, 2010 at 8:18 am
A rather brilliant post. I am commenting in order to demonstrate my sincere love of this entry.