Showing posts with label flex. Show all posts
Showing posts with label flex. 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...

Tuesday, May 13, 2008

Flex Builder Tip of the Moment....

If you are using Flex Builder and you want to go back and forward between open files, you might use CTRL-TAB. This works well, unless you also happen to have CF files open. CF Eclipse doesn't use CTRL-TAB, which has been driving me nuts, until today.

CTRL-PgUp and CTRL-PgDn act just like CTRL-TAB, CTRL-SHIFT-TAB in both Flex Builder and CF Eclipse.

Knowing this has saved me a bunch of time... Just wish I would have found it sooner.

Tuesday, November 27, 2007

projectId != projectid


Any ActionScript, JavaScript, Java, etc. programmer knows about case-sensitivity. The languages are very picky, thus projectId is not the same as projectid. However, ColdFusion and T-SQL aren't picky. SELECT is the same as select -- is the same as . After moving a demo from my local development environment to a staging server I discovered the hard way that Flex treats returned column names as case sensitive variables. When I created the view on the staging server, I made the mistake of not properly camel casing projectId. Hopefully, this is a mistake that I will not make often.

Monday, November 19, 2007

Big Gotta in Flex/AIR


So you have a datagrid in Flex (or AIR) and you got a nice little query that is delivered to the application via a ColdFusion CFC and in your Flex app, you've got a text field that triggers a filter function on the arraycollection. Nothing special, one of the first things that many CF developers learn how to do in Flex.

While I was working on a demo application the other day I built this out, just to discover that my filter functions weren't working. Stranger yet, the filter functions worked perfectly when datasource was a xml file with the same data. After hours or cursing, blog reading, etc., I figured out what the issue was. For whatever reason, when you have a query that uses GROUP BY Flex filter functions do not work. In the end I made a view out of the query and the filter functions work perfectly now.

Fun stuff.

Thursday, November 02, 2006

Back from MAX

I've been back from MAX since Friday. And in some ways it has taken this whole week just to recover. Las Vegas is a crazy city. So what did I learn? I'll separate it in to two difference sections, Vegas and MAX.

First MAX. The conference was one of the better ones I've been too. I took a full day training session on Flex with ColdFusion on Monday, which was really worth the extra money and time. Before that training session, I really didn't feel like I had a grasp on how to use CF as a back end for Flex. Sure I could cut and paste example code, play with it, and make it sort of work, but I didn't have a good understanding of what I was doing -- now I do (at least with the basics). That knowledge was reinforced by the Flex sessions that I attended. I really feel I'm ready to dive, head first, in to a complex Flex project.

Other things I learned? Well, I think Adobe is on track with the Apollo product. I didn't get to see as much of it as I wanted to, but from what I did see, Apollo is going to be a great solution for providing a single application across the OS/browser divide. The fact that it will render Flash (and Flex of course), HTML, PDF, CSS, etc in a single easy to use environment should really allow it to take off. That being said, I'm concerned about making the product a success. Macromedia tried with Central. Sun with Java something-or-other. And, there have been others as well, who've tried to create a platform for bringing web applications from the browser to the desktop. Is this the right time? Right product? Only time will tell, but I think Adobe is on the right path, and truly "gets it".

Of course, an equally large part of my week was Vegas. What a city, it many ways, it shows the best and the worst parts of what America is. The best part of the experience was playing Black Jack. I had never played in a casino before. I stepped off the plane expecting to play, and lose, I choose an amount that I could accept losing and when with it. In the end, on my last day, I ended up with a profit of $5! This including the money I spent on food, drinks, etc. I consider that to be a huge win!

Seeing the many casinos was pretty cool -- of course the casino floor in all of them ended up being the same. Different ways to get you to spend money. That being said, I was really impressed with the expense, the use of costly materials, and the overall quality of the finished products. Some of the places I visited were truly beautiful. The thing I didn't really expect, or realize was the size of Vegas. When you are on the strip, the different locations don't seem that far away. However, try walking from Mirage to Paris, and you soon realize how far away they really are. Last, but not least, was the food. While the food at MAX itself was fairly boring, the after parties, and the special event made up for it. I got to eat Kobe beef for the first time, at two different places, it was damn good at Tao, but it was incredible at Little Buddha. And I did end up eating in my third Emeril resturant, Emeril's N.O. Fish House -- it wasn't as good as the other two I've eaten at (Tchoup Chop andNola), but it was still one of the best food experiences I've had.

Last, by not least, I met some really nice people at MAX. That, perhaps, is the best part of the conference. Each year, I make more friends, new contacts, and expand the list of people I hope to see at the next one.

Friday, October 20, 2006

MAX

Tomorrow morning I'm off to Adobe MAX in Las Vegas! I can't wait. This year, I'm going to focus a lot of Flex, some ColdFusion and a sprinkle of After Effects, Flash Video, and Flash Lite.

Of course, since it's in Vegas, I'm planning on doing some serious R & R as well. I'm hoping to hit several of the roller coasters while I'm there, grab some good food from places like Bobby Flay's Mesa Grill, and of course gamble a bit.

Tuesday, August 08, 2006

IFBIN

Learning Flex or Flash can be a bit frustrating - especially if you are coming from a different world, like say ColdFusion or ASP. A great resource IFBIN.COM, has just changed its model and is now a free open source tool! With 100's of very specific tutorials this tool is a real life saver for anyone who needs to pick Flex or Flash in a hurry. Check it out! :-)

Tuesday, August 01, 2006

Flex 2

In the little free time I have right now, I've been playing with Flex 2. Wow. Adobe really brought together a product that is light years ahead of the first version. The amount of tutorials, example applications and blog based information let loose by the company is quite impressive as well.

In the end, this is exactly what I would expect from Macromedia, it's nice to see that Adobe hasn't changed the culture, but in fact, seems to have enhanced it! Great job guys!