This is a quick little app that showcases a class I created (LocalDatabaseService.as) to take some of the boilerplate code out of dealing with the local database in AIR. You can create an ActionScript object and pass it into the createTable method and it will create the table for you by interrogating the AS object. You can then use the add, update, save, remove, getAll, and getByID methods by passing in an object along with the table name and a responder. There is still a lot I would like to do with this, and there is definitely some refactoring to be done, but I wanted to share just the same.
Requirement: Your ActionScript object must have an id property named "ID".
Next up, I am going to add some code to handle one-to-many and many-to-many relationships between objects. Maybe create some recursive saving and add a little documentation... but not tonight. :)
Enjoy...
Sample Application: IdeaBank
Just a place to empty my brain from time to time
in an attempt to help me regain clarity.
Tuesday, October 9, 2007
Tuesday, August 14, 2007
OnAir Bus Tour Review
I just got back to the hotel room from the Adobe OnAir Bus Tour in Atlanta. If you get a chance to catch it on one of the remaining stops, you owe it to yourself to do so. Kudos to the guys from Adobe for putting on a great show. There was plenty of food, drink, and great presentations. I got the opportunity to meet Mike Chambers, Christian Cantrell, Kevin Hoyt, Ben Forta, Daniel Dura and several local/regional developers. Everyone was very nice, and I got several questions answered straight from the horses mouth, so to speak. It looks like there is some really cool stuff on the horizon AIR.
Monday, August 13, 2007
OnAir Bus Tour
Long time no blog. :( I've been pretty busy at work, and as a result my blog has suffered. Well, time to change that.
I just arrived in Atlanta for the OnAir Bus Tour at the Fox Theater. Really looking forward to a full day of Adobe goodness. If your at the conference, track me down and say hi. I'll blog tomorrow night and let you know how it went.
I just arrived in Atlanta for the OnAir Bus Tour at the Fox Theater. Really looking forward to a full day of Adobe goodness. If your at the conference, track me down and say hi. I'll blog tomorrow night and let you know how it went.
Monday, June 11, 2007
My First Apollo App Revisited
I have just installed Flex Builder 3 beta and the new AIR runtime beta (that's a little redundant). To kick the tires so to speak, I updated my Apollo Video Player to the new and improved (not really) AIR Flash Video Player. I hope the name "AIR" will grow on me. Right now I'm not too sure about it. :)
Updating the code to jive with beta 1 went surprisingly well. The only code I had to change was one line that referred to "File.appStorageDirectory". The new method name is "applicationStorageDirectory". Piece of cake. Hope all of my other apps upgrade this easily.
Please let me know if you find any issues!
Download AIR Flash Video Player
Download Adobe Integrated Runtime
Updating the code to jive with beta 1 went surprisingly well. The only code I had to change was one line that referred to "File.appStorageDirectory". The new method name is "applicationStorageDirectory". Piece of cake. Hope all of my other apps upgrade this easily.
Please let me know if you find any issues!
Download AIR Flash Video Player
Download Adobe Integrated Runtime
Thursday, April 19, 2007
Flex 2 Developer Exam
The last few days have been good. First, my Flex/ActionScript posters arrived. Next, my Apollo Pocket Guide was delivered. Then yesterday, I passed the Flex 2 Developer Exam! Good week so far. :)
Funny thing about the posters, I am having trouble finding space on my office walls to put them. They are flipping huge!
Funny thing about the posters, I am having trouble finding space on my office walls to put them. They are flipping huge!
Thursday, April 5, 2007
Free Posters!!!
Saturday, March 31, 2007
RemoteObject Mapping... again
Ok... I'm posting this as a checklist of possible reasons why an Actionscript object will not properly map to a ColdFusion CFC (or Java object for that matter). I just went through about thirty minutes of debugging trying to track down why I was getting an array of generic Actionscript objects instead of my custom objects. I seem to run into this fairly often. : )
1. Did not include [RemoteClass(alias="YourObjectPath")] in the Actionscript class.
2. Did not import the Actionscript class into the application.
2. Did not include an instance of the Actionscript class into the application.
3. Did not have the same number and name of properties on both the Actionscript object and the server side object.
4. Have import statements after the RemoteClass alias metadata. (This is what happened to me tonight... oops!)
If you can think of something I've missed let me know so I can update the list.
1. Did not include [RemoteClass(alias="YourObjectPath")] in the Actionscript class.
2. Did not import the Actionscript class into the application.
2. Did not include an instance of the Actionscript class into the application.
3. Did not have the same number and name of properties on both the Actionscript object and the server side object.
4. Have import statements after the RemoteClass alias metadata. (This is what happened to me tonight... oops!)
If you can think of something I've missed let me know so I can update the list.
Sunday, March 25, 2007
My First "Alpha" Release
I have been programming with the Apollo Alpha for about a week now and I have to say that it has been a blast! I've programmed desktop apps in the past using .NET, but I am a web developer at heart. So it always took a mental shift to switch from web app to desktop mode. In desktop development you don't have to worry about sessions, page refreshes, and where to store your data in a stateless environment. That's why I have always enjoyed working in Flash/Flex. Your data is always available with having to jump through hoops. If any of you have tried to build a relatively complex user control in asp.net you will know what I am talking about. That is what I love about Apollo, the ability to move between web application and desktop application development with almost no change in thought process. So anyway, in the past week I have built several Apollo apps. Today I would like to share with you an Apollo Flash video player. This is my "Hello World" so to speak. To make it interesting I created some custom chrome and added a feature that saves the play head location along with the file when you close the app. That way when you open the player again it starts where you left off. This app was inspired by the downloadable videos from video.onflex.org. If you haven't been there yet you owe it to yourself.
Screen Shot
Screen Shot 2 - when you move the app it becomes semi-tranparent
Keep in mind this is an alpha application on an alpha runtime (doesn't get much scarier than that). So if/when you find any bugs let me know and I'll try to fix them in the beta. :)
Also, anyone who tries it on a mac let me know how it goes.
Monday, March 19, 2007
Apollo Alpha Video on Lynda.com
The alpha of Apollo has been released on Adobe Labs! With in five minutes of installation I had my own basic web browser up and running. This is going to be lots of fun.
To help you get started with your exploration of the alpha go check out lynda.com. They have Mike Chamber's "Apollo Alpha Preview" video available for viewing. Good stuff.
Happy coding!
To help you get started with your exploration of the alpha go check out lynda.com. They have Mike Chamber's "Apollo Alpha Preview" video available for viewing. Good stuff.
Happy coding!
Thursday, March 15, 2007
Apollo for Flex Developers Pocket Guide
The Apollo for Flex Developers Pocket Guide is available on O'Reilly Safari Books Online! Can't stay and chat, I have a pocket guide to read woohoo!!!!
Wednesday, January 31, 2007
New Flex 2 Training Video
Totaltraining.com has just released a new Flex 2 video "Adobe® Flex 2 Advanced Visual Programming" hosted by Leo M. Schuman. This is actually very timely for me. I've got a couple of apps that I have just "finished" that I would like to dress up with some transitions to make the UI a little friendlier. Can't wait to see it!
Thursday, January 25, 2007
Flex 2 and SEO
I have been thinking a lot about FXT lately. This is a really interesting idea. Basically, you are creating an html page that contains nothing but content formatted into an xml structure and a Flex swf file that can parse the content to display in a full page flash layout. The xml can contain your sitemap structure which could be parsed using E4X into whatever kind of navigation you want, you could setup different nodes in the xml for different columns in the layout, the possibilities are wide open. All of this is databound to Flex controls or components so that Flex knows where to put everything. On top of that, you can use states to reformat the content on the fly. For instance, creating a state for a print version of the page, being able to change a page in real time from a two column layout to a three column layout, having a drag and drop layout that would remember the user's setting on a return visit, all of this would be trivial to build. And the best thing of all is that since the source of the html file would be almost purely content, the search engines can index your site just as they can a standard html site. Very exciting stuff.
Tuesday, January 23, 2007
Issues with the Coldfusion Wizards
I have noticed a few gotchas with the Coldfusion Wizards for Flex 2. In this post I want to talk about the issue I have found with the save method in the gateway CFC that is created when you generate an Active Record CFC type from a database table. This is the save method that is created:
<cffunction name="save" output="false" access="remote">
<cfargument name="obj" required="true" />
<cfreturn obj.save() />
</cffunction>
This works so far as it will save the object to the database, but it fails to return the object to the result method in Flex. After some banging around I modified the code to the following:
<cffunction name="save" output="false" access="remote">
<cfargument name="obj" required="true" />
<cfset obj.save() />
<cfreturn obj />
</cffunction>
This saves the object to the database AND returns the object back to Flex. Now if I can figure out if it is possible to modify the way the Coldfusion Wizards write code I can save myself alot of copy and paste! If anyone knows drop me a line.
<cffunction name="save" output="false" access="remote">
<cfargument name="obj" required="true" />
<cfreturn obj.save() />
</cffunction>
This works so far as it will save the object to the database, but it fails to return the object to the result method in Flex. After some banging around I modified the code to the following:
<cffunction name="save" output="false" access="remote">
<cfargument name="obj" required="true" />
<cfset obj.save() />
<cfreturn obj />
</cffunction>
This saves the object to the database AND returns the object back to Flex. Now if I can figure out if it is possible to modify the way the Coldfusion Wizards write code I can save myself alot of copy and paste! If anyone knows drop me a line.
Flex 2 and Coldfusion Remote Object Mapping Issues
Today I was having trouble mapping an object from Flex to Coldfusion. According to all the documentation I could find, all you have to do is match the properties between the Actionscript object and the CFC (same number of properties and naming) then set the "RemoteClass" metadata on the Actionscript class and the "alias" in your Coldfusion CFC. That should do it... The problem was that whenever I would debug my app and inspect the result from the remote call, I would see a generic object instead of the typed object that I was exspecting. The problem was solved by importing my class into the mxml file and creating a bindable variable of the same type as the class in question. When I debugged the app, there was my typed object. Interesting...
My Adventures with Flex 2 and Coldfusion
First off, let me say that I am fairly new to Coldfusion. I have been developing in .NET since it's inception and in ASP before that. I've been programming in Actionscript since Flash 4 and I didn't start working in Flex until the first beta release of version 2.0. However, from the moment I first installed Flex 2, I took to it like a duck to water. Everything in Flex 2 just clicked. It is what I have been longing for in a development environment. I enjoy it so much that I have even left my .NET security blanket for the promise of Flex/Coldfusion remoting bliss. While all has gone fairly smoothly, there have been a few bumps in the road. These bumps are what I'll be posting about while I get my blogging feet wet. In the future I plan on posting some tutorials about using frameworks such as Cairngorm, Reactor, and Coldspring with Flex and Coldfusion. Later.
Subscribe to:
Posts (Atom)