// labs

tips

Setting up Flash trace output from the browser on Windows

with 2 comments

We generally use Macs most of the time, but we also have to use PCs often for specific development or testing.

Using tail trace output for debugging on a Mac is great and we can't live without it, but I never really got around to getting it set up on a PC until yesterday. There's just a couple of steps to get it going.
Read the rest of this entry »

Written by Shane Korin

September 17th, 2010 at 10:06 am

Posted in tips

OSX Apache and Mod_ssl

without comments

This one always gets me. Seems so difficult on OSX (Snow Leopard), so for all those who are trying to get https on the base install of apache(2) in snow leopard here are some tips.
Read the rest of this entry »

Written by Michael Archbold

September 1st, 2010 at 4:41 pm

Posted in tips

Tagged with , , ,

Finder and Terminal

without comments

Here we'll show you how to move the present working directory of a Terminal window to the current directory in the front most Finder window.
Read the rest of this entry »

Written by Michael Archbold

August 25th, 2010 at 3:57 pm

Posted in tips

Tagged with ,

Flash Debugger in Chrome

with one comment

Ever since the lovely people at Google have started packaging the flash player into Chrome it's become a little harder to get the debugger version of the player working in this browser. Chrome will default to it's version of the player even after you've installed the debugging version. Here's the simple step you have to take, in Chrome go to:

chrome://plugins

Find the flash player, it should have 2 files as part of it, one is the built-in and the other is the debugger (you may have to click "Details" in the top right to see them). If you haven't installed it yet obviously you just see the built-in, and it doesn't matter the order in which you do install it. The trick is just to disable the built-in player, once you've done that chrome will use the debugger version you've installed.
Read the rest of this entry »

Written by Michael Archbold

August 18th, 2010 at 12:38 pm

Posted in tips

Tagged with , ,

Simple KML Loader Revisited

with 48 comments

Recently we've been using some of our own tools in other projects and found some room for improvement on the KML Loader we developed. In particular we wanted a simple class that could handle all the processing from the loader, adding the resulting overlays to the google map. Also we needed it to load in some of the styles, such as colours and line types.

Example Kml Loader ScreenShot

So we've expanded our KmlLoader class and provided a few additional utility classes.
Read the rest of this entry »

Written by Michael Archbold

August 2nd, 2010 at 10:40 pm

Posted in experiments,library,tips

Tagged with , , ,

The power of mm.cfg

without comments

We all know about mm.cfg and its uses but here's a great reference for all the hidden treasures!!

http://jpauclair.net/2010/02/10/mmcfg-treasure/

Written by Michael Archbold

March 3rd, 2010 at 1:35 pm

Posted in tips

Tagged with

Open Exisiting Project in Eclipse (Flex)

without comments

This one has been frustrating me for a while, I just wanted to open an actionscript project that we have in our svn into my workspace.

Seemed like a simple concept, but I only recently discovered how to do it:

  • Go to File > Import
  • Select General > Existing Projects into Workspace
  • Find your directory with your .project file and select finish

Seems so simple now.

Written by Michael Archbold

February 3rd, 2010 at 9:38 am

Posted in tips

Tagged with , ,

Simple KML Loader

with 9 comments

Lately we have been playing around a fair bit with some google flash maps and have been amazed by the power and simplicity of the API. We used it heavily in the ABC Black Saturday site using custom markers with images and even a scrolling grid.

We were faced with another challenge of being able to mark out areas (districts) within Victoria that represented the most affected regions. These regions were sometimes complex and we needed to be able to update them simply and quickly as the need arose. The regions weren't to be displayed directly but used for two major items. Firstly to focus the map on a particular region, by moving the view to the region contained by these districts, and secondly, to assign events/markers to a district by calculating if they were contained within the bounds of the district lines.

The solution ended up being ridiculously simple. We created a shared map on google maps, with shapes defining the districts. We then could export from this online map to kml by grabbing the view in Google Earth link and changing the output parameter from nl to kml. This gave us the map of the districts in a nice kml format.

abc-district-google-map

