Add Pages to Flash Page Flip (PageFlip)

“How to add more pages” is the most common topic found at the PageFlip Help page. If you’d like to know how to add a page or why you keep getting an error saying, “A ‘with’ action failed because the specified object did not exist” then this Tutorial is what you’re looking for.

You can watch a video walk-through illustrating every detail of this “Adding Pages” tutorial.

To be sure we’re working with the same file and code, download the Page Flip Source File. Open it up and check it out. This one FLA file is designed to be a self-contained page flip solution. It contains a SWF Player version checker, a preloader, each page of the book and the code to make it all go.

Change “maxPages” variable: The first step in adding pages is to locate the main code block and change the “maxPages” variable.

  1. Open the PageFlip file.
  2. Click on frame #11 of the Pages layer.
  3. The small cross highlighted in the center of the stage is an instance of the “Bound Pages” movieclip named “Pages”. Double-click it to begin editing it.
  4. Once you are editing the Bound Pages clip, select the first frame of the Actions layer.
  5. Open the Actions Panel (Menu»Window»Actions).
  6. Go to line #29 in the Actions panel to locate the “maxPages” variable.
  7. Change the “maxPages” variable to the number of pages you want your book to have. Be sure to use an even number or else very bad things will happen.

As far as modifying code goes, that’s all you needed to do, now it’s a matter of creating your new pages and adding them to the FLA file.

Creating a page: You need to make sure you create a Print movieclip for every page in your book, even the blank ones.

  1. Open the “Create New Symbol” window. (Menu»Insert»NewSymbol).
  2. Name the new symbol “print” (all lower case) followed by a page number. For example page #9 would be named “print9”.
  3. Make sure the symbol’s “Type” is set to “MovieClip”.
  4. Check the “Export for ActionScript” box.
  5. Make sure the Identifier is “print” followed by the proper page number (should be automatic).
  6. Un-check the “Export in first frame” box.
  7. Click “OK” to close the “Create New Symbol” window and begin editing the new movieclip.
  8. Drag an instance of the “Page Guide Outline” graphic from the Library onto the Stage of your new Print clip.
  9. Center the Page Guide Outline in the exact middle of the stage.
  10. Add your page content to the movieclip while keeping everything within the Page Guide Outline

Adding a page:

  1. Go to the root/main timeline.
  2. Create a new blank keyframe at the end of the “Prints” layer. (Right-click the keyframe in the timeline and choose “insert blank keyframe”.)
  3. Select the new keyframe.
  4. Drag the new page movieclip (e.g. Print9 etc.) from the Library onto the stage. Make sure the movieclip lands in the last keyframe of the Prints layer that you created 2 steps ago.
  5. Repeat steps 2, 3 and 4 for each new page. You must have a “Print” movieclip for every page in your book.

Adjusting the file to accommodate the new pages:
The basic goal is to extend the length of all layers with content by adding one more frame to them.

  1. Drag the last keyframe of the Actions layer to the right, one frame beyond the last keyframe in the Prints layer.
  2. Insert a new frame in the “Pages” layer under the last frame in the Actions layer. (Right-click the keyframe in the timeline and choose “insert frame”.)
  3. Insert a new frame in the “Background” layer under the last frame in the Actions layer.
  4. Insert a new frame in the “Load Status” layer one frame before the last frame in the Actions layer.
  5. Repeat for any other layers containing graphic content.
  6. Test the movie.

If you will be loading the entire “PageFlip.swf” file with an external preloader you can skip step #6 in the “Creating a page” section which will ensure the Print clip is exported in the first frame of your SWF file. You can also skip the “Adding a page” and “Adjusting the file” sections completely.

Leave a comment if you have any questions.

NEW! StarImproved PageFlip Now Available: Improved PageFlip implements the most commonly requested features.


