Making Project Changes with XML


As mentioned earlier, when exporting your project, you’re given a menu SWF file that contains your navigational menu, your control bar, and your video window. Keep in mind, however, that the SWF only supplies the base code for these elements. All the settings that you so carefully tweaked in Camtasia Theater are actually stored in the project’s XML (Extensible Markup Language) file.

Here’s how it works (feel free to skip the rest of this section if you already have a handle on XML). XML is an incredibly flexible way of storing text and other data, and it is designed to be accessible (easily read by any database system). All information is contained in tags.If you’ve ever looked at HTML code, you probably know what these look like. You’ve got an opening tag, whatever content you’re wanting to mark, and a closing tag. It looks like this:

<tag>The content goes here.</tag>

Now, HTML is comprised of a series of predefined tags that web browsers are designed to read and interpret. For example, enclosing a piece of text inside a <b> tag - like this: <b>bold</b> - will produce bold text when read by the browser. Unlike HTML, XML tags are completely customizable, meaning that the tag’s name can be (within limits) whatever the developer wants it to be (i.e., <mysupercoolwidget>). Obviously, this tag wouldn’t mean anything to a standard web browser, so what we need is an interpreter that can correctly parse this information, thereby figuring out what to do with the content contained therein.

In our case, this interpreter is the menu’s SWF file, which contains the basic bare-bones components of our presentation (menu bar, control bar, video pane). However, these components are generic - your SWF needs the information passed to it by the XML file in order to determine things like:

  • What color you want for your control bar

  • What size the menu item text should be

  • What video segment to load next

  • Just about every other setting you specified in Camtasia Theater

Fortunately for us, this setup is infinitely more flexible than if these settings were “baked” into your SWF. With all the information in your XML file, the content of these tags can be edited on the fly, and it’s a good way to make quick changes to a project you’re generally happy with. If, in your haste, you failed to save a Camtasia Theater project file when creating your presentation, it’s the only way.

Tip 

Your XML file contains a couple of useful tags that don’t correspond to any setting in Theater. For example, Camtasia Theater offers no way to turn off the fast forward and rewind buttons on your control bar. But by changing the value of the <ShowFFRW> tag in your XML file, you can make these buttons vanish like magic.

Making Changes to Your XML File

While it may look complicated at first glance, changing the values of your XML tags to change the look and feel of your presentation is actually not that hard, provided you’re familiar with the basics. First, let’s open up our XML file and see what’s there. While there are numerous XML editing applications out there, XML is really just a text format, and as such can be opened with the Notepad application included with every copy of Windows.

image from book

Just follow these steps to open the XML config file:

  1. Choose Start > All Programs > Accessories > Notepad.

  2. From the File menu, choose Open….

  3. At the bottom of the Open dialog, you’ll see a drop-down box called Files of type. From this drop-down list, choose All Files.

  4. Navigate to your project’s XML file, and then choose Open.

image from book

Your project’s XML document opens. Now, I mentioned that the value of whatever property we want to change is snugly nestled between that property’s opening and closing tags, like this: <tag>value</tag>. The XML file is loaded with these tags. While most control a particular aspect of your production, some tags are there for categorization, with the other tags nested inside them, like this:

<category>

<tag>value</tag>

</category>

You may notice that between the <config> tags that encompass all the other tags, there are two main categories: movie and menutree. The <movie> tag contains all the tags that influence how the different components are displayed, and it is divided into two subcategories: <controls>, which controls the display of the control bar and preload movie, and <menuproperties>, which influences the format of the navigational menu. The <menutree> tag stipulates the order and location of your SWF video files.

Here are a few handy points to keep in mind when editing your XML file:

  • Remember that only the values (the data between the opening and closing tags) are to be edited. Do not touch the tags themselves! Your SWF will go looking for a tag by its name, and if that tag can’t be found, bad things tend to happen (errors, gobbledygook, total refusal to open, etc.). So do be careful. In fact, it’s best to make a backup of your XML file before you go messing with it.

  • Some tags support only binary values, meaning that feature is either enabled or it’s not. For these tags, a value of 1 means it’s on, and 0 means it’s off.

  • Certain other tags will only accept a limited range of values. For example, the <TimeDisplayFormat> tag has only eight acceptable values. For these tags, I will point out what the acceptable values are in the table that follows.

  • The values of certain tags are just not meant to be edited, and can lead to problems. Other tags serve no discernable purpose, and are presumably leftovers from previous versions of the software. I’ll call your attention to these in the following table as well.

  • For tags that stipulate the color of text and objects, use the desired color’s hexadecimal value. You’ll need an image utility that will dis- play the hexadecimal value of any color you select. I’ve always used a small utility called Color Cop. For one thing, it’s free, and for another, it rocks. I’ve taken the liberty of providing you a copy of this handy app on the companion CD-ROM.

  • The <menutree> tag contains an item tag for every menu item you have. The order of items stipulates the order in which your videos appear.

In the following table, I summarize all the commands available to you in your XML file. For each tag name, I provide a description of what it does, and also the corresponding command in Camtasia Theater, if applicable. The tags are ordered by appearance in the actual file.

Open table as spreadsheet

