Think of something that you wish Authorware could do but it doesn't?  Let the our good friends at Macromedia know via the wishlist.

Please let us know if you find any of the materials on this site inappropriate or offensive. Please include the url and why the material should be reviewed.

Comments and questions about the site are also welcome. Please no Authorware questions, use the AWARE list.


B8010 - How do I make the ImportMedia function work?

by - Joseph Ganci

I have an interesting question for you this time.

I am using the function (in authorware5.1) ImportMedia() to dynamically import .jpg images based on what the user enters in a text field. Here is an example of the script:

bob="ImportMedia(IconID@\"pic4.jpg\", \""^picname^".jpg\")"

The first thing you should know is that the ImportMedia function will only work in source mode, not after you package a file. You probably already know that, but I wanted to be sure you did. In fact, you have to be careful of all the functions in the Target category. They are meant to be used inside Knowledge Objects, which are only useful in source mode.

Now, knowing that, you can use the following procedure for accomplishing what you're seeking to do:

1. When you're ready to clear out the contents, use the DeleteIcon function to delete the whole darned thing.

2. Select an empty icon you have standing by, probably inside your Knowledge Object. Use the SelectIcon function to do this.

3. Copy to the clipboard the icon you've selected, using the CopyIcons function.

4. Set the paste hand using the SetPasteHand function.

5. Paste the icon you have on the clipboard using the PasteIcons function.

6. Name the pasted icon using the SetIconTitle function.

7. Proceed to use the ImportMedia function.

There are 0 reviews
Add your review