Once we had the map in kml we needed to load in the objects and create overlays for google maps. Surprisingly there wasn't a simple "load kml" function in google maps, but there are some nice kml parsing utilities in the google map extras library. So we created a kml loader class that loads the kml file, extracts the objects and creates overlays for placement on a google map. Hopefully it can be helpful to others, check it out from the following:

svn co http://svn.distriqt.com/public/trunk/gmaps

Usage:

Firstly create the loader and start the load of your kml file. You'll need to add a listener to the COMPLETE event to process the code on completion.

  1. import com.distriqt.gmaps.kml.utils.*;
  2.  
  3. var kmlLoader:KmlLoader = new KmlLoader();
  4. kmlLoader.addEventListener( Event.COMPLETE, kmlLoader_completeHandler );
  5. kmlLoader.load( "your-kml-file-location.kml" );

Once the loading is complete you'll have to re-curse through the object list in the loader, adding the objects to your map. Note the "map" variable in the below should be your google map instance.

  1. function kmlLoader_completeHandler( _event:Event ):void
  2. {
  3. for each (var _object:KmlDisplayObject in KmlLoader(_event.currentTarget).objects)
  4. addObject( _object );
  5. }
  6. function addObject( _object:KmlDisplayObject ):void
  7. {
  8. // It may just be a container with child elements
  9. // so check if there is an overlay
  10. if (_object.overlay != null)
  11. {
  12. // Here you can add the kml object to your map
  13. map.addOverlay( _object.overlay );
  14. }
  15. // Add the children
  16. for each (var _child:KmlDisplayObject in _object.children)
  17. addObject( _child );
  18. }

Let us know if you find it useful.

Written by Michael Archbold

October 20th, 2009 at 5:56 pm

Posted in experiments,library,tips

Tagged with , ,

OSX Tweaks

without comments

Here's some essential OSX tweaks / applications that I can never remember and always have to go searching for, so I thought I'd drop them into the one place. I'll update this with more as I remember and find them.

A Quake style terminal - Visor:
http://visor.binaryage.com/
(And you'll need SIMBL for this one)

An open-source package manager (apt-get etc):
Fink

Finder to display full path in title:

defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
killall Finder

Change Login screen background:

sudo defaults write /Library/Preferences/com.apple.loginwindow DesktopPicture "/Path/to/your/loginwindow.jpg"

Change Finder open to use the return key:
http://www.returnopen.com/

Monitoring system statistics application:
http://islayer.com/apps/istatmenus/

Essential toolbar calendar popup:
http://www.charcoaldesign.co.uk/magical

To stop Finder writing .DS_Store files on network volumes:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true

Quick look from the terminal add this line to .bashrc:
ql () { /usr/bin/qlmanage -p "$@" >& /dev/null & }

Search using Spotlight and show a "Quick Look" of matching files (again add this to .bashrc):
locateql ()
{
locatemd "$@" | enquote | xargs qlmanage -p >& /dev/null &
}

Written by Michael Archbold

October 14th, 2009 at 11:18 am

Posted in tips

AS3 on the Command Line

without comments

As anyone who knows me would tell you, I live by the command line, so I thought I would share an old trick to compile as3 applications from the command line in bash.

The trick here is to use the Flex SDK compiler which is available free from Adobe. It also requires having installed java, which is so common on most machines that I won't talk about installation.

The setup process is fairly simple:

Once that's done you should be able to type mxmlc into the command line and see an error stating you must specify a target file. To compile an as3 file simply use the following:

  1. mxmlc main-app-file.as -o output.swf

Additionally I compile my libraries to my-libs.swc by doing the following:

  1. compc -source-path . -include-sources . -output my-libs.swc

Since this is a flex compile you can also use flex syntax in your actionscript to embed resources in the code. Most commonly I use the swf definition line below to simply definite the frame rate and dimensions of the compiled output.

  1. [SWF(width='990',height='680',backgroundColor='0x000000', frameRate='30')]




Now to use Flash CS3's V3 Components see this post: moock.org

Additionally there are Eclipse tools for actionscript: the rasx() context

Written by Michael Archbold

July 1st, 2009 at 11:26 am

Posted in tips

Tagged with , , ,