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.
- Open the PageFlip file.
- Click on frame #11 of the Pages layer.
- 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.
- Once you are editing the Bound Pages clip, select the first frame of the Actions layer.
- Open the Actions Panel (Menu»Window»Actions).
- Go to line #29 in the Actions panel to locate the “maxPages” variable.
- 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.
- Open the “Create New Symbol” window. (Menu»Insert»NewSymbol).
- Name the new symbol “print” (all lower case) followed by a page number. For example page #9 would be named “print9”.
- Make sure the symbol’s “Type” is set to “MovieClip”.
- Check the “Export for ActionScript” box.
- Make sure the Identifier is “print” followed by the proper page number (should be automatic).
- Un-check the “Export in first frame” box.
- Click “OK” to close the “Create New Symbol” window and begin editing the new movieclip.
- Drag an instance of the “Page Guide Outline” graphic from the Library onto the Stage of your new Print clip.
- Center the Page Guide Outline in the exact middle of the stage.
- Add your page content to the movieclip while keeping everything within the Page Guide Outline
Adding a page:
- Go to the root/main timeline.
- Create a new blank keyframe at the end of the “Prints” layer. (Right-click the keyframe in the timeline and choose “insert blank keyframe”.)
- Select the new keyframe.
- 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.
- 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.
- Drag the last keyframe of the Actions layer to the right, one frame beyond the last keyframe in the Prints layer.
- 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”.)
- Insert a new frame in the “Background” layer under the last frame in the Actions layer.
- Insert a new frame in the “Load Status” layer one frame before the last frame in the Actions layer.
- Repeat for any other layers containing graphic content.
- 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.
Improved PageFlip Now Available: Improved PageFlip implements the most commonly requested features.
Hi there , And thank you your fla is amazing ! I would like to know if it’s possible that the book open on the second page ! or first play all the page and return to the second . I’m not english then If you don’t unterstand just tell me.
Cheers
Bye
Linton
YES!!!!!!!
after trying and trying…and readind and reading this instruction over and over again I GOT IT :o)
hy
also a big thanks for that great service. BUT it doesnt work for me. My problem is this:
“Drag the last keyframe of the Actions layer one frame beyond the last keyframe in the Prints layer.”
well I dont have any keyframes of the action layer. I downloaded the file and opened it but there is no keyframe. I mean a keyframe is that grey thing with a BLACK DOT.
would be great if I get some help.
positive vibrations to all
phil
Thanks a lot excellent script and animation
Hi PiXELWiT!
Firstly and most importantly I’d like to thank you
greatly for the code…Unbelievable stuff!!…
..to the rest of the guys out there trying to make things work I have found out that after adding the pages you need to drag the last frame in ‘Actions’ layer back ONE frame…it aligns the stop ActionScript to the PAGES layer.
Hope this helps!!
I tried to make other pages as u said. I followed every step but it doesn´t work… i tried everything i know but nothing made my new page appear… what can i do?
Tkx
How can I insert images instead of graphics?
Hi, in stead of adding pages i took off a couple of them but and did the whole adding pages reverse process,… and it show ups the following error message…
Error: A ‘with’ action failed because the specified object did not exist.
THe steps listed under:
Adjusting the file to accommodate the new pages…
Are those done at the end of this whole precess after adding tons of pages?
hi,
how can i insert movie clip inside this flip page?
Man you have done a great Job in Explaining the Script and modifying the perameters.
I would like to know how can we give our User the Option to upload specific formated PDF Files?
I mean …If we can give the option for Browes to Users and they can upload PDF and make their own galaries out of it ….can we do this ?
Ok nevermind! I forgot to select each movie clip and edit the linkage (ok so it wasn’t done perfectly 😉 ). All works well and my client is going to LOVE it!!! Suggestions for anyone who wants to make the book a little more realistic. Photograph a book, but photoshop out the text to make the pages blank. Save as a PNG file of course and import into flash. Create a new layer under pages, title it “book” and bring the file in. Once there you will need to maneuver it to line up with the pages, but the end result is very cool and looks, well, like a book!:)
Everything works great – this is an awesome script!
Only one problem – I want yo change the ‘book’ from left-to-right into right-to-left, so the first thing the visitors see is actually the ‘book’ closed, and will flip it backwards.
Anyone can help me please???
I am still having:
“Error: A ‘with’ action failed because the specified object did not exist.”
even after I followed the directions perfectly. I am still new to coding but I love this page turner and need to use it for a client who wants 20 pages instead of 8. Any suggestions?
i am a student in school for digital art and i am using this page flip of my project, i was wondering how u wld go about replacing the images that are already in the file, with images of my own?