<HTML dir=ltr><HEAD><TITLE>Problem getting accurate count of pages in framework</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6000.16705" name=GENERATOR>
<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 {
}

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;}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline;}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline;}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline;}
P {
        FONT-SIZE: 12pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 0cm; FONT-FAMILY: "Times New Roman","serif";}
SPAN.EmailStyle18 {
        COLOR: #1f497d; FONT-FAMILY: "Calibri","sans-serif";}
SPAN.EmailStyle19 {
        COLOR: #1f497d; FONT-FAMILY: "Calibri","sans-serif";}
.MsoChpDefault {
        FONT-SIZE: 10pt;}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-GB vLink=purple link=blue>
<DIV id=idOWAReplyText6115 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>I forgot about .pageCount.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial size=2>It doesn't really metter where the handler for onInit goes, as long as it is present when rootIcon fires the event, but as you say, if you use currentPage and pageCount on the first page, then use onOpenPage later to keep the interface up to date, you're in business.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial size=2>There are other reasons to use onInit, so bear it in mind.</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> xerte-bounces@lists.nottingham.ac.uk on behalf of Paul Swanson<BR><B>Sent:</B> Tue 14/10/2008 17:39<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 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...)&nbsp;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&nbsp;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>&nbsp;</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?</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN>&nbsp;</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&#8217;d try and avoid that if possible. I don&#8217;t think onPageOpen fires on the first page.. I&#8217;ll check.</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN>&nbsp;</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</SPAN></P></DIV></DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt">&nbsp;</P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">Thanks Julian </SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt">&nbsp;</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&nbsp;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></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt">&nbsp;</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&nbsp;methods. I'm sure I'll be making good use of those!</SPAN></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">&nbsp;</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"><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></SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Try this:</SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN>&nbsp;</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></SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN>&nbsp;</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</SPAN></P></DIV></DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</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></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</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></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</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></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</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></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">P</SPAN></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">&nbsp;</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"><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></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></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">HTH,</SPAN></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">J</SPAN></P></DIV></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</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"><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></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></P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</P>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">Paul</SPAN></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">&nbsp;</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"><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></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></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</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></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></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp; //do things with the node - like create an icon or execute some script</SPAN></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp; //instantiate classes using the information from the xml node to create icons</SPAN></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp; //icons will intialise before this code continues</SPAN></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp; //script icons are executed here too, in engine scope</SPAN></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp; </SPAN></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp; //then loop over each child of node, calling this function recursively</SPAN></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp; for (var i = 0; i &lt; node.childNodes.length; i++){</SPAN></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp;&nbsp;&nbsp; parse(node.childNodes[i]);</SPAN></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp; }</SPAN></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">&nbsp; //decide whether to break or continue?</SPAN></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'">}</SPAN></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</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></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</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></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Only then are&nbsp;the rest of the pages are created - but - by definition - you cannot place code in page 1 that will execute afterwards.</SPAN></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</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></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">J</SPAN></P></DIV></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 72pt">&nbsp;</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"><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></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></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></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> </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></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></P>
<P style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'">_____________________________</SPAN> </P>
<P style="MARGIN-LEFT: 72pt"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'">&nbsp;Paul Swanson</SPAN> <BR><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'">&nbsp;Instructional Designer</SPAN> <BR><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'">&nbsp;Harland Financial Solutions</SPAN> <BR><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'">&nbsp;800.274.7280 Ext. 2462</SPAN> <BR><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'">&nbsp;Paul.Swanson@harlandfs.com</SPAN> <BR><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'">_____________________________</SPAN> </P></DIV></BLOCKQUOTE></DIV></BLOCKQUOTE></BLOCKQUOTE></DIV></BLOCKQUOTE></DIV></BODY></HTML>