Page Flip components & Flashblocks

It is very simple to use Flashblocks ML with any page flip component.that supports dynamically loaded content. Two such examples are, http://pageflip.hu/dynamic/pageflip_v331_demo.swf and http://www.page-flip.com.

Integrating these scripts with Flashblocks ML is actually very simple. You would first just place the Flashblocks ML engine on the main Flash movie and then place any Editblocks in the external Flash files that make up each page. This is common practice for any Flash website with external swfs. By the way, these external pages work nicely as templates but that is another tutorial.

The problem with page flip scripts irises because each page, though not seen by you, is often visible to Flashblocks. As a result the edit menu may display unseen Editblocks on unseen pages.

I will solve this problem for each of the above scripts. There is a way to limit the edit menu items that Flashblocks shows. This is achieved by setting the Flashblocks.MenuCreateItemTrue function. By default this function always returns true but it can be reprogrammed in order to filter the menu items that appear in the edit menu. Place the following code in your main Flash page flip movie. You may place these code snippets anywhere, but make sure they are executed before logging in to Flashblocks.

The Page Flip Solution for http://pageflip.hu/dynamic/pageflip_v331_demo.swf

This following essentially filters out all pages that are not currently visible.

//    check to see if ebMC target path contains page number before allowing menu item to be created.

flashblocks.Flashblocks.MenuCreateItemTrue = function(ebMC):Boolean  {
    if ((ebMC._target.indexOf("p"+(page)+"/page")>0) or (ebMC._target.indexOf("p"+(page+1)+"/page")>0)) return true;
    else return false
};

Also the following code though not essential will clean up the Editblock title.

// strip unneeded characters from editblockID to save space in data file

flashblocks.Editblock.ReturnEditblockID = function(ebMC) {
    return ebMC.editblockID.split("page_pf_sph_ph_pic_pic_content_").join("");
};

The Page Flip Solution for http://www.page-flip.com

If you are using the http://page-flip.com component then the MenuCreateItemTrue function would look like this. Place the following code in your main Flash page flip movie. This essentially filters out all pages that are not currently visible.

 flashblocks.Flashblocks.MenuCreateItemTrue = function (ebMC):Boolean {

   
    var leftPage "fpage_"+(myBook.leftPageNumber+1)+"/parent"
    var rightPage "fpage_"+(myBook.rightPageNumber+1)+"/parent"


    if ((ebMC.targetMC._target.indexOf(rightPage)== myBook.getPageLink(myBook.rightPageNumber)._target.indexOf(rightPage)) or

        (ebMC.targetMC._target.indexOf(leftPage) == myBook.getPageLink(myBook.leftPageNumber)._target.indexOf(leftPage)) or

        (ebMC.targetMC._target.indexOf("/fpage_") == -1)) {

            return true

    }
    else return false
}

Also the following code though not essential will clean up the Editblock title.

flashblocks.Editblock.ReturnEditblockID = function (ebMC) {

    return ebMC.editblockID.split("myBook_f").join("").split("_parent_holder").join("")
}