Help needed with a flash script - Page Flip...

  • devs
  • Newbie
  • Newbie
  • devs
  • Posts: 6

Post 3+ Months Ago

Hi guys looking for some help with a little flash that I promised a mate...

Basically he has a document that he wants me to convert to flash so users can turn the pages online.

I found a great fla script online but can't get my head round how to add additional pages to it?

If someone has a free min. could they please take a quick look and explain what I need to do?

You can get a copy of my fla file here: http://www.redcube.net/flip_master.fla

Many Thanks,

Devs

The fla contains the following instructions but I don't understand them ;(

"/*

PageFlip - Help ----------------------------------------------------------

frame1: Self loader
(never export items to the first frame, and copy one instance
to the layer exported/frame4 of every exported items)
//sorry for my bad english...
frame4: layer exported: here is all the exported items
frame5: here is the main code.
frame6: the main code is activated here.


- This code is opensource (don't buy it from anywhere)
- This script don't support dynamic content loading!!!
- If you have an animation on a page, it must be controlled by the _global.mcnt counter!
- Buttons, or events can be enabled/disabled by a simple script showed in templates!



adding pages: ------------------------------------------------------------

you have template pages in the library:
page_templateLEFT
page_templateRIGHT

If you want a new page, DUPLICATE on of the templates (depending on what side your page will be).
Edit the content of the layer "content".
Export your new page (Library/linkage), and don't forget to uncheck "Export in first frame",
then copy an instance to the exported items! (Main timeline/Layer: exported/ frame 4)
The last step, is to change the page data (layer actions/frame5/from line26):

add a new line:
addPage("yourPagesExportName"); or
addPage("yourPagesExportName",true); if you want to enable tearing of it!

Always insert pages in pair!!!



variables: ----------------------------------------------------------------

removedPages array hold page numbers of removed pages (teared off).
page hold the current left page's number.
at the beginning you can set page variable to the page you want to start the book with it.
canflip it's a variable. setting its value to false disables flipping



functions: ----------------------------------------------------------------

gotoPage( destinationPageNo, skip ); quick jump to the page number: destinationPageNo; values = 0-maxpages;
skip: boolean; if true, pages will be skipped to the destination!
autoflip(); start autoflip (direction is calculated from _xmouse)
removeML(); REMOVES THE MOUSE LISTENER!!!!
must called if you want to unload the pageflip, then load an other!



PageFlip v2.13 coded by Macc/iparigrafika
abel@iparigrafika.hu

*/"
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

oh, the iparigrafika.hu
nice stuff there. I hated it in the beginning, when i was asked to modify it and add all kind of weird stuff, like dynamic pages and other stupidities.
Well, after a while i kind of learned all that it does, so you may wanna take a look here:
virtual magazin
So, basically, to add more pages to your magazine, look in the library, u-ll see there pages-> page1, page2, ....
Right click on page 1 and chose Duplicate, then rename it to pageX (where X is the last number of pages + 1) repeat the procedure till u get all the pages you want. Dont forget to export them for action script -> right click on the item in library (Ctrl + L open the library, if u dont have it already opened) -> select Linkage, and give it a name (same as movie clip name, meaning pageX). As i see, there are some changes in this version of flipping pages, so .... do as that guy said there. Uncheck the Export in first frame option then drag and drop the Movie clip u created onto a frame (probably there`s a layer called pages, see where it starts, and drag the page on that layer, at the first key frame)
Then modify added pages as you like, next look into the actionscript thingy. U`ll see there an array of pages. Add to the array some more items (depending on how many pages u added). Also there is a variable called "maxPage". Set it`s value to the number of pages u have. I dont remember exactly now how the array variable is called (anyway something that contains the word "page" in it) , but i`m sure u`ll find it there. I`ll be offline this weekend, but i can help you sunday evening if you dont get any results.
  • devs
  • Newbie
  • Newbie
  • devs
  • Posts: 6

Post 3+ Months Ago

Hi there IceCold, many thanks for the reply mate and apologies for not getting back to you sooner. Yet I've been having very bad problem trying to figure out how to add additional pages to this thing ;(

I'm still trying to get my head round flash and haven't yet figured out action scripting..

I'm getting confused with the complexity of the file as it contains things such as transparent pages, pages that can be ripped off etc. I don't need anything like that just a simple page flip between 20 pages including front and back covers.

I'd be very grateful if you have a free minute to take a look at my file (linked in first post) and see if you could straighten things out a little. Failing that if you still have an earlier 'slim lined' version of the script on your system that you could mail me so I could try and figure things from there?

Many Thanks mate,

Devs ;)
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

i`ll take a look this evening at your file and see what i can do.
  • devs
  • Newbie
  • Newbie
  • devs
  • Posts: 6

Post 3+ Months Ago

Top man many thanks for the help IceCold! ;)
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

send me a pm with your email so i can send you the FLA. It is just like i told you, duplicate page, rename it, link it, drag it to the exported pages frame, then add it in action script with addpage
However, i seen you added/changed the first 4 or 6 pages, but the rest of the pages have different height/width related to pw and ph variables... so you should consider modifying their width/height, or replacing the content with other stuff (you know, all pages should have same width/height, exactly as the pw and ph variables)
  • devs
  • Newbie
  • Newbie
  • devs
  • Posts: 6

Post 3+ Months Ago

Great I've just sent over a pm to you mate...

Many Thx,

Devs ;)
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

page 6, the one wich is transparent, is not exported
Right click on page6 in the library, chose export for action script, uncheck Export in first frame, hit OK.
Then drag page6 in the layer: exports, on the key frame.
  • willy6743
  • Born
  • Born
  • willy6743
  • Posts: 1
  • Loc: San Jose

Post 3+ Months Ago

IceCold - great work on your flipbook. I noticed one thing in yours that I am planning on placing in the one that I am working on - a middle binder. I am somewhat new to this script (and Flash in general)...do you have any tips on how to achieve this effect? I also want to use dynamic content in the future (randomizing photos)...did you get the dynamic content to work for you?

Thanks!!
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

well .... it`s not really dynamic, i only separated the main swf from the swf with the pages ... but it doesnt worth the trouble. I did that cos i was asked to, but personally i wouldnt do that. Probably i`ll try to load the pages separately ... but they must be in a swf format and exported for actionscript, since the guys who did the engine (ikpari.hu) made it so that you must use the pages from the library ... no dynamic content allowed.
I tried to modify the script so that it will load jpg files for the pages, but i didnt got the expected result. I managed to load and display the pages, but the flip effect was totaly ruined.
About the middle binder .... just set the odd number pages at ._x = 10, and the even number pages at ._x = -10 (that from flash editor ... double click the page from the library, set the desired ._x position), then add your middle bar in the movieclip named pages.
Well, i worked quite a lot with that engine so i know most of it .... except the part which actually animates the flip :D ... though i have an idea about that too. I can show you some other things i made based on the flip page engine ... if you want, send me a pm.
  • orlando
  • Born
  • Born
  • orlando
  • Posts: 4

Post 3+ Months Ago

Hi,

I was wondering if you ever did manage to put a middle binder, or to make the page flip sourcecode more dynamic. It baffles me that the creator of this fantastic effect did not leave in a way to make it so that we can dynamically load jpgs for the pages as they are added to the directory...

Orlando
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

yes, i added a middle binder.
but for the dynamic pages, the way it was designed, you cant do it with external jpgs. I seen other page flip which allows loading pages from jpg, but it was built different. They had the blank pages in which it was loaded the external image, showing a preloader while image was loading.
So, if you can implement the flipping algorithm from iparigrafika.hu (i remember they actually had a tutorial on how to make the page flip, using geometry), then you can build your own page flip with dynamic content.
  • orlando
  • Born
  • Born
  • orlando
  • Posts: 4

Post 3+ Months Ago

Can you post a link to the binder you built using this technique? I'd love to see what you came up with!
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

check upper ... the virtual magazin link
  • electro
  • Novice
  • Novice
  • electro
  • Posts: 18

Post 3+ Months Ago

The virtual magazine is really cool, is the page flipping effect which you have shown, is it Mask based?
Very intresting stuff!
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

definetly mask based, cant do it other way; anyway, the guys who did it are really good, i only tried to understand what they did so i can modify it the way i want :D
  • orlando
  • Born
  • Born
  • orlando
  • Posts: 4

Post 3+ Months Ago

Hi,

I have posted a link to my work in progress and would like some assistance in tweaking it, since there are many uncommented lines of ActionScript which I dont understand.

http://www.alainpatry.com/test

2 questions:

1) What line tells Flash where to position the book. Mine is currently stuck at the top of the movie, and there are too many pages to go in and adjust manually. I want to use code.

2) This booklet has some sort of subtle binding. I recreated the effect by replacing Iparigrafika's red center mc with a 15 pixel-wide piece representing the binded area of the book's cover. The book's cover (page 1 mc) does not contain this extra 15 pixel piece. Looks great until you click to turn the page. Then something happens...the center piece dissappears. Any ideas?
  • EstherK
  • Born
  • Born
  • EstherK
  • Posts: 1

Post 3+ Months Ago

Hi IceCold (and others),

I'm having the same problem with the Page Flip thingy. If you could email me the older version that you have, that would be great. Or if you're willing to have a look at my .fla file, that would be wonderful. http://www.tc.umn.edu/~ckon/JaneFlashE.fla
Where am I going wrong?! Flash is just difficult for me.

Esther
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

@orlando ... hmm, honestly, i actually moved all the images, the odd numbered ones to left, the even numbered to right, by a certain amount of pixels. I tried to do it dynamicaly, but then bumped into many strange behaviours of the pages, and since couldnt load the pages dynamical either .... i just took the easy way.
What i can do, is to tell you where you can implement your middle binder, so that when user turn the page, you can adjust the binder dynamic, so that it will change (according to the degree angle of the page) when user reach first page, 2 middle pages, or last page.
  • orlando
  • Born
  • Born
  • orlando
  • Posts: 4

Post 3+ Months Ago

@icecold, ok , sounds good....pray tell about how you do it for the middle binding thing... :-)
  • eddie
  • Born
  • Born
  • eddie
  • Posts: 1
  • Loc: Toronto

Post 3+ Months Ago

Hi, I am a newbie to flash and I was wondering how to increase the size, of the book.

Thanks
  • kbrowder
  • Born
  • Born
  • kbrowder
  • Posts: 1
  • Loc: Cleveland, TN

Post 3+ Months Ago

electro wrote:
The virtual magazine is really cool, I posted a link yesterday about an online app which I've developed in Flash 8 which allow's you to design your own online mag.

http://www.formatpixel.com/go/ozzu/

They moved the post to site review which I don't know why as I'm still building it and was after feedback. :?

The page flipping effect which you have shown, is it Mask based?
Very intresting stuff!


Hi Electro,

Checked out your magazine. Very nice editor. Is it possible to obtain something like that to use on my on computer? I'd like to begin to study how to build a magazine for my web site at http://7times.org.

I don't have time to spend on line trying to learn how to use the editor. :cry:

Thanks.
  • electro
  • Novice
  • Novice
  • electro
  • Posts: 18

Post 3+ Months Ago

Hi kbrowder,

Thanks for the comments, I've been working on formatpixel for a good few months now and it's almost completed. Not sure when you last visited the site but it's going to be an online subscription system to the editor which will allows you to store your projects online! (no need to download any software)

It's really close to completion, the biggest update recently is building in the image uploading completely into flash so no need for pop-ups :)
  • kontrol
  • Born
  • Born
  • kontrol
  • Posts: 1

Post 3+ Months Ago

Hey guys,

Ice i read your comments about bumping over the images, and im having a lot of trouble. I got the magazine working perfect, but i changed the flash movie size to 680x452 and all my pages are 340x452. the book works fine but it is positioned halfway down the flash movie and too far over to the right. when i try to reposition each image within their respective movie clips, the sensitive are where the user can flip the page is still where the old page used to be.

Is there an easy way to move the entire magazine, with the sensitive areas, all the pages and the shadows? Ive been trying to bump over the images and sensitive area over by 70 pixels in the code on the fifth frame, and after an hour i got the bottom corner working, but i cant seem to get that top corner to work.

Any and all help is greatly appreciated.

-kontrol
  • T110MAS
  • Born
  • Born
  • T110MAS
  • Posts: 2

Post 3+ Months Ago

IceCold wrote:
oh, the iparigrafika.hu
nice stuff there. I hated it in the beginning, when i was asked to modify it and add all kind of weird stuff, like dynamic pages and other stupidities.
Well, after a while i kind of learned all that it does, so you may wanna take a look here:
virtual magazin
So, basically, to add more pages to your magazine, look in the library, u-ll see there pages-> page1, page2, ....
Right click on page 1 and chose Duplicate, then rename it to pageX (where X is the last number of pages + 1) repeat the procedure till u get all the pages you want. Dont forget to export them for action script -> right click on the item in library (Ctrl + L open the library, if u dont have it already opened) -> select Linkage, and give it a name (same as movie clip name, meaning pageX). As i see, there are some changes in this version of flipping pages, so .... do as that guy said there. Uncheck the Export in first frame option then drag and drop the Movie clip u created onto a frame (probably there`s a layer called pages, see where it starts, and drag the page on that layer, at the first key frame)
Then modify added pages as you like, next look into the actionscript thingy. U`ll see there an array of pages. Add to the array some more items (depending on how many pages u added). Also there is a variable called "maxPage". Set it`s value to the number of pages u have. I dont remember exactly now how the array variable is called (anyway something that contains the word "page" in it) , but i`m sure u`ll find it there. I`ll be offline this weekend, but i can help you sunday evening if you dont get any results.


hey there icecold.

i am trying to modify the page turn script that i downloaded from http://www.iparigrafika.hu:16080/pageflip/

i have followed the quote above, but am stuck at the part where you said:

Quote:
then drag and drop the Movie clip u created onto a frame (probably there`s a layer called pages, see where it starts, and drag the page on that layer, at the first key frame)



