Bookclick.as

From Organic Design wiki
Revision as of 02:23, 20 December 2006 by Jack (talk | contribs)

// Code for [[SWF e-book]] is liscenced under [[[[1]]]] margin = 50; w = (Stage.width-margin*2)/2; h = Stage.height-margin*2; ox = margin+w; oy = margin; i = 0; speed = 12;

function reduce() { if (i) pageTurn (i-=speed); }

// This initialises the book page lines createEmptyMovieClip("book",1);

function pageTurn(i) {

x = i-ox; y = 0;

       if (x>w) x = w;
       if (x<-w) x = -w;

dx = w-x; Zx = x+dx/2;

// Draw page clear(); lineStyle(3,0); moveTo(ox,oy); lineTo(ox,oy+h); moveTo(ox-w,oy); lineTo(ox+Zx,oy); lineTo(ox+Zx,oy+h); lineTo(ox-w,oy+h); lineTo(ox-w,oy);

beginFill(0xdddddd,100); moveTo(ox+x,oy); lineTo(ox+Zx,oy); lineTo(ox+Zx,oy+h);

lineTo(ox+x,oy+h); lineTo(ox+x,oy+y); endFill(); }


book.onMouseUp = function () { i=Stage.width-margin; }