Monday, May 19, 2008

Blog is moving

Being the control freak I am and wanting more control over my blog, I'm now hosting it myself using WordPress. It's now located at blog.noti.ca. See you there!

Saturday, May 17, 2008

ProxyLoader Class

With my latest project I had lots of external assets loading. I wanted to make sure people knew something was happening while an asset was loading and I didn't want to create a preloader everytime, in comes ProxyLoader.
ProxyLoader is simply a Sprite that takes care of loading the asset via a Loader, draws a preloader, and border. It then destroys the preloader after the asset has been loaded.
One feature I added to this Class is the ability to create any type of visual preloader using the IPreloadable interface. So you can have a text preloader of one type of asset and a Movieclip for another as long as it implements the interface.
You can use the class in a very similar fashion as Loader, but you need to pass a width and height argument.

var loader:ProxyLoader = new ProxyLoader(435, 250);
loader.load(new URLRequest("path.to.asset"));
addChild(loader);

If you want to see the methods I have posted some docs here. You can download the package here. Hope it helps someone out.

New Site - www.forkedup.com

Over the past 2 months I've been really busy developing and building a new AS3 site for Masterlift called Forked Up. It's a new reality TV series similar to American Hot Rod, but with forklifts. They're trying to have this show picked up by one of the networks here in Canada and the pilot looks fairly interesting.
I built the client side Flash, server sided PHP Classes and the database. It is now officially the largest project I've ever undertaken by myself. The previous was also a job from Masterlift, pimpmylift.

Hope you enjoy it.

Thursday, March 27, 2008

Down with Facebook, up with Hobnox

** This post is off-topic from my usual AS stuff

I recently became aware of a new community through my love of electronic music and passion of Flash from Hobnox tools. But now that I have been accepted in the private beta, I've discovered it's so much more. It's a community, a television, blog and other mash-ups of technologies.
The reason I'm liking Hobnox is that Facebook has become a community of odd ball apps that I get asked to participate in at every turn. I haven't even logged in to my Facebook in months (if you're reading this from my Facebook page, it's because my blogger pages get imported automagically) and haven't missed it one bit.
But if you know me, you know I can get bored quickly, so the true test is the test of time. And time will tell.

Friday, March 21, 2008

Earth Hour 2008

I hope you're participating.. sign up with me at http://www.earthhour.org/user/hCke and join the movement.

Thursday, March 20, 2008

New AIR app for Aveda