i am trying to make a page turn script to use as my portfolio, and just want a book about 20 or so pages long with no transparency or page tears...

so please can you explain in more detail the part where i stated i am stuck and and tell me how to get rid of the transparencies and page tears?

your help would be HUGELY appreciated mate.

thanks in advance

tom
  • T110MAS
  • Born
  • Born
  • T110MAS
  • Posts: 2

Post 3+ Months Ago

i am still desperate for help with the above post i made, so if anyone can help it would be MUCH appreciated.

thanks

tom
  • zertec
  • Born
  • Born
  • zertec
  • Posts: 3

Post 3+ Months Ago

You could check Here
http://www.catalog-flash.com/demo-of-catalog-flash/
  • Nucleo
  • SausagePorkPie
  • Mastermind
  • User avatar
  • Posts: 2297
  • Loc: UK - England

Post 3+ Months Ago

Hate to bring this back from the dead, but does anyone know where i can get the source files for this?


It'd be greatly appreciated
  • flx
  • Born
  • Born
  • flx
  • Posts: 1
  • Loc: Michigan

Post 3+ Months Ago

I'm digging into pageflip code as well - quite slick piece of work. I do have a question maybe someone has already came up with and answer for.

I added a couple of buttons utilizing gotoPage() function to which I'm passing page var. The flip effect, however, is different when using function from when clicking the bottom of the page. When cliking at the bottom of the page, the effect is smooth. When envoking the gotoPage() function, it's kind of "jerky", edgy, and kind of flips twice before turning the page.

Did anyone notice that? Any reason why?
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

@nucleo: Flip Page
@flx: i used their gotoPage function and worked ok for me. I will provide an example ... if you pm me your email.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 67 posts
  • Users browsing this forum: No registered users and 15 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.