<$BlogRSDURL$>

Friday, May 07, 2004

FileLocation = Sloppy programming??


How many times have you stored external media under the FileLocation? I've done it way too often and it has never caused a problem, or so I thought.

Recently I migrated some courseware from Authorware 6.0 to 7.0 and realized all my external media references would be broken thereby causing the web-player to redownload 100's of megs worth of media over the network all because FileLocation had changed from ..\NP32ASW\AW60 to ..\NP32ASW\AW70.

Did I mention my audience only had 15kbps?

So instead of making that mistake again I now store all external media 1 folder above the FileLocation. Therefore regardless of what version of AW my content gets published in my users will never have to redownload pre-existing external files.

So how do we code this?

The old way looked something like this:
-- in Authorware script
ExternalImage := FileLocation ^ "MyMedia\\external.gif"
#  in the map file
put MyMedia
bin win32 "external.gif" "external.gif" recycle,length=220


The new and improved method looks like:
-- in Authorware script
ExternalImage := GetLine(FileLocation, 1 , LineCount(FileLocation"\\")-1 , "\\") ^ "MyMedia\\external.gif"
#  in the map file
put ..\MyMedia
bin win32 "external.gif" "external.gif" recycle,length=220

Thursday, May 06, 2004

About Chris Phillips:


I have been dragging icons since '97 and scripting since '99.
I have primarily worked in the Transportation and Telecom industries with a stint doing LMS's with IBM while picking up the occasional freelance gig here and there.
My preferences are currently XML and JavaScript.


Cool Wayback Machine Search Engine

This page is powered by Blogger. Isn't yours?