February{"Wed",25(2009)};

MAC Address Input Component

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?

postdetails{ }

8 Responses to “MAC Address Input Component”

  1. Jonathan Says:

    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.


  2. Jeffry Houser Says:

    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


  3. Dennis Falling Says:

    @Jonathan: Sorry, I guess I was a bit vague. The component is for the entry of mac-addresses…basically like a TextInput or DateInput.


  4. lutfee Says:

    very nice info here. happy to read it.


  5. ligne Says:

    Really interesting one.


  6. roman@wlan Says:

    Does my mac adresse change if I upgrade my computer with some other hardware? For example change the graphic card?


  7. Lucchini Says:

    What made you want to blog? Not complaining, in fact I really enjoyed it; just curious. :)

    Green Energy Information


  8. antique library table Says:

    A rather brilliant post. I am commenting in order to demonstrate my sincere love of this entry.


Leave a Reply