Saturday, May 24, 2003

Authorware and WinAPI are there any references? - Part 1


Have you ever tried to use any functions from the WinAPI.u32 supplied with Authorware? If so you will no doubt have been frustrated by the 'information' provided with the functions. If not, here's a quick example.

Imagine you want to copy a file from your application CD to the user's hard drive. What Authorware function would you use? Seems like a simple enough request doesn't it? Well there is no native CopyFile() function in Authorware. There are many options for solving this problem, one of which is to load the CopyFile() function from WinAPI.u32. So let's try it.

1. Open a new Authorware file, and save it somewhere convenient as TestCopy.
2. You need a test file to copy, so make a new text file in the same folder you just saved your Authorware file into. Call this text file TextCopy.txt,
and type some text in it. Something simple like Hello Mum.

Now we need that CopyFile() function. Loading a new function into Authorware from a .u32 is pretty simple.

3. Open the Functions dialogue either by pressing the Functions button or pressing the keys control+shift+f.
4. Click in the Category: drop-down and scroll down to the bottom until you find a category named TestCopy.axp (where the x in axp represents your version of Authorware - a4p for Authorware 4, a5p for Authorware 5 etc.) and select this category.
5. Press the Load button at the bottom-left of the Functions dialogue.
6. A Windows browse dialogue entitled Load function appears. Use it to browse to the folder containing your current version of Authorware - by default it should be:-

C:\program files\macromedia\Authorware x
(x will be your Authorware version number - 4, 5, 6, 6.5 ...)

Now here you take a sneaky shortcut. It is best to load your function from a u32 that is in the same folder as your application. When you do this Authorware stores the reference to the file as a relative reference, not a hard-coded path. Whilst it should not matter once the file is packaged, it is more elegant to use the relative path during development plus it helps to ensure that you package the correct files with your application.

So the sneaky shortcut is this:- Locate the file WinAPI.u32 in the browse dialogue, select it with a SINGLE mouse click and then press Control+C to copy the file to your clipboard. Keeping the browse dialogue open, now browse to the folder that you have saved your test file into. With the folder open, press Control+V to paste the WinAPI.u32 into your test folder.

Continued in part 2 below

Authorware and WinAPI are there any references? Part 2


7. Double-click the file WinAPI.u32. A dialogue opens entitled em<>Custom functions in WinAPI.u32.
8. A brief browse of this dialogue reveals hundreds of functions that are available to you from Authorware.
9. For now we are interested only in CopyFile, so scroll down to it and, for now, select it with a single click of your mouse.

This is where things stop being completely simple. Notice what the Description filed says :-

BOOL = CopyFile( LPCSTR lpExistingFileName, LPCSTR lpNewFileName, BOOL bFailIfExists )
Windows API Call See Windows SDK for description.


First, the parameters? What is that all about? Well as Authorware developers, all we need to know is that it translates to:-

success:=CopyFile(From, To, Overwrite?)

From would be the file you are copying, e.g.
FileLocation^"TestCopy.txt"

To would be the file you copy to, e.g.
RecordsLocation^"CopiedFile.txt"

Overwrite? is 1 if you want to overwrite the file if it already exists, and 0 if you don't want to overwrite.

So where is this Windows SDK that we are supposed to reference? Sadly not on your Authorware CD. You need to go to Microsoft for that. If you already do Windows development with, say C++ or Delphi you may already have an appropriate Windows API reference. If not, you need to go to MSDN. However the reference there is all aimed at C programmers. Take, for instance, the CopyFile() reference.

Fortunately there is a nice reference designed for Authorware - the Authorware Win API Guide. This site documents around 70 WinAPI functions with example code and files.

Important notes
Many WinAPI functions are not suitable for use with Authorware because they require variable types not available with Authorware, or the require advanced memory manipulation.

It appears some functions do not work with Windows XP. If in doubt, check with the Aware List, there are several people there who can answer specific questions about using WinAPI.

Friday, May 23, 2003

Free Sci-Fi/Fantasy books for your PDA


At Christmas I was given a PDA by my super-generous girlfriend. Being skeptical of such 'toys' I was then obliged to prove that I could make this little pocket computer into something useful in my life. I have several uses that mean I use it many times daily - sometime I'll post about more of those.

My main use for it is as a super-portable book. How so? you may ask. Well my PDA runs Microsoft's Reader software and I have found a great resource for free Sci-Fi/Fantasy books in many formats - one of which is the Microsoft Reader format.

Head over to the Baen Free Library and see for yourself.

Be warned - not all of the books are a great read, but since you can download approximately 60 books for free there are plenty to choose from. They take up a mere 25 Mb of storage space so you can carry them on your PDA storage card or on your laptop's hard drive and have them available wherever you go. I particularly enjoy reading mine on the train, plane, whilst cycling in the gym, even in restaurants when I work away from home. As you know, carrying even two books while you are travelling is a pain - even more so if you happen to finish reading them before the trip is over!

Wednesday, May 21, 2003

Pasting ASP source code into Authorware Display


I see this asked occasionally:-

"I am trying to paste ASP source code into an Authorware Display icon. When I close the Display icon I get the error "Where is function blah()?. How do I fix this?"

The answer is surprisingly simple. In JScript (and many other programming languages, for instance ActionScript, C) the code of custom functions is wrapped in curly brackets "{ }". Authorware uses these same characters in Display icons to denote variables or expressions that it is to evaluate at runtime. When Authorware sees these in code that has been pasted into a Display icon, it assumes you want to evaluate what is inside the brackets.

The cure is simple. Just escape the curly brackets. So if you want to paste in this simple JS function:-


function areaOfSphere(radius) {
return 4 * Math.PI * (Math.pow(radius, 2));
}


escape the curly brackets thus:-


function areaOfSphere(radius) \{
return 4 * Math.PI * (Math.pow(radius, 2));
\}

Tuesday, May 20, 2003

TAAC 8 dates and venu annouced - and special draw for early birds ...


TAAC8 - The Alternative Authorware Conference
Alexis Park Hotel, Las Vegas NV, Oct 23 - 25, 2003

*** EARLY BIRD REGISTRATION SPECIAL ***

Want to go to Vegas for FREE?

Register early, and WIN! One lucky winner will be drawn from the first 20 General Admission tickets sold to win an all expenses paid trip to TAAC8! That's right folks - one lucky person will win airfare, lodging, and their ticket compliments of Mark Henry Enterprises, Inc.

For more information, or to register, go to:

http://www.markhenryenterprises.com/

Another good FlashMX XML tutorial


This one also gives good explanation. Better - it mentions several neat tricks in passing, for instance suffixing your XML object name with "_xml" informs the ActionScript editor that the variable is an XML object and the editor will provide a dropdown list of appropriate methods during editing. Sweet :-)

The FlashMX XML tutorial can be found here and it is hosted by actionscript.org. This too appears to be an excellent resource.

Monday, May 19, 2003

Rant!


Why do so many web sites insist on turning off my status bar in Internet Explorer? What are they trying to hide? What right do they think they have to mess with my settings? It's my machine I am using and I should have every right to control my own settings!

If anyone knows of a way I can block these selfish idiots from changing my browser settings, I'd be pleased to hear from you.

A Simple Flash XML Tutorial


I was looking for a nice, simple, clear tutorial today to get me started with using XML in Flash. I found several badly written tutorials - ones with poor code, or with bad explanations. I won't tell you any more about them.

But I did find one tutorial that was perfect for my needs. It is clear and explains everything in great detail. Even better, the code is good - simple, efficient, no unexplained weirdness.

The tutorial in question is at http://www.studiowhiz.com/ and goes by the title of Philter's Flash/XML Tutorial. It explains how to create a simple dynamic menu in Flash MX, or to quote "A basic introduction to XML and it's usage in Flash to build a simple dynamic menu".

A scout of the web site shows a large number of other useful tutorials for Flash, Dreamweaver, Director, Photoshop, Freehand, PHP, Perl and many other tools. Seems like an excellent site.

Sunday, May 18, 2003

Copy protect your AW CDs?


Occasionally people ask on the newsgroups if it is possible to copy-protect the CDs they sell to their clients. The economical answer is usually no. However Apixel has a product for sale called Castellan that looks like an affordable and viable solution. Developed by a well-respected UK company PTT, Castellan:-

• is the copy control system that strikes the right balance between security and ease of use for both you and the end-user of your software.
• has a proven reliability and robustness. PTT has been using this system to protect its own e-learning programs for over two years on PCs all over the world.
• will protect programs running under Microsoft Windows 95, 98, NT4, 2000 and XP
• will protect programs developed using Macromedia Authorware and Director. Castellan will also protect software developed using programming languages such as C++, Delphi, and Visual Basic.

Please note that Castellan does not actually prevent disc copying, but it does tie the product installation to a single installation; think of it as a secure licensing system.

If you prefer a different solution, the following were all recently suggested on the macromedia.authorware newsgroup:-

CrypKey
DiscGuard
SafeDisc
SoftLock
sofpro.com

I also found these on a quick web search:-

http://www.barracuda99.cwc.net/How_To__/CD_Protect/cd_protect.html
Microsoft tools

Please note that since I have not used or tested any of these products I am making no comment about the quality or value of any of them. I am not recommending any of the products. I am merely bringing them to your attention.

Saturday, May 17, 2003

Finding the Windows/Mac OS directory


Did you ever want to find where Windows was installed? Or where the current active Mac OS was installed? Did you parse it out of RecordsLocation? Well if so, from Authorware 6.5 this may no longer work. But fear not! There is a simpler way. The FileIO Xtra has a simple function that does this for you. From the function description:-

getOSDirectory() -- returns the full path to the Mac System Folder or Windows Directory

So all you need to do is call getOSDirectory

OSpath:=getOSDirectory()

Need more tips like this? Then you should bookmark the Authorware-Amy.Com tips pages. Even better - if you subscribe to the Tip Of The Week newsletter you can keep up to date will ALL of Amy's tips as they are published.

New Look


I have been messing about with the look of this site over the last couple of days. I liked the old design but I received several complaints that the text was too small and not resizable, also that the site was too dark and gloomy. So now it is a little brighter and the text is quite a bit bigger.

So is it OK now? Or do you think some further tweaks are required? Let me know - there's a "contact" link at the top of the page.

Friday, May 16, 2003

The Meaning of Life


Last week I saw a complete box set of the Monty Python movies on DVD. I had to buy them. Really. I had no choice. So now I have to watch them :-).

Crazy stuff.

So British.

Thursday, May 15, 2003

Authorware samples


I may have been quiet, but that does not mean I have not been busy. I have added some sample files to my Tomorrow's Key web site. As I type there is no index of these files, so for now you can only find them by going direct to them:-

EndOfFlashMovie.zip
This shows how you can get a Flash file to tell Authorware it is finished. Authorware listens for Flash using an Event response. Sample Flash and Authorware files are included. The same method can be used to send messages and/or data from Flash to Authorware.

progress bar.zip
This file has a dynamic progress bar, drawn entirely using Authorware code. It is designed to display progress through your Authorware course.

graphicProgress.zip
This sample is similar to the dynamic progress bar, but it uses a graphic rather than Authorware code for the progress bar.


Uninstalling the Authorware plugin


People often want to uninstall the Authorware plugin as part of a troubleshooting system, or to exchange for another version.

Netscape plugin


. Find the NS plugin folder for the version of the Netscape browser you are using.
. Locate the folder called NP32ASW and delete it.
. Also delete the dll file np32asw.dll that you will find in the plugin folder. <--- This is essential!!!!

Internet Explorer

First, this is how to uninstall the Netscape plugin which is no longer supported from Internet Exporer 5.5 SP1. Microsoft stopped supporting Netscape-style plugins because they are not specified in the HTML 4 standards.

. Locate the IE plugin folder - by default it is going to be

C:\Program Files\Internet Explorer\PLUGINS

. Locate the folder called NP32ASW and delete it.
. Also delete the dll file np32asw.dll that you will find in the plugin folder.<--- This is essential!!!!

Now the ActiveX control:-

. Browse to

C:\WINDOWS\Downloaded Program Files

or

C:\WINNT\Downloaded Program Files

. Right click the file Macromedia Authorware Web Player Control and select Remove.
. If you want to be thorough, go to:-

C:\WINDOWS\system\Macromed
C:\WINDOWS\system32\Macromed
C:\WINNT\system32\Macromed


(depends on your system)

... and delete the folder AUTHORWA - although it is not strictly necessary.

Now reinstall - only install the Netscape plugin to Netscape and the ActiveX plugin to IE.

Need to find the installers in a hurry? Look on your Authorware CD.


Rumours of my demise have been .. er ... just rumours



I am back and here to stay. Or something. You would not believe how busy I have been since February - between work, EuroTAAC and studying.

Obviously EuroTAAC is out of the way now. It really was a great week. The weather in Friedrichshafen was outstanding - blue skies and sunshine all week. If you want to know what you missed, head over to the EuroTAAC 2003 downloads page. We are still waiting for some of the presenters to post their files, but there is enough for you to get your teeth into for now.

There are also some photographs of the event and the location available if you want to see them:-

Day 1
Friedrichshafen
Lindau
Meersburg
Meet 'n' Greet
Precon training

Please note that they were posted in a hurry - I have still not turned them around the right way :-) I will soon ...

OK that was EuroTAAC. Now studying. The last of my assignments for the year was handed in on Monday. My the end of next week I should know if they were up to scratch. Things have been going pretty good so far so I am looking forward to decent grades. After all the time it has taken it is a relief to get this leg out of the way.

Now I just have to spend the whole summer on The Big Project ...

Friday, February 14, 2003

DirectXtras release new 3D transitions


DirectXtras this week announced a brand new set of 3D transitions. This is the second set of 3D transitions from DirectXtras.

Tomer Berda said
"DirectTransition3D Xtra is a collection of high quality, hardware accelerated, platform independent transitions for Macromedia Director, Authorware and Shockwave. DirectTransition3D Xtra, Set II, features the following customizable transitions:"

• Black Hole: Simulates the before image sucked in to or blown out of a point.
• Circular Wipe: Simulates the before image being wiped in a circular shape to reveal the after image.
• Color Fade: Simulates the before image fading in to a color and fading out to the after image.
• Four Part Door: Simulates the before image opening in a four part door to reveal the after image.
• One Part Door: Simulates the before image opening in a one part door to reveal the after image.
• Ripples: Simulates circular ripples oscillating, expanding and wiping to reveal the after image.
• Rotating Boxes: Simulates boxes with the before image on one side and the after image on another side rotating.
• Simple Fade: Simulates a simple fade from the before image to the after image.
• Simple Wipe: Simulates a simple wipe in any direction from the before image to the after image.
• Squeeze: Simulates the before image squeezing into an outer edge to reveal the after image.
• Three Part Door: Simulates the before image opening in a three part door to reveal the after image.
• Twist: Simulates a plane with the before image on one side and the after image on the other side twisting to reveal the after image.
• Two Part Door: Simulates the before image opening in a two part door to reveal the after image.
• Two Way Wipe: Simulates a wipe from any two opposite direction converging to reveal the after image.
• Zoom: Simulates the before image zooming in and the after image zooming out while the images fade.

An evaluation version downloaded from this web page http://www.directxtras.com/DTransition3DSetII_home.asp

EuroTAAC 2003


Nearly there. Only 4 weeks until I fly out to Germany for this year's EuroTAAC conference. A few more days and we start another wonderful week of information sharing, meeting friends old and new and seeing what incredible things other people do with Authorware.

This year we have decided to change the format of the Authorware challenge. Instead of announcing the challenge right at the start, then consigning a few hardened coders to spendthe rest of the conference cloistered in their hotel rooms dreaming up outlandish code that "only took four hours" ;-) we will not announce teh exact nature of the challange until Saturday afternoon. Teams will have 2 hours to complete the task before presenting for judging.

Integrity eLearning have been kind enough to sponsor the challenge, and are providing the prizes for the winning competitors.

EuroTAAC - Go on. You know you want to ...

Somebody broke my template

Grrrrrrrr. It seems Blogger had hiccoughs last week. My page no longer fits right in the window. Or maybe I broke the template? Not sure yet. I keep tinkering, trying to see if I did something. Normal service will resume as soon as I figure out what buttons to press! Or something.

