Tuesday, December 19, 2006

Flash Lite Components

Yesterday I posted a question about using Flash components in a Flash Lite app which it turns out you can't do. Alessandro was kind enough to reply with a link to some Flash Lite specific components. Since I'm sure I'm not the only one with this problem I thought I'd repost his link on the front page here.

Flash Lite Components

Jesse Warden is also working on a "light weight" set of components for Flash Lite. Keep an eye on his blog for details.

Monday, December 18, 2006

Flash Lite Question

Over the weekend I was working on one of my first Flash Lite prototypes. I got it working nicely in the emulator and when I got into the office this morning we tried testing it on the actual device (Q phone) and got and "Actionscript Stuck" error. After a little research it looks like this happens if you use any of the Flash components. My app currently uses one datagrid and an xmlConnector. I could probably work around the connector component but I'd really like to keep the datagrid if possible. Has anyone found a work-around for this?

Saturday, December 16, 2006

Apollo on TechCrunch

Apollo was one of my favorite things at MAX this year. I'm very excited for it to be released, it's nice to see that people outside the Adobe developer family are excited too.

Techcrunch » Blog Archive » Preparing For Apollo

Monday, December 11, 2006

MyBlogLog

A friend of mine told me about this site today. It's kind of like MySpace or Facebook for blogs. It's kind of interesting. I don't know how much I'll use it but it does have some good reporting about who's viewing your site.

MyBlogLog

Flex 2 dateChooser Component

If you've done much work with the dateChooser component in Flex 2 you know that it can be a little restrictive. I was recently working on an app where I wanted to load a list of dates from an XML file and somehow identify that those dates were clickable on the calendar. Turns out the only way to do this is to disable all of the other dates. I ended up dynamically building an array of start and end dates to pass to the disabledRanges method of the dateChooser component. The code is below. This may be obvious to many of you but it caused me a great deal of pain, one important thing to note is to be sure that the elements of your array are Date objects, not strings. Strings won't work....believe me.

The only input for the function is an array collection containing the dates that you want ENABLED.


private function setValidDates(validDates:ArrayCollection):void{
var rangeArray:Array = new Array;
var millisecondsPerDay:int = 1000 * 60 * 60 * 24;
for(var i:Number = 0; i < validDates.length; i++){
var startIndex:Number;
if (i > 0){
startIndex = (i-1);
} else {
startIndex = i
}
var startDate:Date = new Date(validDates[startIndex].getTime() + (1* millisecondsPerDay));
var endDate:Date = new Date(validDates[i].getTime() - (1 * millisecondsPerDay));

if(i == 0){
rangeArray.push({rangeStart:new Date("Jan 1 1906"),rangeEnd:new Date(endDate)});
} else if(i != validDates.length && i != 0){
rangeArray.push({rangeStart:new Date(startDate),rangeEnd:new Date(endDate)});
}
}
startDate = new Date(endDate.getTime() + (2*millisecondsPerDay));
rangeArray.push({rangeStart:new Date(startDate)});

myCal.disabledRanges = rangeArray;
}


***UPDATE***
I received a comment recently asking for a sample of the XML used in the example above. I've included a snippet here.

<?xml version="1.0" encoding="utf-8"?>
<calendar>
<calItem>
<date>1/7/2007</date>
<milestone>Dad's Birthday</milestone>
<time></time>
<location></location>
<notes>Don't forget to pickup the balloons and the cake at the store before 5:00 on Friday.</notes>
</calItem>
<calItem>
<date>12/6/2006</date>
<milestone>Christmas Party</milestone>
<time>7:00pm</time>
<location>The Wave Room</location>
<notes></notes>
</calItem>
</calendar>