Technocolor.tv

Posted by | Posted in General | Posted on 25-05-2009

The first online TV station, by which I mean, a place on the web where you kick back and watch videos. I am also in the process of adding channels and other features, much more to come, stay tuned! CHECK IT OUT

Populating a TileList (or anything) from XML Fast!

Posted by | Posted in Actionscript 3.0, Flex | Posted on 25-05-2009

I ran across this method while building an application I am currently working on and it struck me as incredibly simple and elegant.  I didn't realize how easy and flexible Flex really is until I came across this.  So basically, you want to populate something from an XML file.  Well, Flex has built in mechanisms, which make this incredibly easy and are surprisingly flexible.

So say your XML is a file called items.xml containing the following lines of code:

 
<?xml version="1.0"?>
<items>
   <item thumb="thumb1.jpg" source="test1.jpg">an item</item>
   <item thumb="thumb2.jpg" source="test2.jpg">another item</item>
</items>
 

Now, your main application will contain something like this:

 
   <mx:XML id="xml" source="items.xml"/>
   <mx:XMLListCollection id="myXMLList" source="{xml.items.item}" />
   <mx:TileList id="waistbandsTL" y="0"
    	dataProvider="{myXMLList}"
        itemRenderer="CustomRenderer"
        itemClick="itemClick(event);"/>
 
   <mx:Script>
      <![CDATA[
                       import mx.events.ListEvent;
                       private function itemClick(e:ListEvent = null):void
                       {
                            //Event handling code
                       }
               ]]>
   </mx:Script>
 

What this basically does is load an XML file, binds a part of it to an XMLListCollection, which in turn is bound to the TileList. The beauty in this is that the custom renderer can be any component. Here is an example implementation:

 
<mx:Canvas>
   <mx:Image id="thumb" source="{data.@thumb}"/>
   <mx:Object id="imageSource" data="{data.@source}"/>
   <mx:Label id="label" text="{data.toString()}" />
</mx:Canvas>
 

And the data of the renderer is automatically bound as well. Very simple, easy and powerful.

Great Flash WordPress Plugin

Posted by | Posted in Resources, Wordpress | Posted on 23-05-2009

If you have a wordpress blog and frequently embed SWF files you will need this: Kimili WordPress plugin.  It comes complete with a button for the WordPress posting page, which launches a window that will help you very quickly embed SWF files.  Very handy.

3D on the Web

Posted by | Posted in 3D | Posted on 03-05-2009

If you haven't seen these yet you should have a look. It looks 3D is making it's way to the web and it's looking amazing.  As a flash developer I have dabbled in 3D for the web in the form of the many frameworks that exist these days, such as Papervision and Away3D, and though both are incredible technologies, they can't compare to a plugin written specifically for this purpose.  From what I have seen the performance and rendering power of these engines is beyond impressive and I believe these will pop up in the form of online gaming.  Also, if that's not enough, it appears that the dominant syntax for web 3D is going to be Javascript which equals easy coding.  Check them out.
Unity3D

Google O3D