Flash, Mac and iPhone stuff
18 Aug
Just a quick note about our sister site - flCodr.
There is an update available for the extension panel. Find out more about it here: www.flcodr.com/download.php
12 Aug
My latest Flash based location app is called Find Me and is basically a mash up using Google Maps API, the GMap Flash component and a geo-ip script that tweets your location on Twitter.
Take a look at it here. Please note that is in beta at the moment. You will also need a Twitter account set up which can be done here.
To tweet your location simply enter your username and password and click on the green tick. When the app loads click on the little transmit icon at the bottom right.
Your information is stored on a cookie on your local machine and is not saved anywhere on my server. If you like just enter some random text and save the settings to overwrite your details.
The process involves a php script which geo-locates a users position based on their IP address. This should be noted that it isn’t 100% accurate as it relies on the IP of either the host machine, router or ISP. When I try this with BT it locates me in London even though I am in Birmingham.
The script outputs a latitude and longitude which I then use to place a marker on the GMap component. Look at this post for more info.
Finally by clicking on the marker the user can see the position aswell as the name and even more info by clicking on a link.
When I have had a play around with the Fire eagle API, I will add support for the Fire Eagle service. If you don’t know what Fire eagle is it basically allows you to update your location and then share that with other web services and apps. This is definitely going to be big business in the future with devices like the iPhone 3G and Nokia N95 having the ability to update your location automatically.
I would really like to build an app that would periodically update your status from an iPhone to Fire eagle, however i’m not too sure I would want people tracking me all the time!!
12 Aug
Not that I mean to show off or anything, but I was in Web Designer Mag again this month.
This time they were featuring my Locator panel extension for the GMap component. The extension is a search engine for latitude and longitude co-ordinates that can be entered into the GMap component as points on a map.
To read about it, take a look at the original post here.
Take a read of Web Designer Mag for loads of Flash, Dreamweaver and Photoshop goodness, plus subscribe to my RSS feed to stay updated on my future Flash work.
8 Aug
After many hours of hard work by the team here at the SizzlaMedia offices (ok just me, in the study) the problem with the GMap powered apps has been fixed. Turns out a Google Analytics script was somehow appearing in the Flash apps.
Once I removed the script everything seemed to work just fine!
Hopefully we won’t see any more errors popping up!!
3 Jul
The latest issue of Web Designer Mag recently landed on my door mat and I was pleasantly surprised to see some of my work included in the mag and on their promotional disc.
I was contacted by the editor a month or two ago about flCodr - the online repository for actionscript snippets. The site allows you to add and view snippets of actionscript code, perfect for when you can’t remember how to parse XML.
Web Designer Mag say that:
flCodr.com is a repository of code that has been placed in a single centralised location for quick and easy access. The site works by providing a simple search facility to find snippets of code. For instant access, introduce the flCodr search plug-in to your browser. Add a search term, click a link and you are ready to copy and paste the code.
I couldn’t have put it better myself. I’m really chuffed that I managed to make it to both the mag and the disc!
Head on over to their site to view the mag and subscribe. It’s well worth the money as each month it’s full of tips, tutorials and assets to make your creations even better!
15 Jun
A tag cloud (or weighted list in visual design) is a visual depiction of user-generated tags used typically to describe the content of web sites. Tags are usually single words and are typically listed alphabetically, and the importance of a tag is shown with font size or color. Thus both finding a tag by alphabet and by popularity is possible. The tags are usually hyperlinks that lead to a collection of items that are associated with a tag.
A tag cloud is a set of related tags with corresponding weights. Typical tag clouds have between 30 and 150 tags. The weights are represented using font sizes or other visual clues. Meanwhile, histograms or pie charts are most commonly used to represent approximately a dozen different weights. Hence, tag clouds can represent many more weights, though less accurately so. Also, frequently, tag clouds are interactive: tags are hyperlinks typically allowing the user to drill down on the data.
As a Flash developer I thought it would be nice to display the tags in a dynamic virtual tag. I was planning on using Papervision 3D to do this, but then stumbled across this blog post. The hard work had already been done after a wordpress plugin was created.
Rather than re-write the script, I simply modified it to work with the data in my database and hey presto I now have a dynamic and interesting tag cloud.
Take a look at it in action, over at my other site flCodr.
4 Jun
Back in my University days having a Mac was not always fun in a Windows dominated campus. I always had to ensure that my disc’s were able to be read in a Windows machine, even though they were burned on a Mac. After looking over some of my files I decided to share with the world some of the code snippets I found along the way. This posts concerns creating cross plaform Flash CD-Roms, inparticular opening folders from projectors.
Auto Run
Due to a security vulnerability in OS X 8 (i think!) the auto run feature was disabled on a Mac, however there was an option to open the root folder by default (a really easy option using Toast Titanium).
In Windows an autorun.inf file should be created. This can display an icon and launch an .exe or .bat file as well as set the label for the disc.
[autorun]
open=myApp.exe
label=My App
icon=myApp.ico
As previously mentioned by using Toast Titanium on the Mac it is very easy to open up a folder containing the .app file to launch. You can also specify which folders and files should be seen by each operating system.
Opening Folders from Flash
Opening folders or files from Flash is a bit of a work around these days. Before Flash MX 2004 it was relatively easy to do, but after a security vulnerability this freedom was closed down. You now need to place your .exe or .app files in a folder called fscommand. It has to be this AND ONLY this. This fscommand folder must be at the same level as the Flash projector. i.e
My Folder >
myProjector.exe
myProjector.app
fscommand
You may be thinking “how do I open up an application from here then?”
The answer is to use a helper file; in Windows an .exe and in Mac an AppleScript file saved as an .app. I will show you how to open a folder from a Flash projector as this was an issue I had problems with as a student when trying to create an interactive CV. There are various ways, but these methods seem the most robust. Both methods use the exec parameter from the fscommand:
fscommand(”exec”,”AppName”)
Windows
In Windows the process is a bit of a bitch. You can thank the creators of the first Flash virus (SWF/LFM-926) for the fact that every version of the stand-alone Flash player since Flash MX has restricted the use of the EXEC command. This change made it impossible for anyone to create any new Flash based viruses, but it also crippled the Flash projector as a tool for legitimate users by instantly rendering many free projector extension tools useless.
There are four key restrictions that you have to keep in mind when working with the EXEC fscommand and standalone Flash projectors. (i) Executables you want to run via the EXEC fscommand have to be in a special sandboxed folder called fscommand in the same directory as the projector. (ii) You can’t specify a path in the EXEC command, just a filename. If the specified file is not found in the fscommand folder, it won’t run. (iii) The only argument allowed by the EXEC fscommand is a filename, there is no way to pass arguments to the executables that you want to run. (iv) You can’t use EXEC from an SWF file, it will only work from a projector (EXE). The last restriction doesn’t really concern us, but if you’re trying to test your EXEC calls, being aware of it will save you some frustration.
One solution to get around the limitations of the EXEC fscommand is to create one exectuable file for each file that you want to open, but what can you do if you don’t know how to make EXE files? Windows and Flash both consider a BAT file as an executable file so the easy solution is to create a BAT file for each file you want to open and EXEC the BAT file from Flash. You don’t need to be a BAT file wizard to do this, the simple one-liner below (let’s call it mydoc.bat) will do the trick:
start mydoc.pdf
That example assumes that both mydoc.bat and mydoc.pdf are in the fscommand folder. You can change the BAT file to launch the PDF file from anywhere you like, as long as you can create a valid path to the file. Now all you have to do is create a BAT file for every file you want to open and call it from Flash like this:
fscommand(”exec”, “mydoc.bat”);
The only problem with this approach is that your user is going to see the ugly black DOS box appear every time they open a file. That’s where the proxy utility can help you create a more professional looking end product for your users. Proxy is able to launch BAT files and suppress the ugly DOS box.
The proxy file will launch a .bat file with the same name. Inside the .bat file the following code should be placed. This will simply open up an Explorer (not Internet Explorer) Window for the specified folder. The path is relative to the .bat file.
%SystemRoot%\explorer.exe “FolderName“
The proxy.exe file needed can be found in the zip below. The only rule is that the .exe and .bat file must have the same name. To open up multiple folders, simply create new .bat files and copy/rename the .exe to suit.
Mac
Doing the same thing in Mac is a bit easier. You simply need to use an AppleScript file. The code below will open a new Finder window displaying the contents of the specified folder on the specified disk. Replace DiskName with the name of the disk. This is better than Windows as the name of the disc will never change, where you can never be certain of the drive letter.
tell application “Finder”
activate
make new Finder window to disk “DiskName“
set target of Finder window 1 to folder “FolderName“ of folder “fscommand” of disk “DiskName”
end tell
If you don’t know how to write AppleScript, don’t fear - just follow these steps (you will need a Mac, or know somebody that has one!):
So now we have the command for Flash and the Windows and Mac helper files to launch our folders. The next step would be to create some actionscript that will handle launching our folders. Lets assume that on our disc we want to open five folders. For ease of use, name these folders - folder0, folder1, folder2, folder3, folder4.
We can then set up a loop and attach to buttons to launch a file.
Telling the difference
Use this script below to call either the Windows .exe or the Mac .app helper file:
if (platform==”WIN”){
fscommand(”exec”, which + “.exe”);
}else{
fscommand(”exec”, which);
}
That’s it, you should now be set to get creating cross platform CD’s. The zip file below contains a sample .exe, .bat and Applesctipt file.
Download source files crossplatformfiles
20 Apr
Quick update!!
After about a week of hard work the beta version of flCodr is now online. The basic idea is to have a repository of Flash code snippets online in a centralised location.
The unique idea hear however is that the code snippets are available from within Flash by using the specially created extension panel (beta coming soon).
There are still a few things that need to be ironed out on the site, but most of the major bugs have been ironed out.
Head on over there now, set up an account and start sharing code today!!
flCodr - really useful Flash code
7 Apr

