Hola a todos, necesito su ayuda.
Tengo el siguiente codigo de un pageflip, y quisiera que en cada pagina que se carga apareciera un link para descargar el archivo que se muestra, como hago eso?:
codigo:
// 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;
} else {
pages.p0._visible = 0;
pages.p5._visible = 0;
}
// load page assets (ie. JPG, SWFs) into page MCs
var init = (transparency)? 0 : 1;
for(var k=init;k<pageClips.length;k++) {
pageClips[k].setMask(pageClips[k]._parent.mask);
for(var m=0;m<pageOrder.length;m++) {
var e = pageClips[k].attachMovie("blankPage","blankPage"+(m+1),j);
e._width = pw;
e._height = ph;
var p = pageClips[k].createEmptyMovieClip("p"+(m+1),100+m);
p._x = e._x = m*pw;
if(pageSpread[m] && m%2==0) p._x-=pw; // offset position is this is the right spread
if(pagePreLoad[m] && checkLoad(k,(m+1))) p.loadMovie(pageOrder[m]);
}
}
function checkLoad(pageClip,page) {
if(((pageClip==0 || pageClip==1) && page%2!=0) || ((pageClip==4 || pageClip==5) && page%2==0)) return false;
else return true;
}
// 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]);
}
if(pp!=null) {
prepage.loadMovie(pp);
prepage._alpha = 0;
}
startTime = getTimer();
var waitCount = 0;
onEnterFrame = function() {
var isLoaded = 1;
var loadedCount = 0;
var preLoadCount = 0;
var totalCount = 0;
var totalBytesLoaded = 0;
var oldBytesLoaded;
var init = (transparency)? 0 : 1;
// check loading status of each page
for(var k=init;k<pageClips.length;k++) {
for(var m=0;m<pageOrder.length;m++) {
var p = eval(pageClips[k]+".p"+(m+1));
if(pagePreLoad[m] && checkLoad(k,(m+1))) {
if(p.getBytesLoaded() == p.getBytesTotal() && p.getBytesTotal()>100) {
if(k==2) debug.text = "page "+(m+1)+" is loaded\n" + debug.text;
isLoaded*=1;
if(k==2) loadedCount++;
} else {
if(k==2) debug.text = "page "+(m+1)+" is not loaded\n" + debug.text;
isLoaded*=0;
}
totalBytesLoaded += p.getBytesLoaded();
}
if(k==2) preLoadCount += pagePreLoad[m];
}
}
// see if preloading has stalled
if(totalBytesLoaded==oldBytesLoaded) {
waitCount++;
// stalled - restart
if(waitCount>60) gotoAndPlay(1);
} else {
oldBytesLoaded = totalBytesLoaded;
waitCount = 0;
}
// load prepage
if(pp!=null) {
preLoadCount += 1;
if((prepage.getBytesLoaded() == prepage.getBytesTotal()) && prepage.getBytesTotal()>100) {
debug.text = "pre page is loaded\n" + debug.text;
isLoaded*=1;
loadedCount++;
} else {
debug.text = "pre page is not loaded\n" + debug.text;
isLoaded*=0;
}
}
// output to debug mc
debug.text = "****** ("+Math.round((getTimer()-startTime)/1000)+" sec)\n" + debug.text;
// check if loaded
if(isLoaded || preLoadCount==0) {
play();
delete onEnterFrame;
}
// update status msg
if(preLoadCount!=0) loadedText.text = loadedCount+" of "+preLoadCount+" pages loaded";
}
function resetCache() {
var init = (transparency)? 0 : 1;
pageSounds = new Array();
for(var k=init;k<pageClips.length;k++) {
for(var m=0;m<pageOrder.length;m++) {
var p = eval(pageClips[k]+".p"+(m+1));
p._visible = 0;
p.gotoAndPlay(1);
pageSounds[m+1] = new Sound(p);
pageSounds[m+1].setVolume(0);
}
}
}
stop();
muchas gracias por tomarse tiempo y si me pueden orientar de alguna manera pues les agradecere.
Nota: los archivos cargados son imagenes.jpg