<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:m =
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD><TITLE>Problem getting accurate count of pages in framework</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16705" name=GENERATOR><!--[if !mso]>
<STYLE>v\:* {
        BEHAVIOR: url(#default#VML)
}
o\:* {
        BEHAVIOR: url(#default#VML)
}
w\:* {
        BEHAVIOR: url(#default#VML)
}
.shape {
        BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
        font-family: SimSun;
}
@font-face {
        font-family: SimSun;
}
@font-face {
        font-family: Calibri;
}
@font-face {
        font-family: Tahoma;
}
@font-face {
        font-family: Verdana;
}
@font-face {
        font-family: @SimSun;
}
@page Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 72.0pt 72.0pt 72.0pt; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman","serif"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman","serif"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman","serif"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
P {
        FONT-SIZE: 12pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 0cm; FONT-FAMILY: "Times New Roman","serif"; mso-style-priority: 99; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
SPAN.EmailStyle18 {
        COLOR: #1f497d; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal
}
SPAN.EmailStyle19 {
        COLOR: #1f497d; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal-reply
}
.MsoChpDefault {
        FONT-SIZE: 10pt; mso-style-type: export-only
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-GB vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=958512716-14102008><FONT face=Verdana
color=#0000ff size=2>fw.pageCount in a script on the first page does the trick.
I've been using onInit and onOpenPage (I keep referring to it as
onPageOpen...) in the Entry Frame of the framework, should I have onInit in
the Main Entry Frame of the Interface? Except for the first page problem (solved
by using a separate script on that page), it seems that using fw.pageCount with
the onOpenPage event is all I need, and I can delete the onInit
script.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=958512716-14102008><FONT face=Verdana
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=958512716-14102008><FONT face=Verdana
color=#0000ff size=2>Thanks again for all the great support,
Jules!</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>Julian
Tenney<BR><B>Sent:</B> Tuesday, October 14, 2008 9:11 AM<BR><B>To:</B> Xerte
discussion list<BR><B>Subject:</B> RE: [Xerte] Problem getting accurate count
of pages in framework<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">So
use onInit when the file initialises and onPageOpen everywhere
else?<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">You
could address the raw file data fw.XMLElement.childNodes.length, but I’d try
and avoid that if possible. I don’t think onPageOpen fires on the first page..
I’ll check.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<DIV>
<DIV
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><B><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN
lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">
xerte-bounces@lists.nottingham.ac.uk
[mailto:xerte-bounces@lists.nottingham.ac.uk] <B>On Behalf Of </B>Paul
Swanson<BR><B>Sent:</B> Tuesday, October 14, 2008 5:05 PM<BR><B>To:</B> Xerte
discussion list<BR><B>Subject:</B> RE: [Xerte] Problem getting accurate count
of pages in framework<o:p></o:p></SPAN></P></DIV></DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">Thanks
Julian </SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">This
getting me closer, but I still have one issue: the onPageOpen event doesn't
seem to fire on the first page of the framework, although it works correctly
on subsequent pages, or when navigating back to the first page. I'm using the
standard framework controls, rather than having navigation buttons part
of the same interaction as the onInit and onOpenPage events, so the flow goes
right into the first page of the framework. And if I add a script icon with
the setText() method, it still miscounts the number of pages. Any
ideas?</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">I
like having the onOpenPage and onClosePage methods. I'm sure I'll be
making good use of those!</SPAN><o:p></o:p></P>
<BLOCKQUOTE
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0cm; MARGIN: 5pt 0cm 5pt 3.75pt; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none">
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><o:p> </o:p></P>
<DIV class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-ALIGN: center"
align=center><SPAN lang=EN-US>
<HR align=center width="100%" SIZE=2>
</SPAN></DIV>
<P class=MsoNormal
style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 36pt; MARGIN-RIGHT: 0cm; mso-margin-top-alt: 0cm"><B><SPAN
lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN
lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">
xerte-bounces@lists.nottingham.ac.uk
[mailto:xerte-bounces@lists.nottingham.ac.uk] <B>On Behalf Of </B>Julian
Tenney<BR><B>Sent:</B> Tuesday, October 14, 2008 1:36 AM<BR><B>To:</B> Xerte
discussion list<BR><B>Subject:</B> RE: [Xerte] Problem getting accurate
count of pages in framework</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Try
this:<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><A
href="http://www.nottingham.ac.uk/~cczjrt/pswanson.rlo">http://www.nottingham.ac.uk/~cczjrt/pswanson.rlo</A><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<DIV>
<DIV
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><B><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN
lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">
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 13, 2008 10:08 PM<BR><B>To:</B>
Xerte discussion list<BR><B>Subject:</B> RE: [Xerte] Problem getting
accurate count of pages in framework<o:p></o:p></SPAN></P></DIV></DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><o:p> </o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">Here
is what I have:</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">A
page off the Interface page with an id of 'aboutDP' which contains a
framework with an id of aboutDPFrame. The aboutDPFrame has an Entry Frame,
with an onInit event interaction (eventName = onInit, icon = rootIcon, erase
= 0, exit = 1). To this event is attached a script icon with
'aboutDPpageCount = aboutDPFrame.pages.length;'. The entry frame also
includes a script icon with an id of 'aboutDPCounter' positioned where I
want the page numbers to appear.</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">The
framework has a number of pages, each with a script icon (I'll change to the
onPageOpen event once I've got the page count working) with:
aboutDPCounter.setText('Page ' + (aboutDPFrame.currentPage + 1) + ' of ' +
aboutDPCount);</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">What
prints is 'Page 1 of undefined', 'Page 2 of undefined', etc. So I still must
not have the event set up correctly...</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">P</SPAN><o:p></o:p></P>
<BLOCKQUOTE
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0cm; MARGIN: 5pt 0cm 5pt 3.75pt; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none">
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><o:p> </o:p></P>
<DIV style="MARGIN-LEFT: 36pt">
<DIV class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-ALIGN: center"
align=center><SPAN lang=EN-US>
<HR align=center width="100%" SIZE=2>
</SPAN></DIV></DIV>
<P class=MsoNormal
style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 72pt; MARGIN-RIGHT: 0cm; mso-margin-top-alt: 0cm"><B><SPAN
lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN
lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">
xerte-bounces@lists.nottingham.ac.uk
[mailto:xerte-bounces@lists.nottingham.ac.uk] <B>On Behalf Of </B>Julian
Tenney<BR><B>Sent:</B> Monday, October 13, 2008 1:08 PM<BR><B>To:</B>
Xerte discussion list<BR><B>Subject:</B> RE: [Xerte] Problem getting
accurate count of pages in framework</SPAN><SPAN
lang=EN-US><o:p></o:p></SPAN></P>
<DIV id=idOWAReplyText82891>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'">rootIcon
fires onInit; all frameworks fire onPageOpen,</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">HTH,</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">J</SPAN><o:p></o:p></P></DIV></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><o:p> </o:p></P>
<DIV style="MARGIN-LEFT: 36pt">
<DIV class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-ALIGN: center"
align=center>
<HR align=center width="100%" SIZE=2>
</DIV></DIV>
<P class=MsoNormal
style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 72pt; MARGIN-RIGHT: 0cm; mso-margin-top-alt: 0cm"><B><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">
xerte-bounces@lists.nottingham.ac.uk on behalf of Paul
Swanson<BR><B>Sent:</B> Mon 13/10/2008 18:08<BR><B>To:</B> Xerte
discussion list<BR><B>Subject:</B> RE: [Xerte] Problem getting accurate
count of pages in framework</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">I
still have not got this to work. What icon id should be used for the icon
property of the Event Interaction? I've tried the icon id of the
framework, the icon id of the page holding the framework, rootIcon, and
the icon id of the first child page of the framework -- in the first three
cases I get 'undefined' as the value of aboutDPFrame.pages.length, and in
the last case I get 0 (which doesn't surprise me). And should the
onPageOpen be within the onInit event, or should that be a separate
event?</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">Paul</SPAN><o:p></o:p></P>
<BLOCKQUOTE
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0cm; MARGIN: 5pt 0cm 5pt 3.75pt; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none">
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><o:p> </o:p></P>
<DIV style="MARGIN-LEFT: 36pt">
<DIV class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-ALIGN: center"
align=center><SPAN lang=EN-US>
<HR align=center width="100%" SIZE=2>
</SPAN></DIV></DIV>
<P class=MsoNormal
style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 72pt; MARGIN-RIGHT: 0cm; mso-margin-top-alt: 0cm"><B><SPAN
lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN
lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">
xerte-bounces@lists.nottingham.ac.uk
[mailto:xerte-bounces@lists.nottingham.ac.uk] <B>On Behalf Of </B>Julian
Tenney<BR><B>Sent:</B> Wednesday, October 08, 2008 2:43 PM<BR><B>To:</B>
Xerte discussion list<BR><B>Subject:</B> RE: [Xerte] Problem getting
accurate count of pages in framework</SPAN><SPAN
lang=EN-US><o:p></o:p></SPAN></P>
<DIV id=idOWAReplyText86825>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'">An
.rlo is an xml tree. It is parsed sideways like an AW dive. Content is
created as each node is encountered:</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">//this is
really what the engine does...</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'">function
parse(node){ //a node from the .rlo file's
xml</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"> //do
things with the node - like create an icon or execute some
script</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">
//instantiate classes using the information from the xml node to create
icons</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">
//icons will intialise before this code
continues</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">
//script icons are executed here too, in engine
scope</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">
</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"> //then
loop over each child of node, calling this function
recursively</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"> for
(var i = 0; i < node.childNodes.length;
i++){</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">
parse(node.childNodes[i]);</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">
}</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">
//decide whether to break or continue?</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'">}</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'">As
the tree is parsed, the entry frame and it's content is created. At this
point the rest of the framework's xml hasn't been
parsed.</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Flow moves to
the next child node of the framework's xml - the first page. The page is
created and it's content's parsed. The second page hasn't been parsed
yet, so 1 of 1 is expected. </SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Only then
are the rest of the pages are created - but - by definition - you
cannot place code in page 1 that will execute
afterwards.</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">for that very
reason there is the onInit event. This event is broadcast by rootIcon
when the initial parse IS complete. Use this in the entry frame to
initialise your interface, and use onPageClose / onPageOpen rather than
have code in each page to set the interface items. onInit will correct
give you fw.pages.lenth, and onPageClose / onPageOpen are more elegant /
easier to maintain than code on each page.</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">J</SPAN><o:p></o:p></P></DIV></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><o:p> </o:p></P>
<DIV style="MARGIN-LEFT: 36pt">
<DIV class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-ALIGN: center"
align=center>
<HR align=center width="100%" SIZE=2>
</DIV></DIV>
<P class=MsoNormal
style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 72pt; MARGIN-RIGHT: 0cm; mso-margin-top-alt: 0cm"><B><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">
xerte-bounces@lists.nottingham.ac.uk on behalf of Paul
Swanson<BR><B>Sent:</B> Wed 08/10/2008 17:53<BR><B>To:</B>
xerte@lists.nottingham.ac.uk<BR><B>Subject:</B> [Xerte] Problem getting
accurate count of pages in framework</SPAN><o:p></o:p></P></DIV>
<DIV>
<P style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">I'm adding
a "Page x of y" to a framework, and I'm not getting the correct value
for y (the number of pages in the framework).</SPAN><o:p></o:p></P>
<P style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">I'm using
an Entry Frame to the framework, and within that is a text icon with an
id of aboutDPCounter. The framework id is aboutDPFrame. On each page, I
include a script icon with the following:</SPAN><o:p></o:p></P>
<P style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">aboutDPCounter.setText('Page
' + (aboutDPFrame.currentPage + 1) + ' of ' +
aboutDPFrame.pages.length;</SPAN> <o:p></o:p></P>
<P style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">When I
enter the framework, which currently has two pages of content, the page
counter reads "Page 1 of 1." When I go to the next page, it reads "Page
2 of 2," and when I back to the first page it reads "Page 1 of 2." If I
then advance to page 2, it reads "Page 2 of 2."</SPAN><o:p></o:p></P>
<P style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">What's
going on? I would expect myFramework.pages.length would be consistent.
It appears as though it doesn't count the page until you've actually
navigated to it.</SPAN><o:p></o:p></P>
<P style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'">_____________________________</SPAN>
<o:p></o:p></P>
<P style="MARGIN-LEFT: 72pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'"> Paul
Swanson</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'"> Instructional
Designer</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'"> Harland
Financial Solutions</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'"> 800.274.7280
Ext. 2462</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'"> Paul.Swanson@harlandfs.com</SPAN>
<BR><SPAN
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'">_____________________________</SPAN>
<o:p></o:p></P></DIV></BLOCKQUOTE></DIV></BLOCKQUOTE></BLOCKQUOTE></DIV></BLOCKQUOTE></BODY></HTML>