Peepz,
I have a awesome dynamicly loading pageflip system, but i have a few questions about the loading of pages:
if i trace p it will return my pages *5. When i use the bandwith profiler it show that the script forces it to load it 5 times… so if i have 10 pages it will load 50 times! (can somebody fix this?)
next question is that al the pages are forced to load at the same time but i want to load it 1 at a time (1,2,3,4 and so on). can somebody fix this to?
i hope so
I included the documents, there 's a lot of help whitin the actionscript!
thnx already peepz!
the following script is loading the pages:
// create array so we can refer to page MCs easily
pageClips = new Array();
pageClips[1] = pages.p1.page.pf.ph.pic;
pageClips[2] = pages.flip.p2.page.pf.ph.pic;
pageClips[3] = pages.flip.p3.page.pf.ph.pic;
pageClips[4] = pages.p4.page.pf.ph.pic;
if(transparency) {
pageClips[0] = pages.p0.page.pf.ph.pic;
pageClips[5] = pages.p5.page.pf.ph.pic;
}
// load page assets (ie. JPG, SWFs) into page MCs
var init = (transparency)? 0 : 1;
for(var i=init;i<pageClips.length;i++) {
for(var j=0;j<pageOrder.length;j++) {
var p = pageClips*.createEmptyMovieClip("p"+(j+1),j);
p._x = j*pw;
p.loadMovie(pageOrder[j]);
}
}
// for the hard cover pages
var tm = pages.flip.hfliph.attachMovie("sph","sp2",0);
tm.ph.pic.pic._x = -pw/2;
tm.ph.pic.mask._x = -pw/2;
tm.ph.pic.pic._y = -ph/2;
tm.ph.pic.mask._y = -ph/2;
for(var j=0;j<pageOrder.length;j++) {
var p = tm.ph.pic.pic.createEmptyMovieClip("p"+(j+1),j);
p._x = j*pw;
p.loadMovie(pageOrder[j]);
}
var tm = pages.flip.hfliph.attachMovie("sph","sp3",1);
tm.ph.pic.pic._x = -pw/2;
tm.ph.pic.mask._x = -pw/2;
tm.ph.pic.pic._y = -ph/2;
tm.ph.pic.mask._y = -ph/2;
for(var j=0;j<pageOrder.length;j++) {
var p = tm.ph.pic.pic.createEmptyMovieClip("p"+(j+1),j);
p._x = j*pw;
p.loadMovie(pageOrder[j]);
}
onEnterFrame = function() {
var isLoaded = 1;
var loadedCount = 0;
var init = (transparency)? 0 : 1;
for(var k=init;k<pageClips.length;k++) {
for(m=0;m<pageOrder.length;m++) {
var p = eval(pageClips[k]+".p"+(m+1));
if(p.getBytesLoaded() == p.getBytesTotal() && p.getBytesTotal()>100) {
isLoaded*=1;
loadedCount++;
} else {
isLoaded*=0;
}
}
}
if(isLoaded) {
play();
delete onEnterFrame;
}
loadedText.text = Math.floor(loadedCount/pageClips.length)+" of "+pageOrder.length+" pages loaded";
}
stop();
[FONT=Courier New][LEFT]
[/LEFT]
[/FONT]