Friday, November 07, 2008

The Same LabelFunction for DataGrid and ComboBox

In Flex, some label functions accept two arguments, i.e. item and column in a datagrid, and some accept one, i.e. item in a combobox. If you're not using the data from the column, which is typically just the dataField anyway, then you don't need two labelFunctions. The easiest way to fix the problem is by making the column field optional. private function fullName(item:Object,dgc:DataGridColumn=null):String{ return item.FIRST_NAME+" "+item.LAST_NAME; } Just add "=null" and you're done!

Thursday, October 30, 2008

Presentation next week

Next Wednesday I'll be giving a presentation that covers
  • Installing Drupal
  • Configuring Drupal Services for AMFPHP
  • Configuring Flex for AMFPHP
  • Never having to code a backend ever again
  • Building a Flex app with a Drupal backend
All this in under an hour. It's that easy. See dc-flex.org for more info on the meeting. If no one else volunteers to speak we might make it into an all-night presentation where we build an entire web app.

Friday, October 24, 2008

XMLListCollection, Descendants function is very important!

I've been struggling today with a minor issue of making all of the children in a complex XML structure go through a repeater. The first step is to create an XMLListCollection which can then be used as a dataprovider for a repeater object. But if you simple do this: menuCollection:XMLListCollection = new XMLListCollection(menu.children()) You're only going to see the elements at the top of the list. At first I was thinking "well crap, now I have to go flatten my XML or flatten the collection somehow." But then I always remember, the simplest solution is the best and if there isn't a simple solution that I can think of, search the docs! And then I discovered the decendants function which will go all the way down to the very last item in a XML tree and return them all as a list to your collection. This means that a repeater will repeat through all of them, and not just the parent nodes. menuCollection:XMLListCollection = new XMLListCollection(menu.descendants())

Wednesday, October 22, 2008

Yahoo Flex Skin problems with DataGrid

I'm using the Yahoo! Flex skin on one of my projects and the datagrid column resizing is totally busted. It works once or twice and then breaks down. The cursor is not centered properly, and the column separator is displayed wrong by one pixel. The fix was simple enough, just comment out the headerSeperatorSkin and stretchCursor lines of the CSS file. Just thought you should know in case someone ever runs into this.

Friday, October 10, 2008

How to debug a Flex app on a live server

Have you ever launched a Flex app into a production environment only to find out that it doesn't work?! You probably wanted run the debugger right then and there to trace the problem. Here's how using Flex Builder 3.
  • Step 1 Overwrite the version on the server with the debug version usually found in your bin-debug folder while developing.
  • Step 2 In Flex builder go to the top menu and select Project -> Properties
  • Step 3 Go to "Run/Debug" Settings
  • Step 4 Your app should be listed under Launch Configuratoins, select it and press "Edit"
  • Step 5 Uncheck the "use defaults" button in the lower portion and then in the first field called "debug" type the URL of your app on the server
  • Step 6 Hit Apply, and then go ahead and debug! You're good to go!
Obviously once you've solved the problem you'll want to export a release build to place on the server as it will be much smaller.

Monday, October 06, 2008

mx:Image limitation

I have a website I'm working on where the background is 8000 pixels wide and 800 pixels tall. I tried for hours, but I could not get the image to load. So how did I solve the problem? With a rather ugly workaround. I created a HBOX with a horizontalGap of 0 and then put two images in it each one being 4000x800. That worked perfectly. I don't have time to really dig in and figure out what's going on or what specifically the limitation is, but I do know that it has something to do with dimensions, and not file size. The reason I know this is because in my efforts to fix it, I tried making the image a really compressed lossy JPEG and even that wouldn't load (it was only 200k!). The version that's up now is about 1,200k (two 600k images) and it's running fine. I'll let you all know when it's up because this site should be pretty visually awesome... although the content is a bit questionable.

Labels: , , , ,

Friday, September 12, 2008

Scheduler Calendar Component

No offense to those who've attempted creating Flex Schedule/Calendar components, but I am unable to find a decent one that's free. And by decent, I mean one that I like. So I guess if you want something done right you have to do it yourself. I started building one today and I've got 3 views: monthly, weekly, and daily view. It's a composite component made of 5 AS3 files.
Here's my question though... should I make the entries display with an itemrenderer or should I just make the entry's have a "description" etc. I'm going to optimize the performance and release a pre-alpha next week.
  • 3 views, daily/weelky/monthly
  • Bindable to a datechooser for selected date
  • Date selectable down to the hour
  • Accepts arrayCollection of "entries".
  • Completely written in AS3
  • It will be free and open source, 100%
And I'll leave you with a "teaser" shot. Here you can see I am testing different sizes to make sure my measure() functons are working and I'm also testing the performance switching between the seperate views.

Feed (RSS/Atom)

Contact Me

Don't put anything here: