..:: Blog ::..

 ToolBook Blog Minimize

Dec 5

Written by: Tomas Lund
Wednesday, December 05, 2007 12:29 PM

Problem
Ever had to embed a file in ToolBook which was dependant on other files?  
Frustrated when trying to get it to work when the ToolBook content is exported to HTML?
 
Common examples are
  • When a Flash file reference another Flash file or a Flash Video file
  • Embedding Captivate content in ToolBook (essentially the same as above)
  •  Embedding a HTML file which itself has links to other files (.js, graphics etc)
 
Before we go to the solution let’s look at an example to understand why this happens – as this will help us understand how to fix the problem.
 
An example:
A flash file (a.swf) has some media controls which controls the playback of two external FLV - flash video files (b.flv and c.flv).
To embed those files into ToolBook one would link to a.swf in a media player
When you test this in Author It’ll work just fine.

When you publish to web, ToolBook will copy any media file directly used by a ToolBook object into the Media directory of the ToolBook Web export directory

In the above example Toolbook cannot “see inside” a.swf to learn that b.flv and c.flv should be copied to the media directory, hence when you test the HTML the a.swf will look for b.flv and c.flv but will not be able to find them as they are not copied by ToolBook.

 
An obvious solution to this problem is to manually copy b.flv and c.flv to the Media directory, however there is a problem with that:

As this is a manual process which needs to be repeated every time the ToolBook file is published to web - there is always the risk of forgetting.

In addition even though the file is now be present in the media directory there is a risk it still doesn’t work when launched through an LMS.  

The reason for this is that the files b.flv and c.flv are not referenced in the IMSmanifest.xml file generated by ToolBook.
Again off course one can manually add the references in the manifest file - but one might forget or make mistakes.
 
So here the trick
 
Create a button on page in your ToolBook file (page 1 springs to mind as easy to find – but any page will do)
Now create an on Click action that looks like this.
 
On Click
Display Document b.flv
Display Document c.flv
 
Doing so will not only copy the files to the media directory but will also add them to the imsmanifest.xml.
 
Now hide the button (set the visible property to false) to ensure that the code we just created is never executed. We just want the lines of code to ensure that ToolBook has a link to the file so it can copy it during the export.
 
IMPORTANT: In the Publish HTML Settings make sure the option “Rename media files to guarantee uniqueness” is unchecked – otherwise ToolBook will rename the files and a.swf will not be able to find them.
 
I hope you have enjoyed this article, comments and suggests are welcome.
 

Tags:

6 comments so far...

Re: Adding files to HTML media directory

Awesome! Thank you!!!!!

By Renee on   Friday, December 21, 2007 10:42 PM

Re: Adding files to HTML media directory

Great, Great!

Coiuld not get the information anywhere

By wambete william on   Wednesday, June 25, 2008 6:31 AM

Re: Adding files to HTML media directory

Great, thank you

By robert kruckel on   Friday, July 25, 2008 6:24 PM

Re: Adding files to the HTML media directory

Tom, I was recently experimenting with a flash video file to which I added a skin. I created the swf in Flash Pro CS3 and it exported a separate swf file for the skin. It took me a while to realize why I wasn't seeing the controls. (I'm using Toolbook 9.5.) I had to add the skin swf file manually -- but not to the media directory. Instead, I had to copy the skin swf directly to the IE5, NS7 and safari directories. (This is in addition to copying my .flv file to the media directory.) I like your approach and was wondering if you had a similar suggestion to deal with the skin swf. I've not worked much with flash. I was trying this with the flash popup player and the reason I did the skin was to have a quick and dirty way to control the video. Thanks, Marty

By Marty Weller on   Tuesday, October 07, 2008 10:14 PM

Re: Adding files to the HTML media directory

Hi Marty

Sounds like something a lot people might want to do. Unfortunately I dont know of a "clean" way of moving media files into the directories you mention. I am sure you can be done by use of hacking about with the export routine somehow - but we are not really shopping for bad hacks are we?:-). My suggestion would be to try and see if you can control where the Flash movie is expecting the skin to be and see if you can change that location to point the same place as the swf and the flv file. That should by far be the easiest and most non-intrusive solution. Let me know if you succeed.
Cheers
Tomas

By TomasLund on   Tuesday, October 07, 2008 10:36 PM

Re: Adding files to the HTML media directory

Hi Marty

Sounds like something a lot people might want to do. Unfortunately I dont know of a "clean" way of moving media files into the directories you mention. I am sure you can be done by use of hacking about with the export routine somehow - but we are not really shopping for bad hacks are we?:-). My suggestion would be to try and see if you can control where the Flash movie is expecting the skin to be and see if you can change that location to point the same place as the swf and the flv file. That should by far be the easiest and most non-intrusive solution. Let me know if you succeed.
Cheers
Tomas

By TomasLund on   Tuesday, October 07, 2008 10:45 PM

Your name:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment    Cancel  

  
 Search Minimize


  
 Quick links Minimize


  
 Blog List Minimize


 Print   


Copyright 2007 by ToolBookConsulting.com   Terms Of Use  Privacy Statement