After a while, you will get pretty good at interpreting the debug messages that appear when each XML file loads and finds a problem. Most problems are related to missing quotes, commas, and semi-colons. The interpreter will generally flag these pretty good. I still find just commenting out sections like this works best to narrow down where a problem is. In the XML code below comments are in green. Some are blocking entire code sections.
(See the function at the end of all of this code which contains an error preventing the XML from compiling; can you find it?)<?xml version="1.0" encoding="utf-8"?>
<page>
<config delay="">
<!--Configuration tags (e.g.: <stylesheet> and <javascript> tags;
can also include PowerPac function tags; etc.)-->
<stylesheet>
../xml_config/normal.css
</stylesheet>
</config>
<page>
<!--Prevent ghost image from appearing on background image-->
<pgStyleObject>
{ theStyle : 'pointerEvents',
propVals : 'none' }
</pgStyleObject>
<function name="preventDrag" event="" params="evt" useTB="true">
<![CDATA[
/* CLIFTON: Executed when user clicks on a link.
Idea is to prevent behavior like dragging, etc.
TO USE: (code example)
<a href="#" onclick="parent.tbfunction_gotoNextPage();"
ondragstart="parent.tbfunction_pgTBObjSet('page', 'preventDrag', [window.event]);">
Start Lesson</a>
***/
if (typeof evt != 'object' || !evt.type) {
evt = window.event; //Get current window event
}
if (evt.preventDefault) {
evt.preventDefault();
}
return false;
]]>
</function>
<function name="myUnload" event="unload" params="e" useTB="true">
<![CDATA[
if (this.audioTmr) clearTimeout(this.audioTmr || 0);
]]>
</function>
<CCButton>
<pgStyleObject>
{ theStyle : 'boxShadow',
propVals : '5px 5px 5px 0px rgb(77, 85, 107)' }
</pgStyleObject>
<function name="myClick" event="click" params="evt,undef,target,mX,mY,isShift,isCntrl" useTB="true">
<![CDATA[
/* CLIFTON: Process a change in whether to use closed captions.
***/
var args = [ evt, tbfunction_pgTBObjGet(this.name, 'checked') ];
tbfunction_pgTBObjSet('sharedActions', 'closeCaptionEvent', args);
]]>
</function>
<function name="myLoad" event="load" params="e">
<![CDATA[
/* CLIFTON: If closed captioning videos are NOT available, then this button
must remain hidden from view (style.display = 'none').
NOTE: See book.xml where allowCC is set on book load.
The setting is global for all pages, but can be changed for individual pages.
***/
var allowCC = gTBo('sharedActions', 'objRef').allowCC, disp = '-';
if (!allowCC) {
tbfunction_eraseCookie('TecEaseCC');
disp = 'none';
}
tbfunction_pgStyleObject(this.name, 'display', disp);
]]>
</function>
</CCButton>
<FullscreenToggle>
<!--This object is the lower right corner graphic that clips the video player.-->
<pgStyleObject>
{ theStyle : 'cursor',
propVals : 'pointer' }
</pgStyleObject>
<function name="mousey" event="mouseover" params="e">
<![CDATA[
/* CLIFTON: Show the controls when mouse event occurs on this object.
***/
var mediaContainer = gTBo('sharedActions', 'objRef').mediaContainer, status;
if (mediaContainer) {
status = tbfunction_htmlVideoControl(mediaContainer, 'status');
if (status) {
tbfunction_pgStyleObject(this.name, 'cursor', 'pointer');
tbfunction_htmlVideoControl(mediaContainer, 'controls', true);
} else {
tbfunction_pgStyleObject(this.name, 'cursor', '-');
}
} else {
tbfunction_pgStyleObject(this.name, 'cursor', '-');
}
]]>
</function>
<!--I think there might be a problem with this function.
So I reload the page with this section commented out!
CAN YOU FIND IT???
<function name="myClick" event="click" params="evt,undef,target,mX,mY,isShift,isCntrl" useTB="true">
<![CDATA[
/* CLIFTON: Clicking this object will force the video to go to fullscreen. This
has been provided because this graphic partially obstructs the fullscreen
button in the control bar of the [VideoPlayer].
***/
var mediaContainer = gTBo('sharedActions', 'objRef').mediaContainer, status, controls;
if (mediaContainer) {
status = tbfunction_htmlVideoControl(mediaContainer, 'status');
if (status) {
controls = tbfunction_htmlVideoControl(mediaContainer, 'controls); //BINGO! It is on this line!
if (controls) {
tbfunction_htmlVideoControl(mediaContainer, 'fullScreen', 'enter');
} else {
tbfunction_pgStyleObject(this.name, 'cursor', '-');
}
}
}
]]>
</function>
-->
</FullscreenToggle>
</page>