My second AIR app (the first for work) has been finished. It's an application that polls a web server and synchronizes a local database with any new media alerts.
It rose out of the need for Aveda Partners (aka AP's ... think regional managers) to have a quick and easy way to know of new media reviews on products. Previously, this was done via e-mail and caused some issues, like having many alerts in the inbox and having to sort through them all. AP's wanted the e-mail channel free for more sales related issues. They also wanted to have the ability to only download the full pdf alert for the one's they were interested in. This was especially important for AP's in Quebec, where some english alerts have had little value.
I learned quite a bit about AIR building it, like interacting with the local db and using icons. I also learned more about php building the back end.

I'm really looking forward to my next app... a rebuild of my Chart generator.

Unfortunately the application isn't publicly available but I have included a screenshot below.

Tuesday, March 11, 2008

I walk for water - Every drop counts

My company (Collega Aveda) is very active with the environment and issues affecting the Earth, so every year they participate in Earth Month. This year is "Every drop counts". An initative with WaterCan to make clean water accessible to everyone. (Did you a child dies every 15 seconds in the world due to a lack of access to clean water?)
So what we are doing is the "Walk for water". In major cities around Canada we are trying to get people to walk 5km and raise money for WaterCan.
You can visit www.iwaterforwater.ca for more information and register for the walk or sponsor me for my walk in Toronto. You can also become active in other ways through WaterCan.

On another note, I did build the back end in PHP for this initative (I didn't design it) that's where my comments on PHP from my other post came from ;)

Friday, March 7, 2008

FITC here I come!

It's now official, I WILL be attending the FITC in Toronto this year! My company bought my ticket yesterday. I've always wanted to go but the price tag for me to pay out of my own pocket was always too high ($699).
I'm so excited about going and seeing speakers I've read so much about, namely Colin Moock, Keith Peters and Grant Skinner.. all geniuses in the AS realm. I'm also very interested to go to the session "Making REAL Music Within Flash with André Michelle". I'm a HUGE electronic music fan and to be able to do this would blow my mind!

(giddity, giddity)

Wednesday, March 5, 2008

PHP, ASP and Actionscript

First off, this blog will be extremely bias, towards what, you'll soon find out. ; )
I've recently had to work for the past 2 weeks with server sided scripting. I've generally tried to avoid it because I don't to regress to where I was a couple of years ago, jack-of-all-scripts. But my lastest work project required I do some server sided scripting to interact with a MySQL database and Flash (using amf).
I must say server sided scripting with PHP was MUCH easier that I remember in the past. Within a couple hours I had written several PHP Classes with the interaction I needed. Granted they were probably not the cleanest scripts the world, but by did the job that was required.
Now in comes my friend from IT (I'm in Marketing) and states "any new server sided code MUST be in .NET". My first reaction was (clean version...)"great another script to impede me from doing more Actionscripting, but if I have to fine." But after thinking about it, I came to ask "why?" Although all intranet pages are done with .NET, web based scripts are PHP. From a selfish point of view I thought, in the long run (as a developer), which language will give me more leverage to increase my salary in the job market. Without a doubt, I believe it's PHP. Why? Based mostly on personal experience, recruiters have often asked me "Do you know PHP?" If I look on job boards I see much more postings for PHP developers than ASP.
My reasoning for this is two-fold. Microsoft makes tons of money certifying .NET developers, where as PHP has no regulating body. PHP is niche, not many people do it WELL. When a company needs a niche developer, they pay more.
Now don't get me wrong. If you're looking for a much more stable career, that's regulated, and almost guaranteed to always be around than .NET is the way to go. But if you're like me and gamble on occasion (I dedicated myself to ActionsScript when everyone thought I was crazy) I strongly believe PHP is the way to go.

Wednesday, February 27, 2008

SQLStatement lesson

I've been working a lot with the new built-in database that comes bundled with AIR and I ran into something that gave me a bit of trouble.
It was retrieving some info from the database and reading the SQLResult using the getResult() in my retrieving method from my SQLStatement. Like usual, I was trying to read if the method was called using a trace statement and also tracing out the result using getResult(). With the trace statement, I was reading everything fine, but when I went to evaluate the SQLStatement again using getResult(), I always got NULL. How can this be? I traced out a result!? Well it turns out (if you read the help files carefully) that "When there are no more SQLResult objects left in the queue, getResult() returns null." So even tracing out getResult() removes it from the SQLStatement queue! So be warned, pass it to a variable BEFORE reading it and you'll save a lot of time troubleshooting!

Another lesson learned, but it wouldn't fun if it wasn't ;)

Tuesday, February 12, 2008

Reading a local database created with AIR

I found this neat little app that reads a SQLite database, so you can quickly and easily see whats been written to the database from your AIR file.

Hopefully, it will help you as much as it's helped me recently ;)

Friday, February 8, 2008

Posting Code on Blogger

<------ RANT Start ----->
Well I've several hours trying to find an easy way to post code on Blogger and I'm convinced it can't be done. At least not easily. I know wordpress has a easy way of doing why not Blogger? They even have a repository of code at Google CODE, so you'd think this would be an easy task.

Well if anyone knows how to do it, please let me know.
<------ RANT End----->

Wednesday, February 6, 2008

AS3 Custom Events

I've read in couple of blogs (this one recently) on the problems with passing data between Objects/Classes. I, myself, used to use Proxy as well as binding data to dynamic classes (ie-MovieClip) a LOT of the time in AS2, but now in AS3 things have changed (for the BETTER!).
In comes Custom Events. I recently used Custom Events in a project where I wrote a Class for controlling the Sound object. I found using Custom Events was MUCH easier than it's reputation is known for, and very similar in nature to Proxy. Below is a quick Sample of the SoundControlEvent.





With CustomEvents it easy to read the passed property without having to access the dispatching object. As outlined below:

var evt:SoundControlEvent = new SoundControlEvent(SoundControlEvent.SOUND_POSITION);
evt.position = _channel.position;
dispatchEvent(evt);

Hopefully Custom Events will become more popular as AS3 gets futher into the mainstream. It makes for easy to read code that extremely portable.

Monday, February 4, 2008

Communicating between AIR (swf) windows

I wanted to make a quick note on something I came across yesterday as I was working on my AIR app that uses separate NativeWindows.
Essentially what I wanted to do was call a method in another swf and pass it an argument.. a path to a song in the local file system. The way I approached this was with LocalConnection. (If there is another way to communicate between NativeWindows please let me know!) I had set up listeners in the swf for a status.level of either 'status' or 'error' so I could make sure I was actually communicating. Every time I tried to communicate between the two swf's I would get an 'error' condition. What was the problem? It seems that in AIR you must allow the local domain. As soon as I added:

_conn.allowDomain('*');
Everything worked fine.

Hopefully this will help someone searching for some answers on communicating between windows.

Sunday, February 3, 2008

Multiple Windows in AIR

I was working on my MusicPlayer app and I wanted to open my player from the playlist manager in another window. This actually isn't very hard, but if you're not careful you'll open the new window and nothing will appear! That's because after you've initialize all the NativeWindow properties you MUST set the visible property to true. If you don't, the window is created but nothing is visible on screen.

Luckily for me I was opening a swf with sound or else I wouldn't never known something fishy was happening and might've thought I was initializing it incorrectly. I could hear the music but I couldn't see anything. After reviewing some examples, I could see the error of my ways.

On a similar note, make sure you set the stage.scaleMode and stage.align properties for the new window or else you may end up with a very odd sized loaded asset.

Friday, February 1, 2008

I'm BACK!!

After a looooong break with job changes and freelance work I'm back blogging again. I'm going to try and keep my blogs now to all my experiments in AIR and Actionscript 3 and post the results whenever I can.

My first post back is about a little problem that had me pulling my hair (what I have left of it) out. What should've taken me about 10 minutes took over 3 hours! I'm hoping this may help someone else out and save them the aggrevation. It has to do with the latest AIR beta 3 update available at adobe labs.

Being the impatient person I am, I always love to play with the lastes toys, I downloaded the latest AIR beta update. The first thing you have to know is that you HAVE to update your Flash CS3 to Flash 9.0.2. That took me about two attempts to install the update to figure out (the updater just states something along the lines of "This program does not qualify for this update.".. very helpful). After that was complete the updater worked, but none of my AIR apps would compile it kept giving me the error that a class couldn't be found. That really confused me because I knew I had updated everything. I then tried the command in Flash "AIR - Create AIR file" which still produced the same error. Now I was really confused. After some searches on Adobe labs, it stated that this error will only occur on the first compile... which wasn't happening (at least for me). After tinkering around I finally noticed that on another file that did compile the following was missing from the publish settings in the Actionscript 3.0 classpaths:


$(AppConfig)/ActionScript 3.0 AIR 1.0/Classes

After I added that to my newly created app, everything compiled correctly. Now I just hope Adobe makes things a little easier when version 1 is released.