Section 1
//Book_1 (JohnSuGoestoPAX_fla.Book_1)
package JohnSuGoestoPAX_fla {
import flash.display.*;
import flash.geom.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.events.*;
import flash.external.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.text.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Book_1 extends MovieClip {
public var page1:MovieClip;
public var page2:MovieClip;
public var lastPage:int;
public var shade:MovieClip;
public function Book_1(){
addFrameScript(0, frame1, 7, frame8, 14, frame15);
}
function frame8(){
page1.goto(page2.page);
stop();
}
public function jitter(_arg1, _arg2=0.5){
var _local3:* = Point.polar((_arg2 * Math.random()), ((2 * Math.PI) * Math.random()));
var _local4:* = Point.polar((_arg2 * Math.random()), ((2 * Math.PI) * Math.random()));
_arg1.color.x = _local4.x;
_arg1.color.y = _local4.y;
}
function frame15(){
page2.goto(page1.page);
stop();
}
public function gotoPage(_arg1){
if (isNaN(lastPage)){
lastPage = 1;
};
if (_arg1 > lastPage){
page1.goto(page2.page);
page2.goto(_arg1);
gotoAndPlay(1);
} else {
if (_arg1 < lastPage){
page2.goto(page1.page);
page1.goto(_arg1);
gotoAndPlay(9);
};
};
lastPage = _arg1;
}
function frame1(){
}
}
}//package JohnSuGoestoPAX_fla
Section 2
//ERROR_8 (JohnSuGoestoPAX_fla.ERROR_8)
package JohnSuGoestoPAX_fla {
import flash.display.*;
public dynamic class ERROR_8 extends MovieClip {
public function ERROR_8(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package JohnSuGoestoPAX_fla
Section 3
//MainTimeline (JohnSuGoestoPAX_fla.MainTimeline)
package JohnSuGoestoPAX_fla {
import flash.display.*;
import flash.geom.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.events.*;
import flash.external.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.text.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var bmp:Bitmap;
public var page:int;
public var sWidth:int;
public var initialized:Boolean;
public var noises:Array;
public var lastIndex:int;
public var ERROR:MovieClip;
public var book:MovieClip;
public var holder:MovieClip;
public var myBMP:BitmapData;
public var sHeight:int;
public var phase:int;
public function MainTimeline(){
addFrameScript(0, frame1);
}
public function init(){
var noise:BitmapData;
var pow1:*;
var pow2:*;
ERROR.visible = false;
lastIndex = 0;
sWidth = 640;
sHeight = 480;
book.gotoAndStop(8);
page = 1;
if (initialized){
return;
};
initialized = true;
phase = 0;
this.addEventListener(Event.ENTER_FRAME, function (_arg1){
phase++;
if (((((phase % 2) == 0)) || (!((book.currentFrame == book.lastFrame))))){
sketch(book, holder);
book.jitter(book.page1);
book.jitter(book.page2);
};
book.lastFrame = book.currentFrame;
});
stage.addEventListener(KeyboardEvent.KEY_DOWN, function (_arg1){
var _local2:* = _arg1.keyCode;
if ((((((_local2 == Keyboard.RIGHT)) || ((_local2 == Keyboard.DOWN)))) || ((_local2 == Keyboard.SPACE)))){
flipBook((page + 1));
} else {
if ((((((_local2 == Keyboard.LEFT)) || ((_local2 == Keyboard.UP)))) || ((_local2 == Keyboard.BACKSPACE)))){
flipBook((page - 1));
} else {
if (_local2 == Keyboard.END){
flipBook((page + 100));
} else {
if (_local2 == Keyboard.HOME){
flipBook((page - 100));
};
};
};
};
});
this.addEventListener(MouseEvent.CLICK, function (_arg1){
if (mouseX > (sWidth / 2)){
flipBook((page + 1));
} else {
flipBook((page - 1));
};
});
noises = new Array();
var a:* = 0;
while (a < 8) {
noise = new BitmapData(sWidth, sHeight);
pow1 = Math.pow(2, (4 + int((Math.random() * 2))));
pow2 = Math.pow(2, (4 + int((Math.random() * 2))));
pow1 = 32;
pow2 = 32;
noise.perlinNoise(pow1, pow2, 4, a, false, true, 7, false, [0, 0, 0]);
noises[a] = noise;
a = (a + 1);
};
}
function frame1(){
init();
}
public function sketch(_arg1:DisplayObject, _arg2:DisplayObjectContainer){
if (myBMP != null){
myBMP.dispose();
};
if (((!((bmp == null))) && (_arg2.contains(bmp)))){
_arg2.removeChild(bmp);
};
var _local3:Rectangle = _arg1.getBounds(this);
_local3 = new Rectangle(0, 0, sWidth, sHeight);
var _local4:Matrix = new Matrix();
var _local5:* = this.transform.concatenatedMatrix;
_local5.invert();
_local4.concat(_arg1.transform.concatenatedMatrix);
_local4.concat(_local5);
_local4.translate(-(_local3.left), -(_local3.top));
myBMP = new BitmapData(_local3.width, _local3.height, true, 0);
myBMP.draw(_arg1, _local4);
lastIndex = ((lastIndex + int((1 + (7 * Math.random())))) % 8);
var _local6:BitmapData = noises[lastIndex];
var _local7:DisplacementMapFilter = new DisplacementMapFilter(_local6, new Point(0, 0), 1, 2, 2, 2, DisplacementMapFilterMode.CLAMP);
myBMP.applyFilter(myBMP, myBMP.rect, new Point(0, 0), _local7);
_local7 = null;
bmp = new Bitmap(myBMP);
_arg2.addChild(bmp);
_local4.invert();
bmp.transform.matrix = _local4;
_arg1.visible = false;
}
public function flipBook(_arg1:int){
page = Math.min(18, Math.max(1, _arg1));
book.gotoPage(page);
}
}
}//package JohnSuGoestoPAX_fla
Section 4
//Pages_2 (JohnSuGoestoPAX_fla.Pages_2)
package JohnSuGoestoPAX_fla {
import flash.display.*;
public dynamic class Pages_2 extends MovieClip {
public var color:MovieClip;
public var lines:MovieClip;
public var page:int;
public function Pages_2(){
addFrameScript(0, frame1);
}
function frame1(){
lines.stop();
color.stop();
}
public function goto(_arg1){
page = _arg1;
lines.gotoAndStop(page);
color.gotoAndStop(page);
}
}
}//package JohnSuGoestoPAX_fla
Section 5
//pages_4 (JohnSuGoestoPAX_fla.pages_4)
package JohnSuGoestoPAX_fla {
import flash.display.*;
public dynamic class pages_4 extends MovieClip {
public function pages_4(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package JohnSuGoestoPAX_fla