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. Pixelwit says:

    @Kai, Each page/print must have a different identifier name. Print1, Print2, Print3, etc.

  2. Kai says:

    Hi, thanks for making this wonderful template. But I encountered a problem. Sometimes when I add new print clips, I got “you must specify unique identifier to export or import this symbol”, though the name on the identifier is already exactly the same, I know I must done something wrong in that page but I don’t know where’s the fault. Please help.

  3. Pixelwit says:

    @Shashi, YOU”RE WELCOME, YOU’RE WELCOME! 🙂 Using the Improved PageFlip is the easiest way to add a one-click flipping feature.

    @Attz, You can open the “Create New Symbol” window using the “MENU” along the top of the Flash application (the clickable words that do things).

  4. attz says:

    hi, trying to add new pages to the book, i understand the first section which is Change “maxPages” variable- but i dnt get the creating page section, where do you add the Print movieclip and where do u Open the “Create New Symbol” window. (Menu»Insert»NewSymbol). what frame, layer etc are we taking about. also what is the 4-Check the “Export for ActionScript” box.
    sorry im confused

  5. Shashi says:

    I want to flip the page when click on the pageflip button I don’t want to drag it….Please Help me as soon as possible.

  6. Shashi Kumar says:

    THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU…………

  7. Juninho De Luca says:

    You save my life
    tks

    JPJr

  8. atty says:

    go sean!!!! u rock to the core
    ! i dont know how much to thank you. u have been a blessing for people like us . thanx soooooooooooooooooooooooooooooooooooooooooo…. much!!!!!!!!!

  9. ugank says:

    thanks so much… i can say anything thanks so much..

  10. kathy says:

    And then the angel chorus sang!!! I bought the improved pageflip and everything works now. THANK YOU, THANK YOU, THANK YOU for developing this code. My client is going to be thrilled. You rock!

  11. Fiona says:

    OMG, i can’t believe it but i figured it out how to add unlimited pages without the with error or any other error. Thank you so much Sean

  12. kathy says:

    Ok, so I went back and did everything step by step and even had someone read me the steps so I could focus on doing the steps. I’m now able to make the identifier name the same as the movie clip. But I’m still getting the “A ‘with’ …” error.

    Please, please, please help me–someone, anyone. I’m working in Flash MX. Could that be the problem? Is there something I have to do differently in this program.

    On verge of tears.

  13. kathy says:

    I’m so excited to use this element in my client’s new website. Thanks for providing the code.

    I followed the steps to adding pages but on step 5 where the identifer is supposed to match the page number I get an alert that says the identifier must be a unique name, and it won’t let me save the movie clip. So I named the identifier print_number.

    I read all the posts for “add pages…” and I don’t see anyone else who had this problem. If it’s been addressed before, I apologize for bothering you.

    Also getting the “A ‘with’ action…” message, but I was getting that before I made any additional pages (I wanted to see the book in action before I “ruined” it with my own pages).

    I’m really looking forward to using this book and thanks again for making it available to the world.

  14. Fiona says:

    Hi PixelWit,

    I just bought your advanced flip page and the only thing stopping me from starting my project is that i cant quite figure out how to add my own pages in the movie even after i followed the instructions. Even after i change your print to graphic instead of movie it still doesnt recognize any of my pictures on my drive. What files are supported in order for me to add it to the library?

    Thank you in advance

  15. Kyle says:

    I’m not having a ‘with’ concern. But when I add pages, they flip up red. Why would it do this?

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