The Locator Panel has now been updated to v1.2. The update improves the functionality of the Map, in terms of being controlled by the keyboard and mouse. It also improves feedback when a connection is lost or cannot be found.
You can download the panel from here.
15 Jan
It seems like all I seem to do on this blog is slag of anything related to Microsoft - and i’m about to do it again. In fairness I have included a really big image (above) to make up for it. My latest (ok its a few months old, but i’ve only just thought about writing about it) gripe is Silverlight. The aparent next gen RIA framework posed to set the internet alight.
STOP!! There is something out called Flash? Not to sure if you have heard about it as it’s on about 98% of PCs!!.
Thats my first point right there (above). How can Microsoft expect to be a real contender in the market if they are already 98% behind at start-up. Lets face it Bill and his team are not the best at implementing new technologies or formats (WMV, WMA).
Second, Microsoft mentions seamless integration with Mac and Windows but what about Linux users. Surely with the failures of Vista it would be silly not to include this user group.
Third, with the introduction of AS3, AIR and JavaFX is there anything new that only Silverlight can offer? If there is, I can’t seem to find it. A quick look at the Silverlight Showcase shows a bunch of seemingly Flash like apps, fair enough the project is still in development.
Fourth, to develop content of Silverlight requires (yep you guessed it) a Windows set up. When will Microsoft learn to make their stuff fully cross platform? (there is a development of a Linux based SDK called Moonlight on the way)
Don’t get me wrong, I don’t believe in a dominant force in any area, but Flash has the field of RIA’s pretty well wrapped up. For Microsoft to make Silverlight a real contender they need fresh, exciting, open (source) and readily available methods for creating content.
On a plus side however as Matt Casto points out is:
The exciting feature about Silverlight, for me and lots of other Microsoft developers, is being able to execute compiled code in the browser, in a language that I’m already using day to day.
It’s a good point, and one I forgot to mention: developers can’t be forced to learn a language that is unfamiliar to them, so for Microsoft it seems like Silverlight is for the .Net coders outthere. As for me, I’ve had a big enough step up from AS2 to AS3 and learning a new language just isn’t for me, however I do look forward to see what Silverlight can do.
Flash, Macs and Apps - thats pretty much what i'm about.
If you like what you see Digg my stories, and leave a comment. Thanks for looking