Create A CF Style UUID In Flex

Wow, it feels kinda weird to actually blog something technical here. While working on a little Flex project recently I found myself with the need to create a CF style UUID (xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx) within Flex . Flex UID's follow the 8-4-4-4-12 pattern (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). Quite a simple task really when you think about it, but here is what I came up with:

private function createUUID():String{
var uuid:String = UIDUtil.createUID();
var uReturn:String;
uReturn = uuid.substr(0,23);
uReturn += uuid.substr(24,uuid.length);
return uReturn;
}

I could have gotten fancy and done it with a regular expression, but I'm sure the cost of manipulating the string in ActionScript isn't all too much to worry about.



Comments

Calendar

Sun Mon Tue Wed Thu Fri Sat
   1234
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Subscribe

Enter your email address to subscribe to this blog.

Tags

actionscript ajax blogging cfsnippets coldfusion flash forms flex funny stuff javascript misc model-glue off topic personal project learn slidesix sql

Recent Comments

Chinese Birth Calendar Accuracy Test
mama to be said: ok so i will be 2 months shy of 18 when i have my baby. this calendar does not technically work for ... [More]

Fixing 'User Profile Service Failed The Logon' on Vista
Mike said: That fix worked although all i did was remove .bak and reset state to 0. User was able to log in to... [More]

Chinese Birth Calendar Accuracy Test
Melissa said: Wrong for my daughter, which it predicted to be a boy... we'll see for #2. Predicts a girl (maybe, f... [More]

Adding Auto Generated Code Downloads to BlogCFC
fweerw said: http://www.ibiblio.org/st... http://www.cambodia.ait.a...... [More]

Check Out The New SlideSix
Todd Sharp said: Thanks for the feedback Ben & Rachel! I'll keep it all in mind as I tweak things over the next ... [More]

RSS


adobe community experts

coldfusionbloggers

FullAsAGoog MXNA

Consumed By Feed-Squirrel.com