<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Making a page counter in Xerte 1.8</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16544" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=741500721-29102007><FONT face=Arial
color=#0000ff size=2>It seems to be a timing issue. I added a 0.1 second Tries
Limit interaction before the script that prints the counter on the first page,
and it correctly prints the number of pages in the
framework.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=741500721-29102007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=741500721-29102007><FONT face=Arial
color=#0000ff size=2>- Paul</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> xerte-bounces@lists.nottingham.ac.uk
[mailto:xerte-bounces@lists.nottingham.ac.uk] <B>On Behalf Of </B>Paul
Swanson<BR><B>Sent:</B> Monday, October 29, 2007 1:48 PM<BR><B>To:</B>
xerte@lists.nottingham.ac.uk<BR><B>Subject:</B> [Xerte] Making a page counter
in Xerte 1.8<BR></FONT><BR></DIV>
<DIV></DIV><!-- Converted from text/rtf format -->
<P><FONT face=Arial size=2>I've been working on creating a page counter within
a Framework, and when you get to the first page of the framework, the total
number of pages isn't calculating correctly.</FONT></P>
<P><FONT face=Arial size=2>I have an empty text icon with an ID of
'slideCounter' that is in the Entry Frame of the framework. The framework ID
is dbInst. I am placing the following code in a script icon on each page (not
in the Entry Frame):</FONT></P>
<P><FONT face="Lucida Console" size=2>slideCounter.setText('Slide ' +
(dbInst.currentPage + 1) + ' of ' + dbInst.pages.length);</FONT> </P>
<P><FONT face=Arial size=2>On the first page of the framework, this prints
'Slide 1 of 1'. Moving to the second page, it correctly prints 'Slide 2 of 20'
and returning to the previous page, it prints 'Slide 1 of 20' -- so it isn't
giving the correct value for the length of the pages array on the first pass,
but correctly does so after that. And if that wasn't strange enough, if I use
Ctrl+F5 to open Page 1, it displays the correct values, but if I navigate to
this framework from the page prior to it (or use Ctrl+F5 with the Framework
icon selected), it displays the incorrect value.</FONT></P>
<P><FONT face=Arial size=2>Is there a better way to do this?</FONT> </P>
<P><FONT face="Courier New" color=#808080
size=2>_____________________________</FONT> </P>
<P><FONT face="Courier New" color=#808080 size=2> Paul Swanson</FONT>
<BR><FONT face="Courier New" color=#808080 size=2> Harland Financial
Solutions</FONT> <BR><FONT face="Courier New" color=#808080
size=2>_____________________________</FONT> </P></BLOCKQUOTE></BODY></HTML>