Home

Downloads

FAQs

Sample Book

Features

Forum

 

Page Signals

As the book pages are turned pageFlip attempts to invoke predefined ActionScript functions as listed below.

Function Comment
onVisible() depracated - issued when a page becomes Visible. There may be many calls to this method. The method is a hang over from the original pageflip code. From V1.41 this call no longer exists.
onInvisible() depracated - issued when a page becomes Visible. There may be many calls to this method. The method is a hang over from the original pageflip code. From V1.41 this call no longer exists.
mute() depracated - issued when a page becomes invisible From V1.41 this call no longer exists.
unMute() depracated - issued when a page becomes visible. From V1.41 this call no longer exists.
Signal(msg:String,page:Number) replaces all the above because it is more flexible and easily extended in your code and mine. See below.

Signal(msg:String,page:Number)

Signal passes a message to your pages when they are made visible/invisible. It is sort of like an event.

msg Comment
onVisible issued when the page becomes visible. Guaranteed to be sent once only.
onInvisible issued when the page is invisible - there may be mulitple calls to this.
mute issued when the page becomes visible and any page sounds will be unmuted. Guaranteed to be sent once only.Call removed from V1.41 - not needed.
unMute issued when the page becomes visible and any page sounds will be played - there may be mulitple calls to this.Call removed from V1.41 - not needed.
loadContent signifies that a container page has become visible and you should now load content. See PageLoaders.
unloadContent signifies that a container page has become invisible and you should now unload content. See PageLoaders.
play issued when the page is to start playing (you don't need to do anything).
gotoAndPlay issued when a page is about to start playing from the beginning (you don't need to do anything).
stop issued when a page animation is about to be stopped. (you don't need to do anything).

page is the page number - which is one more than it's position in the array of pages but corresponds to the page number as displayed on the page nav tool.

You declare Signal functions on your pages simply like this:-

function Signal(msg:String,page:Number)

{

trace(this+" got signal="+msg+" page="+page);

switch(msg)

{

case "onVisible": do_something; break;

case "onInvisible": do_something; break;

case "loadContent": do_something; break;

case "unloadContent": do_something; break;

case "play": do_something; break;

case "gotoAndPlay": do_something; break;

case "stop": do_something; break;

}

}