Tag

Description

Camtasia Theater Command

<AutoStart>

A value of 0 indicates that all videos will start paused. 1 means all videos will automatically begin upon loading.

Controls tab, Paused at start check box

<MovieWidth>, <MovieHeight>

These tags compute the location of the control bar based on the dimensions of the largest video in the series. It’s best to leave these settings alone.

---

<BackgroundColor>

Enter any valid hexadecimal value to change the background color of your presentation.

Menu tab, Movie Background button

<MovieURL>

This tag isn’t used in Theater-produced XML files, only for single SWF files produced in Camtasia Studio.

---

<ShowLoadingMov>

Enter a 1 to show a preload movie.

Controls tab, Show loading movie check box

<LoadingMovURL>

The location of your preload movie. This can be either a file path or a web URL (if a file path, make sure you actually add the file to your project). Make sure that <ShowLoadingMov> is enabled.

Controls tab, Loading movie URL field

<ScaleLoadingMov>

A value of 1 indicates that the preload movie will adopt the same dimensions as the video content. 0 will maintain the preloader’s original dimensions.

Controls tab, Match movie size check box

<LoadingMovPercentToLoad>

The minimum percentage that your video SWF needs to load before it begins to play.

Controls tab, % of main movie to preload field

<LoadingMovMinDuration>

The minimum amount of time to display the preload movie before it disappears and the main SWF video begins to play.

Controls tab, Minimum preload movie display time field

<ControllerColor>

Determines the color of your control bar. Any hexadecimal value will work.

Controls tab, Movie controller color button

<ShowFFRW>

A binary tag that determines whether or not to show the fast forward and rewind buttons on the control bar.

None. This setting can only be altered in the XML file.

<ShowAbout>

A value of 1 shows the About button on the control bar, whereas 0 turns it off.

Controls tab, Show About box check box

<AboutBoxText>

This is where the content for your About box goes (up to eight lines). Simply press Enter for a new line.

Controls tab, About text (up to eight lines)

<ShowPercentLoadedText>, <PercentTextPosition>, <HideTextWhenLoaded>, <ShowTimer>

These are all legacy tags, and they all do zip.

---

<TimeDisplayFormat>

This tag changes the format of how the duration and/or elapsed time is displayed in your presentation. The only acceptable values are: SS, MM:SS, HH:MM, HH:MM:SS, SSs, MMm SSs, HHh MMm, and HHh MMm SSs.

Controls tab, Display format field

<ShowDuration>

Binary tag that determines whether to show the video’s total duration.

Controls tab, Show duration check box.

<ShowElapsedTime>

Binary tag that controls whether to show the video’s current elapsed time.

Controls tab, Show elapsed time check box

<TimeDisplayFont>

The font of your time display text. While Theater will only allow Arial and Times New Roman as values, you can enter the name of any font on your system here. However, keep in mind that it may not display correctly, and that the font in question must also be on the viewer’s system in order to display.

Controls tab, Font drop-down list

<TimeDisplayFontColor>

The font color of your time display text (again, only hexadecimal values).

Controls tab, Font color button

<position>

A value of left places your navigational menu to the left of your video, while right places it on the right.

Menu tab, Menu alignment drop-down list

<background_color>

The background color of your menu, in hexadecimal format.

Menu tab, Menu background button

<title>

The title of your presentation goes here.

Menu tab, Menu title field

<title_color>

The color of said title ( hexadecimal values only).

Menu tab, Menu title button

<title_fontsize>

The point size of your title text. You may enter a broader range of values here than is possible within Camtasia Theater.

Menu tab, Menu title font size drop-down list

<item_fontsize>

The point size of your menu item text. You may enter a broader range of values here than is possible within Camtasia Theater.

Menu tab, Menu item font size drop-down list

<maintext_color>

The font color of your menu items (hexadecimal values).

Menu tab, Item normal button

<maintexthilite_color>

The font color of your menu items when moused over or active (hexadecimal values).

Menu tab, Item rollover button

<subtext_color>

Legacy tag - no longer used.

---

<play_in_sequence>

Binary tag that determines whether the next video in the sequence plays automatically when the current one finishes.

Menu tab, Play movies in sequence check box

<text>

The title of the current menu item.

Menu tab, Menu item name field

<url>

The location of the menu item’s SWF file. Unlike in Theater, which will only let you choose a file path, you may enter a web URL here.

Menu tab, Menu item file field (cannot be edited, and no URL may be specified)

<fps>, <width>, <height>

These settings are inherited from the video’s SWF file. Changing them here will not affect the presentation in any way.

---

As you can see, there’s a lot of power packed into that little file. There’s not a single setting in Camtasia Theater that isn’t represented in the XML, and in a few cases, editing the XML file gives you expanded capabilities that aren’t available in Camtasia Theater. Even if these are of no use to you, it behooves you to become familiar with your config.xml file so you can make quick changes without having to go back into Theater.




Camtasia Studio 4. The Definitive Guide
Camtasia Studio 4: The Definitive Guide (Wordware Applications Library)
ISBN: 1598220373
EAN: 2147483647
Year: 2007
Pages: 146
Authors: Daniel Park

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net