159 Responses to “Add Pages to Flash Page Flip (PageFlip)”

  1. Stephen Hanson says:

    The max. pages variable on line 29 is stated as this: // clip can be referenced from any other timeline as _level0.pagesAbs
    *Do I change level0.pagesAbs to _level10.pagesAbs for 10 pages? (Nothing on line #29 says anything about max. pags.

  2. Pixelwit says:

    @Maria, All of the people who get this error “A ‘with’ action failed because the specified object did not exist” tend to miss at least one step in the directions. Be sure every page: exists, is properly named, is exported for ActionScript, has the proper linkage identifier, and is placed on the stage. If you have any trouble following the above tutorial, ask questions and I’ll see if I can help. If you solve the problem on your own, please post the solution so others might learn from it.

  3. Maria says:

    “Error: A ‘with’ action failed because the specified object did not exist.”
    Hey great tutorial, as I see a lot of people have the same problem as me. The error keep appearing, I made sure that everything was labeled correctly. Is there anything I might be missing?

    thanks for your help!

  4. Dan says:

    Wow, this is great, thanks a mil!
    I’m having some problems with adding pages..? It say “Error: A ‘with’ action failed because the specified object did not exist.” in the out put box and won’t display the movie clip. Is this because the clip was made in CS3? I hope you can help,

    thanks

  5. Suzanne says:

    Hi,
    I am so grateful that you are have shared not only your code but your experiences. I love the story about Sluggy. I have showed my son who is 10 and already interested in Flash – big movie maker on UTube right now.

    Here is my issue: I have increased the max pages to 24 but no content shows after page 9? I have made sure that all the clips have the proper linkage etc. Is there somewhere in this main code that cannot read after 9 – maybe because the next series all starts with a 1 (1, 10, 11, 12, 13, etc.)

    I appreciate any assistance you can provide. 🙂

  6. Rik says:

    Nevermind! Reread your scripting and figured it out myself! Thanks for the script! It’s awesome!

  7. Rik says:

    Hi there! I started using your script today and it’s working perfectly so far. I changed the size of the movie, the book in it and the max number of pages is changed to 16.
    I deleted all of you pages and started adding my own. Well, the first four are working perfectly, but from Print5 on I get the error mentioned at the beginning of your tutorial. Can’t figure out what’s wrong. The prints are named print5, print6 etc. and their properties are all set as described above…
    I deleted the preloader and the versioncheck though, but the book was still working fine since. I didn’t edit the scripting (just removed the comments and placed a new one referring to you).
    Plz. help me out! Cheers,
    Rik.

  8. stefoid says:

    Hi, thanks for this. My need is for the page turning algorythm to be automatic to play for a demonstration. I just want it to show at the appropriate point in my existing flash demo, flip a page back and forth, then disapear again, all withou t manual intervaention.

    I have only a little experience with flash and none at all with actionscript. Is what I want to do possible, and if so, how would i do it?

    thanks!

  9. Ryan says:

    Pixelwit = absolute legend! I’m flipping those pages into next tuesday! Thanks for all your help.

  10. Pixelwit says:

    @Ryan, You’re not retarded at all, in fact, your ability to follow instructions is above par. The tutorial ~assumes~ the reader has “modified” the 8 existing pages rather than starting out with all new pages like you’re doing.

    Solution:

    • Delete all of the old Print clips from the library.
    • Click and drag to select the 8 frames on the main Timeline which contain all of the old Print clips.
    • Right-click the selected frames and choose “remove frames”.
    • Reposition the first non-empty frame of the Pages layer if necessary.

    That will probably get you headed in he right direction. Sorry for any confusion my “assumption” may have caused and thanks for bringing this to my attention.

  11. Ryan says:

    Hi there,

    awesome job on the script and I’m sure it works fantastically for 9/10 people, but I’m that one slightly retarded statistic not making the grade.

    I’m fairly new to this and want to make a 6 page book. I followed all the steps one by one but something’s obviously clicking for me.

    I’ve inserted 6 new symbols for my 6 new pages, all the identifiers match up and all the images are contained within each page guide outline.

    After frame 13 I’ve added the 6 new blank keyframes in the prints layer to accommodate my new prints. I’ve then dragged them all onto each individual blank keyframe’s stage (e.g. ‘print9’ matches up with frame 14 in the prints layer and so on…)

    I’ve then followed all the steps in the ‘Adjusting the file to accommodate the new pages’ section and exported the file as a swf, but all I can see when I open up the new swf file from my desktop is 6 pages showing the graphics from frames 6-11 in the prints layer from the original document.

    Hopefully it’s something really simple that I’m either failing to do or overdoing but any help with this problem would be massively appreciated.

    Cheers, Ryan.

  12. Pixelwit says:

    @Abdul Razack, You need to follow ALL of the steps in the tutorial. You changed maxPages to 10 in the first section of the tutorial, which is fine, but then you actually need to make 10 pages, not just 9. You didn’t follow steps #1 through #7 of the “Creating a Page” section of the tutorial which is why you are getting the “Linkage Identifier” error. You seem to have followed the “Adding a Page” and “Adjusting the File” sections correctly, but you need all 10 pages, not just 9. Hope that helps.

  13. Abdul Razack says:

    Hello
    help its works perfectly but i can only see 8 pages no more, i have changed the doing to 10 pages but it doesn’t help what am i doing wrong. could u modify the pages 8 to 10 in file and send me so its easy to understand me where u have change. what u have given in help i have done same thing but i can only see 8 pages no more, plz reply me in my viamail

  14. […] the third step where you make new pages for the second book. You’ll basically need to follow the Adding Pages tutorial until you get to the 2nd step of the “Creating a Page” section. At that point you need to […]

  15. E.J. says:

    Thank you very much. You were able to solve the problem that I having. If I could buy you a beer I would. Thanks again for your prompt response.

Leave a Reply

PixelWit.com's Comment Guidelines


Warning: Undefined variable $user_ID in /home2/pixelwit/public_html/blog/wp-content/themes/fvariant2/comments.php on line 57

You must be logged in to post a comment.

© Sean O'Shell 2007-2024