Welcome to DeanLogic a collection of code scripts, apps and videos that I have created. This site will display code scripts that I have created from scratch or modified from existing work. There will also be widgets and applications that I have create and now offer to others to use. And finally, the site will display videos of the movies I have created as part of yet another hobby I have. Enjoy the site.
The key reason for using SQLite is so that I can populate the device-side information easily. Unfortunately, the data sent to the device is not in the best format at the moment. So, I have to take sudo HTML tables and parse them out into data to be stored in the SQLite table. But, before I can do that, I needed to figure out which table is being sent. When the application initializes the database, it adds values to a configuration table of the table name and the table id. When the data is loaded, I grab the table name and then look in the configuration table to determine the id. Then with the id, I can use a switch statement to process the data using the parser associated for that table. Simple enough. But, when the code was retrieving the table name, it would error and crash trying to determine the id. It took a bunch of break points and stepping to finally figure out the issue.
Here is the code to get an Value while passing in an Attribute
Statement statement = myDataBase.createStatement("SELECT value FROM myTable WHERE attribute = ?");
statement.prepare();
statement.bind(1, attribute);
Cursor cursor = statement.getCursor();
Row row;
//Use first cursor spot
cursor.first();
// Get the row from the cursor
row = cursor.getRow();
thisValue = row.getString(0);
statement.close();
cursor.close();
The issue I had was on the getString(0) part. Instead of the first position being at 1, the first position is at 0. Sort of obvious, but I guess I was looking at the bind statement, which has the first position at 1.
Another simple thing I determined today, not being the expert Java developer, is that I can call the static instance of the database connection without having to pass it through to a different class function. In other words, I created the appDB connection when the application opens up and I initialize the database connection. I do this on a class called SQLManager. Therefor, when I want to use the database connection, I can just use SQLManager.appDB anywhere in application. I wasn’t sure this would work, but after a little test, I found that it did work and will help cut down on code when calling functions to update tables.
At work I have been attempting to get our 800+ BlackBerry devices updated. This all began when we provided our service application to a site to use with their own technicians. The devices that we gave them were the BlackBerry Bold 9930. Luckily for me, I also got one of these devices and handed in an old 8800 BlackBerry. The Bold’s came with OS 7.0, but I updated mine to 7.1 in order to take advantage of the Hot Spot feature. Also, in OS 6 and 7, there is a feature for using Near Field Communication NFC tags. While most of the focus on NFC is payment, I see that my company can use the data storage and macros features for use with the service application.
But, the main reason for the upgrade to OS 6 or better, is the availability of SQLite on the phone. Previously, storing data on the BlackBerry devices was a little limited. It was similar to creating a very long text file and finding a particular item at a certain spot in order to get the data. In a word, it was clunky. Even though SQLite isn’t a full featured database, it is enough of a database to make inserting, updating and deleting data on the device much easier. So, I decided to delve in an update the old client application to version 6, which first required changing to Eclipse, more specifically, BlackBerry plugin for Eclipse. And changing to a new IDE and when you do that, you have re-setup your BlackBerry connections on the simulator to get things to work correctly.
With BlackBerry, you have a MDS that routes the pushes from a server to the appropriate device. On a simulator, you modify a rimpublic.properties file to make sure the data is okay to go to the device. An issue I had was that the push was failing. Because the push server had been already setup and I was just trying to get the simulator to receive the pushes, I didn’t have a direct look at the push command. One of the things you have to provide is the port of the application. When you setup up the device side listener to the wrong port, then your pushes never get to the application. D’oh! After I fixed that simple error, the data being pushed wasn’t displaying the entire data stream. The demo had the output example happen before the stream was repackaged back into a database, so only a portion was being shown. Oops. After I figured out to step to the parsing function after the push stream was finished. This was also an issue with opening and closing the database. The demo showed that every time you do a transaction to the database, you should open it and then close it. Well, that worked great in the simulator, but not so on the device. In the end, I found out that the best thing to do was open the database when the application was open and then not close it until I wanted to close the application for good.
The upgrade has been a slow start, but now it is moving along. Hopefully I can get the application converted and work on the new features that I want the application to do without too much more trouble.
In an attempt to expand my knowledge of things, I have been looking into HTML 5 and how it works. In general, HTML 5 adds a few new tags and with help from a bunch of JavaScript, will allow you to create more dynamic web pages and even web applications that can be converted into to mobile applications. BlackBerry handles their HTML 5 web applications through WebWorks. They have just recently updated their Developer Zone with nicer splash pages to highlight the multiple ways for creating mobile applications. WebWorks was available for OS 5 BlackBerry phones, but the new PlayBook is champ with HTMl 5. The beta version of the OS 2 scores the 2nd highest of all (desktop, tablet and mobile) browsers.
So, with this in mind, I set forth to play around with HTML 5. I didn’t want to just post what I learned on website on the server, so I installed Apache, PHP and MySQL on my PC. After following some instructions for installing the three and searching for answers when it didn’t work initially, I finally got everything working. Hopefully I won’t move to a new PC anytime soon and the installation will keep working. As part of the setup, I copied a HTML 5 template for the home page. I hadn’t done much to it during the installation and wasn’t planning on making any updates until I got everything works. Again, having the local site was mainly for learning so I decide to replace a section for “customer reviews” with my Twitter feed. I found some basic jQuery Twitter code and modified it for the section. Simply, the jQuery reads the JSON call from Twitter (twitter). You can access each element of the feed and get the needed information. In this case, I was only retrieving the Tweet itself (twitter.text) and the datetime when it was tweeted (twitter.created_at). From there, it is just a matter of formatting it into the appropriate HTML look and then marking a spot on the page where the feed will appear.
// When the document is loaded (jQuery function)
$(document).ready(function() {
// Call the Twitter API to retrieve the last 10 tweets in JSON format for the pcpro Twitter account
$.getJSON("http://twitter.com/statuses/user_timeline.json?screen_name=DeanLogic&count=10&callback=?", function(tweetdata)
{
// Grab a reference to the ul element which will display the tweets
var tl = $("#tweet-list");
// For each item returned in tweetdata
$.each(tweetdata,
function(i,tweet) {
// Append the info in li tags to the ul, converting any links to HTML <a href=.. code and convert the tweeted date
// to a more readable Twitter format
/*
<div>
<figure><img src="images/client_image_1.jpg" alt="Image" /></figure>
<blockquote>
<p>Tweet goes here. &laquo; When Tweet was Created </p>
</blockquote>
</div>
*/
var tweetItem = "<div class=\"clearfix says\">"
+ "<figure class=\"marginRight\"><img src=\"images/TwitterDeanLogic.png\"></figure>"
+ "<blockquote><p>" + urlToLink(tweet.text)
+ "&nbsp;&nbsp;&laquo;&nbsp;" + relTime(tweet.created_at, tweet.user.utc_offset)
+ "&nbsp;<span class=\"twitterRetweet\">&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;" + tweet.retweet_count;
if(tweet.favorited){
tweetItem += "&nbsp;&nbsp;<span class=\"twitterFavorite\">&nbsp;</span>";
}
tweetItem += "</blockquote></div>";
tl.append(tweetItem);
});
});
});
Well, the original code (which I have misplaced) was giving the wrong feedback for when the Tweet was posted. So much for simply copying and pasting code. I looked into the issue and found that the recent Daylight Savings Time change was causing the issue and also the original code wasn’t accounting for different time zones or something. After searching around and trying different things, I found that the time zone offset was part of the User information of the JSON feed (twitter.user.utc_offset). I modified the function to pass in the offset and then subtract that from posted time in order to get the difference in date and time.
// Takes a time value and converts it to "from now" and then returns a relevant text interpretation of it
function relTime(createdDate, utcOffset) {
createdDate = createdDate.replace(/(\+[0-9]{4}\s)/ig,"");
// add utcOffset to parsed value to get actual tweet time
var parsedDate = Date.parse(createdDate) + (1000 * utcOffset);
// get current Date and parse
var relativeDate = new Date();
var relativeOffset = relativeDate.getTimezoneOffset( ) / 60;
var relativeParsed = Date.parse(relativeDate) + (1000 * relativeOffset);
// subtract relative from parsed and get the seconds difference
var timeago = parseInt((relativeParsed - parsedDate) / 1000);
// Determine how long ago in seconds and display relative text
if (timeago < 60) return 'less than a minute ago';
else if(timeago < 120) return 'about a minute ago';
else if(timeago < (45*60)) return (parseInt(timeago / 60)).toString() + ' minutes ago';
else if(timeago < (90*60)) return 'about an hour ago';
else if(timeago < (24*60*60)) return 'about ' + (parseInt(timeago / 3600)).toString() + ' hours ago';
else if(timeago < (48*60*60)) return '1 day ago';
else return (parseInt(timeago / 86400)).toString() + ' days ago';
}
Well, that fixed the general problem, but did not fix the issue with the Daylight Savings Time. Apparently that still is a little iffy. So, I moved on to working with CSS and Sprites.
The new (relatively) thing to do with images or icons is to have one image that holds all of your icons and then manipulate the style sheet to only show the portion of the image that is need for the icon. The benefit of this is, instead of loading 20 different icon images with a site, you only have to load one image. Which also means, instead of taking one template of a bunch of icons and creating different files, you can edit all of your icons in one place and have just the one file. If you are bound to change the look of your site for the season, then you don’t have to worry about forgetting one icon while you are creating the dozens for your site. Of course, the real saving is if you design web sites and just want a quick way to handle each different client’s website. Anyway, it is a cool way to take this :
And only show what you really want, like .
Unfortunately WordPress likes to remove any behind the scenes HTML, so I suggest going to the CSS Background Image Sprites tutorial to learn how to do it. It is pretty easy, with a bit of trail and error if you don’t know the exact position of the individual icons and if you use a span instead of a div, like I did.
Since I had a day off, I decided to work on converting my old Flex Examples to the new Flex 4. As stated in a previous post, the new Flex 4 breaks Degrafa and Degrafa seems to be defunct now. Most of the drawing functions are handled with spark and sprite functions, but little things like arcs and line repeaters are not. So where before it was easy enough to create a repeating line in Degrafa, now I have to do a loop to create the lines needed. Well, in this case, instead of drawing lines, I’m drawing rectangles. While it might seem simple at first just to draw a bunch of rectangles together to create a grid, there is a little trickiness to it. You can have to account for the size of the total grid, based on the number of columns, rows and the grid box size. And you also have to use both the column and row count value to draw the correct number of rows and columns and at the right size. It is all just a matter of thinking about it for a few moments and then having an “ah ha!” moment. Another little quirk with the components is that when you add a visual element, it puts it in the center of the group component. On the Egg Timer, I just left it there for now because it worked for what I needed. I might change it later. But for the LineGrid, it made for it not to line up correctly. So, before I start drawing the rectangles, I had to determine the actual 0,0 location first. It also took a couple tries to make sure I was using the right zero.
// Find the actual 0,0 start
var actualZeroX:int = -1 * ((columnCount * boxSize) * .5);
var actualZeroY:int = -1 * ((rowCount * boxSize) * .5);
One good thing about the new components, is that when you use the declarations, it is the same as creating a set function, which means less code. I simply added declarations for the column and row counts, then put those values where I need them. When I use the LineGrid component I add the values I need just like any other attribute.
One of the ways I like to debug my Flex applications is putting a TextArea item that is visible when needed to display certain items that usually would be display in a trace. The benefit of this little trick is that I can see what is going on without having to go through Flex Builder. Also, I happened to create a web service debugging application and it displayed the error and result text from the web service. When displaying either debug or general result information, it is helpful if the TextArea scrolls up to show the latest information added. I found code on the to do this in Flex 3, but things changed in Flex 4. So I did a little searching and found some code that had a little too much code. There is a warning at the bottom of that post which states the API at the time was in Beta. Maybe adding event listeners is the more correct way to automatically scroll the TextArea, but it certainty isn’t the quickest way. Since the Flex 3 version was fairly simple, I took what I saw there and applied it in the way the old method worked.
The first thing is that the scroller is now it is own component within the TextArea. So, you first have to access that withing the TextArea. Then you need to choose either the vertical or horizontal scrollbar. Since I set the width and the words automatically wrap, I only need the vertical scrollbar. Then you get the value of the scrollbar, which you can read or set. The key is to set the scrollbar to its maximum position, which in the case of a vertical scoller would show the bottom of the TextArea. You change this value with the valueCommit function, that allows you to change things after a value is added. Just don’t change the content value or you go into a loop.
Unfortunately, it doesn’t seem to scroll completely down to the bottom completely. I’ve created a little application to show text being added to the TextArea. Every 10 seconds a random set of words will be added to each of the TextAreas. As the amount of text increases, the TextArea with the dynamic scroller will scroll down, while the other TextArea just increases the scroller size. To generate the random words, I used a few quotes from the Mark Twain quote site. From those quotes, I used a script to convert the phrase words into an array. I modified the examples in order to pass in the array that I want to add the words to and get back a new array of words. From there I used a basic random number in range script to get a random number of words. Once I had the random number of words, I just grabbed that many words in a loop from the Array. Finally, I adjusted the first word to make sure it had the first letter as upperCase and the rest of the words to lowerCase.
public static function getArrayFromString(inputPhrase:String, sourceArray:Array):Array {
var reg:RegExp = /\W/i;
var wordsAsArray:Array = inputPhrase.replace(reg, "").split(" ");
for(var w:int=0; w < wordsAsArray.length; w++){
sourceArray.push(wordsAsArray[w].toString());
}
return sourceArray;
}
public static function upperCase(str:String) : String {
var firstChar:String = str.substr(0, 1);
var restOfString:String = str.substr(1, str.length);
return firstChar.toUpperCase() + restOfString.toLowerCase();
}
Here is the example. When the text expands past the available area for the first time, bot TextAreas look the same. When the next random phrase is created, then the difference is more apparent.
At work I upgraded to Flex 4.5 and started updating one of my projects. I started running into errors with my components that used Degrafa. Apparently the Degrafa group has stopped working on updates and code in Flex 4 has broken the arc and wedge drawing utilities. This causes a problem with my Egg Timer component, because it relies on the wedge or arc for the display. I decided to use the new functions of Flex to create the timer. Unfortunately, Flex still doesn’t have it’s own wedge or arc drawing utilities. It does have a curveTo method as part of the Graphics function, but you still have to figure out what point you want to curve to what point. I initially thought I could just use the Shape function to draw a triangle and an ellipse, join the two together and create a wedge. However, that was proving to be too much of a pain to do. Then I found Lee Brimelow’s Action Script Wedge Class (Google Project Code Link). This made things simple, except for the part where the starting point is at 90° instead of 0. For me, this wasn’t a big issue, because all I had to do was rotate the Sprite back 90 degrees to put it at the 0 position. A poster provided other code to fix the issue, but since it was fairly simple to fix, I didn’t bother using the other code.
var timerArc:Sprite = new Sprite();
timerArc.graphics.beginFill(0x000000);
timerArc.graphics.endFill();
timerArc.rotation = -90;
drawWedge(timerArc, 0, 0, timerSize, 360, 0);
Another little quirk with Flex 4 is the Declarations tag. Not completely familiar with everything new in Flex 4, I’m trying my best to try out new features. I figured adding the time defaults to the declarations would help things out.
Well, not really. After I had everything working with the wedges and the look of the timer, the Timer function was never reaching the TIMER_COMPLETE function. After searching the web and trying to figure out why the Timer didn’t work the correct way anymore, I gave up using the Declarations area and moved the variables to the script tag area. That fixed the issue.
// minutes in seconds
private var oneMinute:Number = 60;
private var twoMinute:Number = 120;
private var fiveMinute:Number = 300;
// timers with delay of 1 second, repeat of minute value
private var oneMinuteTimer:Timer = new Timer(1000, oneMinute);
private var twoMinuteTimer:Timer = new Timer(1000, twoMinute);
private var fiveMinuteTimer:Timer = new Timer(1000, fiveMinute);
To change the size of the timer, just use scaleX and scaleY on the component. The default size is 50 x 50, which is a good general size, but I can see that there might be a need to make it larger or smaller.
Later I will probably add the multi-color option that shows green when things are still good, yellow when it is close to expiring and then red in the last 5 seconds. I will also try working skins to see how I can use them with the Sprites.
For the past few years Dorito’s has offered a competition called Crash the Super Bowl to create a commercial that will be featured during the Super Bowl. It is a genius marketing idea. Thousands of entries will be submitted, Dorito’s pays pennies to the winner (compared to a normal advertisement agency) and the winner gets a chance to be famous for 30 seconds. The contest began in 2007 and had a local winner. In 2009 (for the 2010 Super Bowl), the winners were a local group, as was one of the other finalists.
A couple of people in my Let’s Make a Movie group suggested that we do a Dorito’s commercial this year. Well, people suggested it last year, but we never go around to it. When it was suggested just a few weeks ago, it didn’t give us much time to get something created. We had a meeting on Nov. 5th, took about a week to find a location and then shot it the following Monday. Then I had to get the film from my two camera men, edit it and then submit it. While some of the past commercials have been off the wall funny, ours isn’t that crazy. I’m sure if we had more time we could have come up with something more out-of-the-box. While looking through other videos however, I managed to come across multiple zombie, vampire and people acting like birds to get Dorito crumb videos. So, even trying to be different, you end up being similar. I guess you really have to dig deep to come up with something that might be truly unique.
I don’t know the exact number of entries, but it is at least over 1,000. The panel of judges get to select the top 5, then everyone starts voting on January 4th, 2012. Maybe we’ll get lucky and be in the finalist group. For your viewing pleasure, here are the 3 entries that I submitted : The Divorce
As I stated in a previous post, I am working on a little project for work that dealt with including arrays inside of arrays. Part of this also had me putting lists inside of lists. The layout of one of the display has an Accordion navigation control with a HorizontalList, that also contained an accordion with it’s own HorizontalList. I am using the horizontal list to scroll through main items with sub-items below. On top of this, I am creating the HorizontalList, the HSlider and the Accordion controls all dynamically.
The first part of setting up the slider and list, is to make sure the HorizontalList has only 1 columnCount (number of columns displayed), else you see all of your items. The second part is to set the start and end of the slider. At first I used 0 as the start, but since I am showing the initial record, 1 should be the minimum value. I set the maximum value to the length of the data set for the list. I had found some code that used a counter to determine the position of the slider and the list.
private function prevClick(evt:Event):void{
var tmpHozList:HorizontalList = new HorizontalList();
tmpHozList = evt.target.data[0][0];
var tmpSlider:HSlider = new HSlider;
tmpSlider = evt.target.data[0][1];
//move Horizontal List
var pos:int = tmpHozList.horizontalScrollPosition - 1;
var min:int = 0;
var curvalue:int = Math.max(min, pos);
tmpHozList.horizontalScrollPosition = curvalue;
//move Slider
tmpSlider.value = curvalue;
}
private function nextClick(evt:Event):void{
var tmpHozList:HorizontalList = new HorizontalList();
tmpHozList = evt.target.data[0][0];
var tmpSlider:HSlider = new HSlider;
tmpSlider = evt.target.data[0][1];
//move Horizontal List
var pos:int = tmpHozList.horizontalScrollPosition + 1;
var min:int = 0;
var curvalue:int = Math.max(min, pos);
tmpHozList.horizontalScrollPosition = curvalue;
//move Slider
tmpSlider.value = curvalue;
}
The counter would get the current position and then add or subtract (depending on the button pushed) from the count and then determine max (Math.max) value between the count and the minimum and return that value to step the slider. Well, this wasn’t working correctly. I was trying to figure out if Math.min and some other method of determining the min and max values of the slider, when it hit me to just increment and decrement the value. I use increment all the time in loops, so why wouldn’t it work to move the slider and the list position.
private function prevClick(evt:Event):void{
var tmpHozList:HorizontalList = new HorizontalList();
tmpHozList = evt.target.data[0][0];
var tmpSlider:HSlider = new HSlider;
tmpSlider = evt.target.data[0][1];
if(tmpHozList.horizontalScrollPosition > 0){
//move Horizontal List
tmpHozList.horizontalScrollPosition--;
//move Slider
tmpSlider.value--;
}
}
private function nextClick(evt:Event):void{
var tmpHozList:HorizontalList = new HorizontalList();
tmpHozList = evt.target.data[0][0];
var tmpSlider:HSlider = new HSlider;
tmpSlider = evt.target.data[0][1];
//move Horizontal List
tmpHozList.horizontalScrollPosition++;
//move Slider
tmpSlider.value++;
}
Well, it did work, except for one small issue. For some reason, increase the count didn’t cause any issues. Possibly the max amount it can increment on the HorizontalList works great, but the minimum value does not. Regardless, decrementing the values would lead to the list position going below 0 and causing an error. Which means, that for the previous button, I had to put a check in to make sure the current value wasn’t less than the minimum value, which was 1. Anything over 0 was fine. Simple and less code. Now I just have to go through and update the other slider list combos.
A few weeks ago, during our monthly meeting, a member of The RTP “Let’s Make a Movie” Meetup group mentioned the SPARKcon Festival coming up in Raleigh. SPARKcon has been going on for 6 years and last year they added a 48 Hour Film Challenge to their filmSPARK. At first I was a little hesitant about doing the challenge for a few reasons. One, the 48 Hour Film Project, cost over $100 to enter, so I didn’t know how much this would cost. Second, it was very short notice, so I didn’t now how many people I could get to do the film. And finally, I had to okay it with the wife, since she enjoys spending time with her husband on the weekends. Well, I found out that the challenge was free, the wife was okay with me filming for the weekend and so I set out to get recruits from the group. I was surprised to get more than a handful of people signed up, even if I had some communication issues. Also, my main camera guy said he was available for the shooting day, which would make life easier for me.
On Friday Sept. 9th, I drove down to Mission Valley Cinemas to pick up my team packet. The pickup time was between 8:00 and 9:00 pm. This is a late starting time, but then it gives you more time on Sunday for editing. I was the first person there and had a nice little conversation with the challenge hosts before picking packet number 7 for my team. I headed on home to beat the crowd that was supposed to meet at my house for brainstorming and writing.
The were some more communication issues, but eventually everyone showed up and we started kicking around ideas. The packet contained or film elements, which were an oven mitt as a prop and the line “God, I love being a turtle!” Apparently this was from a Teenage Mutant Ninja Turtles movie, because each team had a different movie line, but the same prop. This was different from the 48 Hour Film Project, where each team had the same prop, line of dialog and character, but drew different genres. The challenge only had a few genres and we selected Action/Suspense/Thriller for ours. The time limit for the challenge was also shorter, only 5 minutes. When the brainstorming started, we had several ideas, but it seemed a little impossible to tell the entire story in the short amount of time. Most of our ideas when down the path of The Tortoise and The Hare, due to the nature of the line. We even pondered doing a car chase. In the end, we decided to go with a simple story of a person suffering from agoraphobia attempting to make her way outside. After coming up with the basics of the story, the writer and I hashed out what seemed to be a barely over 2 minute long movie. I wasn’t very pleased with the length.
On Saturday morning, I woke up at my normal time and started prepping my house for the shoot. I had to clean out my kitchen of stuff and set the stage. The benefit of this was, after the movie was done, my kitchen was picked up and clean! After everyone showed up, we gave the actors their lines to go over and I walked out the first shot with the camera guy. After a few walk through shots, we put the actress in her spot and started filming. The great thing is, we only did a couple of test shots and then we were off to the races with the rest of the shots. A couple of our actors had to wait around until 2 pm to say their lines, but that gave them more time to rehearse. In fact, the other female actor was rehearsing while looking through the sliding glass door at the back of my house. At first we thought she was trying to say something to us, but then realized she was just going over her lines. After a while, it seemed a little creepy.
Since the camera guy has a bunch of equipment, we setup a spot light and put a mic on the main character, just in case the volume from the camera wasn’t good enough. In the end, we used only the sound from the camera. We completed filming before 4 pm and tried to wait for the sun to get in a better position for a particular through the window shot. Unfortunately, it didn’t work out and the shot wasn’t used. After downloading the files, the editor started to work on the shots. I download the film as well, but not the audio. Thinking that I would wait and get it from the editor, I didn’t do any editing, instead I cleaned up the house and called the wife to let her know we were done for the evening.
On Sunday, the editor and writer came over and we started cutting everything together. After getting the rough cut down to a almost final cut, I got a hold of my F/X guy and we headed over to his place to add special effects. Well, he had computer issues the week before and the editor’s computer kept putting out glitchy versions. After attempts to do this and attempts to do that, we loaded the entire footage on to the F/X guys computer and he put in the special effects. We didn’t have time to adjust the color, but I thought it looked fine. With about 20 minutes to spare, I headed back to Mission Valley to drop off the final product.
The most frustrating part of this was the fact that we finished filming early on Saturday and Sunday was spent waiting for files to load. Lesson to be learned, downsize the footage before editing. The play back of the video submitted seemed to skip and jitter. However, when the F/X guy played it again later and uploaded it to YouTube, everything seemed fine. So, I just put the thought aside that there was something wrong with the film and waited until the screening.
On Sunday Sept. 17 at Kings in downtown Raleigh, they showed the 14 entries of which 12 qualified for. Some of the films seemed much longer than 5 minutes, some had stories that didn’t seem to go anywhere and then there were some good films. At most, I didn’t think we would win, but possibly be in the top of the group. And that’s what happened. A mockumentary about reality tv’s won the overall award, deserving so. Our film, plus two others won honorable mentions. I’m very proud of this film and I think it is my best film to date. After a year, I think I’m getting a better at this movie stuff.
According to the Flex Test Drive site, you can “Build an application in an hour”. While that is definitely true for a simple application, I would say it takes a little bit longer in real life. I started working through the Test Drive demo using the videos, which probably run less than an hour. Since I am familiar with Flex/Flash Builder, it was easy enough for me to have the video running in the background while I built the application. There were several times that I had to switch back to the video to get a better understanding of what needed to be done, but for the most part, I just listened and completed tasks. I managed to complete the first module between last night’s post and about 9:45, which is around 2 hours. However, I did have to upload the swf file to my website to see if it was working and my wife needed some attention on occasion. Which means, I probably could have completed it in one hour, but I wasn’t timing myself.
The version of Test Drive I used required Flash Builder 4.5, which I was unable to upgrade to unless I buy an upgrade to the Master Collection suite. You save money by purchasing the suites, but in the long run, if you only need to update certain programs, it is a pain in the wallet. Because I am on 4 and the demo was on 4.5, there were some small differences in the instructions. When a search option is added, the search test field has a “prompt” option. This is apparently a new feature with 4.5, because it is not available in 4. Not a huge issue, but it will be interesting to see what else is new in 4.5 that will affect the Test Drive.
Overall, building this simple application was straight forward. Creating stages was very simple in Display view. Just create the stage, add components, create a new state and add different components. Presto! You now have to different stages. Then it was as simple as adding a click option to a button to call each of the stages and then adding a very simple call.
currentStage = "stageIwantToPointTo";
The drag and dropping of data connectors was also very useful. After you have your data connections working, you simply just drag and drop one onto a datagrid or form and do a few setup options and it is done. Making a item detail view was also just as simple as a few drag and drops and some minor code. The Test Drive so far could probably make anyone believe they could create awesome applications in no time at all. However, you are just creating basic applications very quickly. As noted in the last video of the first module, the instructor explains that doing a search to filter the employee table by calling the web service is not a smart thing to do. Each time a search or refreshing to show all records was done, it did a call to the web service to get the data. The instructor points out that it would be better to only call the data once and then use filters in the application to show what was needed. It doesn’t look like Test Drive actually goes over this, so the newbie Flex/Flash Builder user will have to figure this out on their own or possibly through another set of tutorials. For now, here is the result from last night’s work.
On a side note, apparently either Flex or Zend or something triggered a bunch of Twitter Spambots or something, because the Twitter widget on the Demo site is now filled with pointers to Zend post I created last night. I guess it helps with search engine links or something, I don’t know. I find it kind of funny.