PageLoaders
The LeftPageLoader.swf and RightPageLoader.swf were written to allow the book to open quickly when it contains big pages. Basically they are small templates which load quickly and wait till they are told to load the actual content.
To use them you need to do something like this in pages.xml:-
<page src="pages/RightPageLoader.swf">
<param name="src" value="pages/RightPage.png"/>
<param name="width" value="300"/>
<param name="height" value="400"/>
</page>
This loads RightPageLoader.swf which later loads RightPage.png when you first turn to the page.
By default the *PageLoader.Swf files assume the parameters width=page width and height=page height.
If you have a spread page then you should set the width parameter to. say, 600. And include the page twice like this (Not tested).
<page src="pages/LeftPageLoader.swf" isSpread="true">
<param name="src" value="pages/SpreadPage.png"/>
<param name="width" value="600"/>
<param name="height" value="400"/>
</page><page src="pages/RightPageLoader.swf" isSpread="true">
<param name="src" value="pages/SpreadPage.png"/>
<param name="width" value="600"/>
<param name="height" value="400"/>
</page>
Note: You must use the RightPageLoader.swf for right hand pages etc.
Technical: To implement this I have added two extra signals "loadContent" and "unloadContent" which is
implemented in *PageLoader.fla ActionScript on frame 1 thus:-
function Signal(msg:String)
{
switch(msg)
{
case "loadContent": if (PageLoader) PageLoader();
break;
case "unloadContent": unloadMovie(Page);
break;
}
}
function PageLoader(pg)
{
var Pg=pg?(pg-1):_root.page; // right page
//trace("Right PageLoader() for Pg idx="+Pg);var src=_root.pageParam[Pg]["src"];
var Width=_root.pageParam[Pg]["width"];
var Height=_root.pageParam[Pg]["height"];this.createEmptyMovieClip("Page",this.getNextHighestDepth());
var PW=Page._width=Width?Number(Width):_root.pw;
var PH=Page._height=Height?Number(Height):_root.ph;
Page._xscale=Page._yscale=100;
// attach movieclips so we can remove them when done
Page.attachMovie("Arc","Arc",this.getNextHighestDepth());
Page.attachMovie("Bar","Bar",this.getNextHighestDepth());// Arc and Bar have central registration points
Arc._xscale=Arc._yscale=100;
Bar._xscale=Bar._yscale=100;
Bar._x=Arc._x=(PW/2);
Arc._y=(PH/2);
Bar._y=Arc._y+(Arc._height/2)+2*Bar._height;// start the visual indicator bar
maxBarWidth=Bar.LoaderBar._width; // remember it's maximum size
Bar.LoaderBar._width=1;// load the page required
var listener=new Object();
listener.onLoadProgress=function(mc:MovieClip,loadedBytes:Number,totalBytes:Number)
{
// grow the popuploader bar
Bar.LoaderBar._width=maxBarWidth*(loadedBytes/totalBytes);
}listener.onLoadInit=function(mc:MovieClip)
{
// clip can now be manipulated.
//trace("onLoadInit()");
removeMovieClip(Bar);
removeMovieClip(Arc);
play(); // move to next frame
delete PageLoader; // we only want to load the page once
}// do the business
var mcl:MovieClipLoader=new MovieClipLoader();
mcl.addListener(listener);
//trace("RPL loading source="+src);
mcl.loadClip(src, Page);
}