Showing posts with label coding. Show all posts
Showing posts with label coding. Show all posts

Tuesday, December 02, 2008

Flex / ColdFusion Strangeness...

... or how to determine if an Object is an Array.

So I have this Object, comes from back from ColdFusion to Flex. It's an Array that contains a Struct that is supposed to contain an Array. I use ActionScript to convert this easily to an ArrayCollection containing one or more ArrayCollections. Simple stuff, works great.

Well I should say it works great as long as the internal most Array has a length of at least 1. When the Array (in CF) has a length of 1, it gets converted to a Struct. So you end up with an Array containing a Struct, that contains a Struct. Again, pretty straight forward, as long as you understand that a Struct can't be converted to an Array, does not have a length and can not be looped through.

My solution, check the length, if it comes back as undefined, it's a Struct, else it's an Array. At least I only pulled my hair out for an hour or so to figure that out...

Thursday, June 19, 2008

TinyMCE

I was helping a friend out with an ASP classic project the other day. He needed to add in a WYSIWYG editor. I normally would just go and grab FCK Editor and be done with it. However, FCK Editors ASP code is written to AScript, this site was written in JScript. Since I didn't want to waste any time rewriting the old code, I did a little Google search, and low and behold... TinyMCE!

It is super sweet, I love the options, and the mode that just replaces all Textareas auto-magicially.

Thank you MoxieCode!