360|Flex, here I come!

Jacob Wright
June 30th, 2008

I have been invited to speak at 360|Flex this year and am very excited. I will be presenting a level 400 (100 is beginner, 400 advanced) topic entitled Advanced ActionScript APIs. I’ll be talking about how to make your own advanced APIs.

We’ll go in-depth on using custom metadata and we’ll go over extending the proxy class to its fullest. My aim in this presentation is to bring about better APIs in the libraries people are putting out there. Of course, metadata and Proxy extension aren’t the answer and cure-all for this. But they are some of the cooler things you can do. And most people attending the preso will already know the other stuff you should do, such as planning out the API before you start coding, etc.

If we have time I might go over a couple other advanced topics that relate. Such as the IExternalizable interface. But that’s not quite as useful since many of the remoting engines don’t support it. But I can provide a patch to allow AMFPHP to use it! :)

Should be way fun. 360|Flex is going to be in San Jose this year in August. So make plans soon!

Taking the big leap

Jacob Wright
June 27th, 2008

I’m taking the big leap. Again. I’m leaving employmentship and going out on my own. Today is my last day working for mediaRAIN. Suck.

I’m planning on partnering with a friend, Jake Hilton, to provide heavy Flex development for local companies and media firms. We’re both top in the state in Flash, Flex, and Flash Media Server, so we should be able to provide a very nice offering. And we’ll be working on our own products as we find the time. Layered Content is my first priority along those lines and I hope to have a working version out in the next month.

mediaRAIN has been one of the greatest companies I’ve been with. I’m totally going to miss the guys here. I know they’re going to do great things and have mixed feelings about leaving them. But I know what I need to do and will do it.

So now I am free to do contract work. If Jake and I create a company we’ll have to name it something like Jake and Jac. It will probably be a source of confusion for people. :)

If you’re looking for some Flex work go ahead and email me. I’ll see what we can do for you.

I’m also thinking about moving to Portland. Wouldn’t be for a year if it happened, but I’d like to know your thoughts about Portland. Good place to work? Do they have a good user group? Cool people there?

mediaRAIN is Hiring

Jacob Wright
June 12th, 2008

mediaRAIN Is by far the best company I have ever worked for. I absolutely love the environment and the people here. We get work done, we have fun, we play foos ball and computer games together, and we’re doing some way cool Flex/Flash projects all the time. All the people I work with are top notch individuals.

Well, mediaRAIN is hiring. We’re located in the Utah valley about a 10 minute drive from the Rocky Mountains, and we’re looking for a senior Flex developer. We want more gurus, experts, oh, and cool people. Here is our posted job description:

Salary dependent on experience: $60,000 - $100,000
Full paid Medical & Dental Insurance. Matching 401k compensation plan.
Paid time off as well as holidays time off. Great work environment.

Responsibilities:

  • Interact with clients, exploring and advising technological possibilities, discovering solutions that fit their goals
  • Architect and develop large-scale Flash & Flex applications implementing design patterns appropriately
  • Write clean, structured object-oriented code with change and reuse in mind
  • Lead and teach team members throughout a projects life cycle

Qualifications:

  • Self-learning and motivated perspective - seeks excellence
  • Ability to work in an agile development environment
  • OOP Skills - Classes, Interfaces, Composition, Inheritance
  • Comfortable developing in Eclipse-based environment or equivalent
  • Deep experience in ActionScript3 or at least one of the following, Java, C#, C++, Desktop Application Development
  • Develops “fun” projects on the side
  • Midichlorian count must be “through the roof”
  • Preference will be given to applicants who have soccer skills, foosball skills and/or are familiar with the proper usage of the “W”, “A”, “S”, and “D” keys

Please respond to jobs@mediarain.com

AIRActiveRecord is cool

Jacob Wright
June 12th, 2008

Do you ever go back and look at code you wrote and think, “man, that’s pretty cool. I can’t believe how nice that turned out.”

I went back and wrote up some very minimal documentation on using AIRActiveRecord on my post about it and remembered how cool it is. True, more documentation would sure be nice, and I’ll get to that, eventually.

Using in-memory databases in AIR

Jacob Wright
May 16th, 2008

Adobe Integrated Runtime (AIR) has support for creating and using SQLite databases through the use of the SQLConnection class in the flash.data package. Using this package you can store a database on a user's hard drive and even name it with any extension you'd like (registering your app with that extension will let you double click on your "database" file and open the app with that as a parameter, pretty slick).

One feature with the database package often overlooked is its ability to create and use in-memory databases. Using in-memory databases allows for faster read and write to the database and is perfect for operations such as building a code-completion lookup (someone going to rewrite Flex Builder in AIR? :), establishing a temporary search database of all the words in a list of documents that could be used for an autocomplete field, and any other situation where a database would be great to use but doesn't need to be kept around between application launches.

To create an in-memory database simply leave out the file parameter of the database connection.

var db:SQLConnection = new SQLConnection();
db.open(); // no file is passed in

Then you run your database setup script to create your tables and your good to go.

AIR ActiveRecord is Open Source

Jacob Wright
April 29th, 2008

I wrote about an Active Record implementation for the Adobe Integrated Runtime using it's SQLite database functionality. I put up all the code on Google Code under the name AIR Active Record. Please check it out, let me know of bugs or features, or better yet, submit fixes and add-ons. If you're interested in being an active developer on it let me know.

Update:

To use the ActiveRecord (sorry for the lack of documentation), you need to extend it with a class for each table you'll use. For example, if I wanted an employee table I would create an Employee class like this:

package
{
    import flight.db.activeRecord.ActiveRecord;
   
    [RelatedTo(name="tasks", className="Task", multiple)]
   
    public dynamic class Employee extends ActiveRecord
    {
        public var name:String;
        public var position:String;
        public var hireDate:Date;
        public var salary:Number;
        public var created:Date;
        public var modified:Date;
    }
}

package
{
    import flight.db.activeRecord.ActiveRecord;
   
    [RelatedTo(name="employee", className="Employee")]
   
    public dynamic class Task extends ActiveRecord
    {
        public var employeeId:uint;
        public var todo:String;
        public var created:Date;
        public var modified:Date;
       
        public function Task(todo:String = null)
        {
            this.todo = todo;
        }
    }
}

In the metadata, the name is the property name which will be auto-generated and auto-populated (when you access it) for the relation. The className is the full class path (e.g. com.foo.Bar). multiple is a flag that specifies whether it's a one-to-many relationship. You can have many-to-many relationships as well.

If you aren't creating the database yourself there is a handy-dandy feature which will do it for you off of code introspection. Many-to-many is not supported for creation this way unless you have a class for that join table and run it on that.

var employee:Employee = new Employee();
TableCreator.updateTable(employee);

This will create the table if it doesn't exist, but it is also useful for updating the table if you've added new properties to the class. (right now it doesn't delete columns if you remove properties)

Then, you use it. You'll need to look at the code comments, or maybe generate the AS3 docs off of it to see all you can do, but this is some of what you can do (let's say you have an Employee class and a Task class):

var employee = new Employee();
employee.loadBy("username = ?", "bobTheBuilder");

// accessing tasks will autoload them from the database
for each (var task:Task in employee.tasks)
    trace(task);

task = new Task("Call your mother");
employee.task.push(task);
employee.saveTasks();

employee.firstName = "Bobby";
employee.save();

var employee2:Employee = new Employee();
employee2.firstName = "Sue";
....
employee2.save();
trace(employee2.id); // new id

Pretty cool stuff. Maybe someone should document it! :D Anyone interested in figuring out and documenting super-cool code, please apply!

Next Page »