AHA!!!! I found the problem. It was me all along. The bug report below contains some code. The last 6 lines of that code **should be all on one line** but if I write it like that, of vourse they insist on BEING on one line in the browser. So be aware of that if you are copy/pasting the updated text for your AW ini file.

Steve

Saturday, February 08, 2003

A small bug with Authorware 6.5. OBP and wmv files


Recently a developer posted to the macromedia.authorware newsgroup, voicing concerns that his wmv file would play in authoring mode, but not when packaged. He received this error "Unable to load external movie driver for: movieName.wmf. Possibly the driver is missing or there is not enough memory."

After some exploration I realised that his problem was caused by an error in OBP (the One button Publishing feature). It seems that OBP does not pick up the fact that the file a6wmp32.xmo is required for movie files that use the new Windows Media Player support within the Movie icon. I mailed Macromedia about this and Stefan van As replied with the full solution.

The OBP settings are held in an ini file called Xtras.ini which by default should be located in the folder C:\Program Files\Macromedia\Authorware 6.5. The version of the file distributed with Authorware 6.5 contains a small error. The [movies] section should be replaced with this updated text:-

.AVI="A%sVFW32.XMO"
.MOV="A%sQT32.XMO"
.QT="A%sQT32.XMO"
.MPG="A%sMPEG32.XMO"
.MPEG="A%sMPEG32.XMO"
.ASF="A%sWMP32.XMO"
.ASX="A%sWMP32.XMO"
.WMV="A%sWMP32.XMO"
.IVF="A%sWMP32.XMO"
.WMP="A%sWMP32.XMO"
.DIR="A%sDIR32.XMO", "DIRECTOR\M5DRVR32.EXE", "DIRECTOR\M5DRVR32.RSR", "DIRECTOR\M5IF32.DLL", "DIRECTOR\XOBGLU32.DLL", "DIRECTOR\D60XTRA.MCH", "DIRECTOR\ASIPORT.RSR", "DIRECTOR\ASIFONT.MAP", "DIRECTOR\FONTMAP.TXT", "DIRECTOR\MACROMIX.DLL", "DIRECTOR\DIRDIB.DRV", "DIRECTOR\LINGO.INI", "DIRECTOR\FILEIO.DLL", "DIRECTOR\XTRAS\SNDIMP.X32", "DIRECTOR\XTRAS\GIFIMP.X32", "DIRECTOR\XTRAS\JPEGIMP.X32", "DIRECTOR\XTRAS\MIX32.X32", "DIRECTOR\XTRAS\SWADCMPR.X32"


If you cannot spot it, the problem is that the first several lines begin with two periods in the original file - they should actually begin with only a single period as shown above.

link to the web browser version macromedia.authorware newsgroup

newsreader link to the macromedia.authorware newsgroup

Steve

Design issues


Readers will be familiar with the fact that I am studying right now. Part of my studies involves looking at web and multimedia design. As a developer, my knowledge and understanding of design issues is generally limited to what "feels right", what I see elsewhere and what "works" for me and my colleagues. Often this means I get involved in heated discussion with designers more interested in pretty stuff than they are in usability.

The University's tutors are keen to express upon us that Jakob Nielson is the usability guru. He has certainly published a lot of useful information, and his web site is a great resource.

Web page design

He has published a great book called Homepage Usability: 50 Websites Deconstructed which I bought and have used as a reference not just for home page design, but also for other aspects of web and multimedia design. I'll be sure to buy more of his books soon!

The book lists a total of 113 recommendations for home pages, backed up by statistical studies. Many recommendations are based on the frequency with which something is encountered on the web (e.g. the left-hand navigation area) whereas others are based on studies of useability preferences and on legibility.

Whilst the recommendations are useful in isolation, the book really begins to shine with its critiques of 50 major home pages using Nielson's recommendations, therefore helping the reader to see where the recommendations are applied. It is interesting to note that the book also makes it easy for the reader to times where some of the recommendations may be set aside for other considerations.

Other usability resources

While discussing this with Amy Blankenship, Amy shared her favourite resource for web usability from the http://webreference.com site. The Webreference Articles page lists loads of good resources. The whole site is also a valuable resource, and well worth exploring.

Steve