Frame 1
_root.aaa.removeMovieClip();
var pre_enabled = true;
var pre_bar_bgcolor = 255;
var pre_bar_bgalpha = 30;
var pre_bar_color = 128;
var pre_bar_alpha = 100;
var pre_bar_rect = (new flash.geom.Rectangle(10, 30, 180, 10));
var pre_text_rect = (new flash.geom.Rectangle(10, 10, 180, 20));
Main.init(_root);
pano = Main.pc;
pano.initMovClip = false;
pano.started = false;
if (window_width != undefined) {
pano.setWindowSize(window_width, window_height);
pano.windowScaleIgnore = true;
}
if (window_x != undefined) {
pano.setWindowPos(window_x, window_y);
}
flash.external.ExternalInterface.addCallback("control", this, Main.controller_callback);
var showItem = true;
var my_cm = new ContextMenu(menuHandler);
my_cm.hideBuiltInItems();
this.menu = my_cm;
if (Main.windowScale) {
Stage.scaleMode = "noScale";
}
var pre_text_fmt = new TextFormat();
pre_text_fmt.bold = true;
pre_text_fmt.font = "Arial";
pre_text_fmt.size = 12;
pre_text_fmt.color = 0;
Frame 2
Main.showfps = false;
Main.title_string = "";
Main.windowWidth = 600;
Main.windowHeight = 400;
pano.setWindowSize(0, 0);
pre_enabled = true;
pre_bar_bgcolor = 8421631 /* 0x8080FF */;
pre_bar_bgalpha = 50;
pre_bar_color = 255;
pre_bar_alpha = 50;
pre_text_fmt.color = 16777215 /* 0xFFFFFF */;
pre_text_rect.left = 10;
pre_text_rect.top = 10;
pre_bar_rect.left = 10;
pre_bar_rect.top = 30;
pre_bar_rect.width = 180;
pre_bar_rect.height = 10;
pano.pan.cur = 0;
pano.tilt.cur = 0;
pano.fov.cur = 70;
pano.pan.min = 0;
pano.tilt.min = -90;
pano.fov.min = 25;
pano.pan.max = 360;
pano.tilt.max = 90;
pano.fov.max = 120;
pano.autorotate = false;
pano.autorotate_timeout = 5;
pano.autorotate_pan = 1;
pano.autorotate_tilt_force = 0;
pano.autorotate_onlyinfocus = true;
pano.preloadColor = 16777216 /* 0x1000000 */;
pano.meshBase = 9;
pano.meshAuto = true;
pano.init_cube();
pano.started = true;
Frame 4
pano.init_faces();
_global.krai = false;
Frame 5
pano.init_faces();
Frame 7
_global.ogn = 0;
if (pre_enabled) {
_root.pretxt.removeTextField();
_root.prebar.removeMovieClip();
_root.preimg.removeMovieClip();
}
_root.onEnterFrame = function () {
Main.doEnterFrame();
};
pano.init_faces();
pano.completed = true;
pano.dirty = true;
pano.windowScaleIgnore = false;
stop();
_root.attachMovie("intro", "intro", 998, {_x:300, _y:200});
Instance of Symbol 205 MovieClip "act" in Frame 7
onClipEvent (load) {
this.swapDepths(997);
}
Symbol 13 MovieClip [Anim] Frame 1
n = 0;
max = 6;
var k = 0;
while (k < max) {
this.attachMovie("AnimFly", "AnimFly" + k, k + 100);
this["AnimFly" + k]._rotation = (k * 360) / max;
k++;
}
Symbol 26 MovieClip Frame 1
stop();
Symbol 26 MovieClip Frame 21
_root.intro.steam2.gotoAndPlay(2);
Symbol 34 MovieClip Frame 1
stop();
Symbol 34 MovieClip Frame 21
_root.intro.dsmoke.gotoAndPlay(2);
Symbol 36 MovieClip Frame 1
stop();
Symbol 36 MovieClip Frame 2
_root.intro.righteye.gotoAndStop(1);
Symbol 36 MovieClip Frame 51
_root.intro.secfairy1.gotoAndPlay(2);
Symbol 40 MovieClip Frame 1
stop();
Symbol 40 MovieClip Frame 2
_root.intro.lefteye.gotoAndStop(1);
Symbol 40 MovieClip Frame 51
_root.intro.secfairy.gotoAndPlay(2);
Symbol 40 MovieClip Frame 56
Symbol 40 MovieClip Frame 57
stop();
Symbol 45 MovieClip Frame 1
stop();
Symbol 45 MovieClip Frame 55
this._parent._parent.aaa.swapDepths(998);
Symbol 45 MovieClip Frame 61
_global.otkaz = false;
stop();
Symbol 52 MovieClip Frame 1
_root.symphony.removeMovieClip();
Symbol 53 MovieClip [happyend] Frame 1
_root.symphony.removeMovieClip();
Symbol 53 MovieClip [happyend] Frame 30
stop();
_global.krai = true;
Symbol 56 MovieClip [gameover] Frame 30
stop();
_global.krai = true;
Symbol 58 MovieClip [Symphony] Frame 183
gotoAndPlay (51);
Symbol 62 MovieClip Frame 1
max = 15;
var k = 0;
while (k < max) {
this.attachMovie("AnimColorize", "anim" + k, 9000 + k);
this["anim" + k].gotoAndPlay(Math.ceil(((k * this["anim" + k]._totalframes) / max) / 5));
this["anim" + k]._xscale = 100 + (k * 5);
this["anim" + k]._yscale = 100 + (k * 5);
this["anim" + k]._alpha = 100 - k;
k++;
}
Symbol 75 MovieClip Frame 1
stop();
Instance of Symbol 72 MovieClip "sp" in Symbol 75 MovieClip Frame 1
on (release) {
_root.aaa.dtxt._visible = true;
_root.aaa.prob._visible = true;
_root.aaa.aas._visible = true;
_root.aaa.fwefe._visible = true;
_root.aaa.non._visible = true;
_root.aaa.ans._visible = true;
_root.aaa.starttest = 1;
_root.aaa.descreen();
}
Instance of Symbol 74 MovieClip in Symbol 75 MovieClip Frame 1
on (release) {
_global.lvl = eval("Undefined");
_root.aaa.pre.gotoAndPlay(42);
_root.aaa.dtxt._visible = false;
_root.aaa.prob._visible = false;
_root.aaa.aas._visible = false;
_root.aaa.fwefe._visible = false;
_root.aaa.non._visible = false;
_root.aaa.ans._visible = false;
}
Symbol 76 MovieClip Frame 1
stop();
Symbol 76 MovieClip Frame 2
_root.symphony.removeMovieClip();
Instance of Symbol 62 MovieClip "magic" in Symbol 76 MovieClip Frame 2
onClipEvent (load) {
this._xScale = 100;
this._yScale = 100;
}
Symbol 76 MovieClip Frame 40
stop();
Symbol 76 MovieClip Frame 41
stop();
Symbol 76 MovieClip Frame 48
_global.lvl = eval("Undefined");
_root.attachMovie("symphony", "symphony", 1);
Symbol 109 MovieClip Frame 5
if (_global.lvl2_points == 5) {
_root.aaa.fairy2.fairymid.gotoAndPlay(19);
_root.aaa.fireworks.gotoAndPlay(2);
_root.aaa.fireworks._x = -626;
_root.aaa.fireworks._y = -50;
}
if (_global.lvl2_points == 1) {
_root.aaa.fairy2.fairymid.gotoAndPlay(25);
}
Symbol 109 MovieClip Frame 18
gotoAndPlay (1);
Symbol 109 MovieClip Frame 23
_root.aaa.smoke.gotoAndPlay(2);
Symbol 109 MovieClip Frame 24
_root.aaa.fairy2._visible = false;
stop();
Symbol 109 MovieClip Frame 30
_root.aaa.smoke.gotoAndPlay(2);
Symbol 109 MovieClip Frame 31
_root.attachMovie("gameover", "gameover", 999, {_x:200, _y:150});
_global.otkaz = true;
_root.aaa.fairy2._visible = false;
stop();
Instance of Symbol 109 MovieClip "fairymid" in Symbol 110 MovieClip Frame 1
on (release) {
if (lvl == eval("Undefined")) {
_root.aaa.dtxt._visible = false;
_root.aaa.prob._visible = false;
_root.aaa.aas._visible = false;
_root.aaa.fwefe._visible = false;
_root.aaa.non._visible = false;
_root.aaa.resetstats();
_root.aaa.level2(5000, 10);
}
}
Symbol 137 MovieClip Frame 5
if (_global.lvl3_points == 5) {
_root.aaa.fairy3.fa.gotoAndPlay(19);
_root.aaa.fireworks.gotoAndPlay(2);
_root.aaa.fireworks._x = 626;
_root.aaa.fireworks._y = -50;
}
if (_global.lvl3_points == 1) {
_root.aaa.fairy3.fa.gotoAndPlay(25);
}
Symbol 137 MovieClip Frame 18
gotoAndPlay (1);
Symbol 137 MovieClip Frame 23
_root.aaa.smoke.gotoAndPlay(2);
Symbol 137 MovieClip Frame 24
_root.aaa.fairy3._visible = false;
stop();
Symbol 137 MovieClip Frame 29
_root.aaa.fairy3._x = _root.aaa.fairy3._x - 5;
_root.aaa.fairy3._y = _root.aaa.fairy3._y + 5;
Symbol 137 MovieClip Frame 30
_root.aaa.fairy3._x = _root.aaa.fairy3._x - 5;
_root.aaa.fairy3._y = _root.aaa.fairy3._y + 5;
Symbol 137 MovieClip Frame 31
_root.aaa.fairy3._x = _root.aaa.fairy3._x - 5;
_root.aaa.fairy3._y = _root.aaa.fairy3._y + 5;
Symbol 137 MovieClip Frame 32
_root.aaa.fairy3._x = _root.aaa.fairy3._x - 5;
_root.aaa.fairy3._y = _root.aaa.fairy3._y + 5;
Symbol 137 MovieClip Frame 33
_root.aaa.smoke.gotoAndPlay(2);
Symbol 137 MovieClip Frame 34
_root.attachMovie("gameover", "gameover", 999, {_x:200, _y:150});
_global.otkaz = true;
_root.aaa.fairy3._visible = false;
stop();
Instance of Symbol 137 MovieClip "fa" in Symbol 138 MovieClip Frame 1
on (release) {
if (lvl == eval("Undefined")) {
_root.aaa.dtxt._visible = false;
_root.aaa.prob._visible = false;
_root.aaa.aas._visible = false;
_root.aaa.fwefe._visible = false;
_root.aaa.non._visible = false;
_root.aaa.resetstats();
_root.aaa.level3(5000, 10);
}
}
Symbol 143 MovieClip Frame 1
stop();
Symbol 170 MovieClip Frame 1
Symbol 170 MovieClip Frame 5
if (_global.lvl1_points == 5) {
_root.aaa.fairy1.fairyhard.gotoAndPlay(19);
_root.aaa.fireworks.gotoAndPlay(2);
_root.aaa.fireworks._x = 0;
_root.aaa.fireworks._y = -40;
}
if (_global.lvl1_points == 1) {
_root.aaa.fairy1.fairyhard.gotoAndPlay(25);
}
Symbol 170 MovieClip Frame 18
gotoAndPlay (1);
Symbol 170 MovieClip Frame 23
_root.aaa.smoke.gotoAndPlay(2);
Symbol 170 MovieClip Frame 24
_root.aaa.fairy1._visible = false;
stop();
Symbol 170 MovieClip Frame 27
_root.aaa.smoke.gotoAndPlay(2);
Symbol 170 MovieClip Frame 30
_root.attachMovie("gameover", "gameover", 999, {_x:200, _y:150});
_global.otkaz = true;
_root.aaa.fairy1._visible = false;
stop();
Symbol 174 MovieClip Frame 30
stop();
Symbol 175 MovieClip Frame 1
i = 3;
while (Number(i) < 55) {
duplicateMovieClip ("vw1", "vw" + i, i);
setProperty("vw" + i, _rotation , random(360));
setProperty("vw" + i, _alpha , random(125));
scalefactor = 45 + Number(random(60));
setProperty("vw" + i, _xscale , scalefactor);
setProperty("vw" + i, _yscale , scalefactor);
i = Number(i) + 1;
}
Symbol 176 MovieClip Frame 1
stop();
Symbol 176 MovieClip Frame 46
_global.ogn++;
if (_global.ogn == 3) {
_global.otkaz = true;
_root.symphony.removeMovieClip();
_root.attachMovie("happyend", "happyend", 999, {_x:200, _y:150});
}
Symbol 177 MovieClip [hs_textmc] Frame 1
function makenum(max, min) {
num1 = Math.round(Math.random() * (max - min)) + min;
num2 = Math.round(Math.random() * (max - min)) + min;
solution = num1 + num2;
problem = ((num1 + " + ") + num2) + " = ";
}
function resetstats() {
starttest = 0;
best = 100000 /* 0x0186A0 */;
wish = 1;
percent = 1;
record = new Array();
stats = "";
invert = "";
totaltime = 0;
totalquestions = 0;
totalmissed = 0;
totalcorrect = 0;
score = 0;
averagetime = 0;
readtime = 0;
timerstart = getTimer() + 80000;
}
function level1(tehtime, quests) {
resetstats();
operator = "Addition";
_global.lvl = "lvl1";
if (lvl1record > 1) {
best = lvl1record;
}
timerlimit = tehtime;
timerlimitread = (timerlimit / 1000) + " Seconds";
level = "Level 1 Challenge";
_root.objective = "We're using telepathy to communicate to you. To break the spell you must conquer simple addition. To start, just start typing in the box below.";
questions = quests;
readquestions = questions + " Questions";
min = 3;
max = 9;
makenum(max, min);
darkenstat();
}
function level2(tehtime, quests) {
resetstats();
operator = "Addition";
_global.lvl = "lvl2";
if (lvl2record > 1) {
best = lvl2record;
}
level = "Level 2 Challenge";
min = 11;
max = 99;
_root.objective = "I'm the Red Fairy. Nice to meet you. Welcome to our doomed castle. We all live here under evil spell. Can you release us? You are our only hope.";
questions = quests;
readquestions = questions + " Questions";
timerlimit = tehtime;
timerlimitread = (timerlimit / 1000) + " Seconds";
makenum(max, min);
darkenstat();
}
function level3(tehtime, quests) {
resetstats();
_global.lvl = "lvl3";
if (lvl3record > 1) {
best = lvl3record;
}
operator = "Addition";
level = "Level 3 Challenge";
min = 107;
max = 999;
_root.objective = "Make sure you break the spell on the Red Fairy, or else this is senseless. I wish you good luck. Only 1 of 100 people can break the spell on us. ";
questions = quests;
readquestions = questions + " Questions";
timerlimit = tehtime;
timerlimitread = (timerlimit / 1000) + " Seconds";
makenum(max, min);
darkenstat();
}
function darkenstat() {
questionsreload = questions;
pre.gotoAndPlay(1);
if (lvl == "lvl1") {
pre._x = 105;
pre._y = -128;
}
if (lvl == "lvl2") {
pre._x = -495;
pre._y = -128;
}
if (lvl == "lvl3") {
pre._x = 705;
pre._y = -128;
}
}
function descreen() {
if (lvl == "lvl1") {
dtxt._x = 120;
dtxt._y = -74;
non._x = 200;
non._y = -41.8;
aas._x = 200;
aas._y = -8.8;
fwefe._x = 200;
fwefe._y = -76.2;
ans._x = 132;
ans._y = 45;
prob._y = 18.5;
prob._x = 132;
}
if (lvl == "lvl2") {
dtxt._x = -473;
dtxt._y = -74;
non._x = -394;
non._y = -41.8;
aas._x = -394;
aas._y = -8.8;
fwefe._x = -394;
fwefe._y = -76.2;
ans._x = -468;
ans._y = 45;
prob._y = 18.5;
prob._x = -468;
}
if (lvl == "lvl3") {
dtxt._x = 722;
dtxt._y = -74;
non._x = 800;
non._y = -41.8;
aas._x = 800;
aas._y = -8.8;
fwefe._x = 800;
fwefe._y = -76.2;
ans._x = 732;
ans._y = 45;
prob._y = 18.5;
prob._x = 732;
}
pre.gotoAndStop(41);
Selection.setFocus(ans);
}
_global.lvl;
var problem;
var questions;
var questionsreload;
var readquestions;
var max;
var conqueredtime;
var min;
var objective;
var operator = "Addition";
addo.gotoAndStop(2);
var level;
var num1;
var num2;
var disableauto = 1;
var cluttersound = 0;
var cluttertime = 0;
var totaltime;
var totalquestions;
var totalmissed;
var totalcorrect;
var score;
var averagetime;
var readtime;
var wish;
var percent;
var timer;
_root.aaa.togo._width = 1;
var timerstart;
var timerlimit;
var record = new Array();
var stats;
var invert;
_root.aaa.groups.gotoAndStop(1);
_global.lvl1_points = 0;
_global.lvl2_points = 0;
_global.lvl3_points = 0;
var best = 100000;
var lvl3record;
var lvl2record;
var lvl1record;
var stat;
onEnterFrame = function () {
if (cluttersound == 1) {
if ((getTimer() - cluttertime) > 200) {
cluttersound = 0;
}
}
if ((questions == 0) && (starttest == 1)) {
starttest = 0;
if (totalmissed == 0) {
if (_global.lvl == "lvl1") {
if (averagetime < best) {
best = averagetime;
_global.lvl1record = averagetime;
}
conqueredtime = averagetime;
_root.aaa.dtxt._visible = false;
_root.aaa.prob._visible = false;
_root.aaa.aas._visible = false;
_root.aaa.fwefe._visible = false;
_root.aaa.non._visible = false;
_root.aaa.ans._visible = false;
_root.aaa.pre.gotoAndPlay(42);
this._parent.aaa.smoke._x = -58;
this._parent.aaa.smoke._y = -105;
if (conqueredtime < 1.8) {
_global.lvl1_points = 5;
} else {
_global.lvl1_points = 1;
}
}
if (_global.lvl == "lvl2") {
if (averagetime < best) {
best = averagetime;
_global.lvl2record = averagetime;
}
conqueredtime = averagetime;
_root.aaa.dtxt._visible = false;
_root.aaa.prob._visible = false;
_root.aaa.aas._visible = false;
_root.aaa.fwefe._visible = false;
_root.aaa.non._visible = false;
_root.aaa.ans._visible = false;
_root.aaa.pre.gotoAndPlay(42);
this._parent.aaa.smoke._x = -668;
this._parent.aaa.smoke._y = -105;
if (conqueredtime < 4) {
_global.lvl2_points = 5;
} else {
_global.lvl2_points = 1;
}
}
if (_global.lvl == "lvl3") {
if (averagetime < best) {
best = averagetime;
_global.lvl3record = averagetime;
}
conqueredtime = averagetime;
_root.aaa.dtxt._visible = false;
_root.aaa.prob._visible = false;
_root.aaa.aas._visible = false;
_root.aaa.fwefe._visible = false;
_root.aaa.non._visible = false;
_root.aaa.ans._visible = false;
_root.aaa.pre.gotoAndPlay(42);
this._parent.aaa.smoke._x = 562;
this._parent.aaa.smoke._y = -105;
if (conqueredtime < 6) {
_global.lvl3_points = 5;
} else {
_global.lvl3_points = 1;
}
}
}
}
if (starttest == 1) {
timer = getTimer() - timerstart;
percent = timer / timerlimit;
if (percent < 1.01) {
wish = 163 * percent;
} else {
wish = 163;
if (timer > 5) {
if (disableauto == 0) {
totaltime = totaltime + timer;
totalquestions++;
totalmissed++;
questions--;
averagetime = Math.round(totaltime / totalquestions) / 1000;
score = Math.round((100 * totalcorrect) / totalquestions);
stopAllSounds();
mySound = new Sound();
mySound.attachSound("miss");
mySound.start(0, 1);
ans.text = "";
makenum(max, min);
timerstart = getTimer();
record.push({time:timer, problem:problem + solution});
stats = "";
invert = "";
record.sortOn("time", Array.ASCENDING | Array.NUMERIC);
i = 0;
while (i < record.length) {
stats = stats + (((record[i].time + ", ") + record[i].problem) + newline);
i++;
}
record.reverse();
i = 0;
while (i < record.length) {
invert = invert + (((record[i].time + ", ") + record[i].problem) + newline);
i++;
}
}
}
}
if ((timer > 0) && (timer < 100)) {
ans.text = "";
}
_root.aaa.togo._width = wish;
readtime = totaltime / 1000;
if ((ans.text == solution) && (timer < 5)) {
ans.text = "";
makenum(max, min);
timerstart = getTimer();
stopAllSounds();
mySound = new Sound();
mySound.attachSound("good");
mySound.start(0, 1);
}
if ((ans.text == solution) && (timer > 5)) {
totaltime = totaltime + timer;
totalquestions++;
totalcorrect++;
questions--;
averagetime = Math.round(totaltime / totalquestions) / 1000;
score = Math.round((100 * totalcorrect) / totalquestions);
record.push({time:timer, problem:problem + solution});
stats = "";
invert = "";
record.sortOn("time", Array.ASCENDING | Array.NUMERIC);
i = 0;
while (i < record.length) {
stats = stats + (((record[i].time + ", ") + record[i].problem) + newline);
i++;
}
record.reverse();
i = 0;
while (i < record.length) {
invert = invert + (((record[i].time + ", ") + record[i].problem) + newline);
i++;
}
stopAllSounds();
mySound = new Sound();
mySound.attachSound("good");
mySound.start(0, 1);
ans.text = "";
makenum(max, min);
timerstart = getTimer();
}
}
};
Instance of Symbol 171 MovieClip "fairy1" in Symbol 177 MovieClip [hs_textmc] Frame 1
on (release) {
if (lvl == eval("Undefined")) {
_root.aaa.dtxt._visible = false;
_root.aaa.prob._visible = false;
_root.aaa.aas._visible = false;
_root.aaa.fwefe._visible = false;
_root.aaa.non._visible = false;
_root.aaa.resetstats();
_root.aaa.level1(10000, 10);
}
}
Symbol 206 MovieClip [__Packages.Main] Frame 0
class Main
{
static var pc, bclip, fc, setupFrame, setupRow, fps_txt, p2vr_txt, t_fps, t1, t2;
function Main () {
}
static function main() {
title_string = "FlashPack";
init(_root);
pc.meshBase = 10;
pc.init_cylinder();
showfps = true;
pc.meshCylBase = 5;
pc.setMeshDensity(0);
pc.autorotate = true;
pc.doPaint();
pc.started = true;
pc.dirty = true;
setWindowSize(0, 0);
pc.initHotspots();
}
static function init(pbclip) {
bclip = pbclip;
pc = new PanoCube();
pc.init(bclip);
pc.pan.init(pan_init, pan_min, pan_max);
pc.tilt.init(tilt_init, tilt_min, tilt_max);
pc.fov.init(fov_init, fov_min, fov_max);
pc.started = false;
fc = 0;
bclip.onEnterFrame = doEnterFrame;
var _local4 = new Object();
_local4.onMouseDown = doMouseDown;
_local4.onMouseUp = doMouseUp;
Mouse.addListener(_local4);
var _local3 = new Object();
_local3.onKeyDown = doKeyDown;
_local3.onKeyUp = doKeyUp;
Key.addListener(_local3);
bclip.focusEnabled = true;
setupFrame = 0;
setupRow = 0;
var _local5 = new Object();
_local5.onResize = doStageResize;
Stage.addListener(_local5);
if (!windowScale) {
pc.rect.width = windowWidth;
pc.rect.height = windowHeight;
}
var _local1 = new TextFormat();
_local1.bold = true;
_local1.font = "Arial";
_local1.size = 12;
_local1.color = 16777215 /* 0xFFFFFF */;
fps_txt = bclip.createTextField("fps_txt", 111, 10, 10, 1101, 20);
_local1.align = "left";
fps_txt.setNewTextFormat(_local1);
fps_txt.selectable = false;
fps_txt.text = "";
if (title_string != "") {
var _local2 = new TextFormat();
_local2.bold = true;
_local2.font = "Arial";
_local2.size = 12;
_local2.color = 16777215 /* 0xFFFFFF */;
p2vr_txt = bclip.createTextField("p2vr_txt", 1100, Stage.width - 215, Stage.height - 20, 200, 20);
_local2.align = "right";
p2vr_txt.setNewTextFormat(_local2);
p2vr_txt.selectable = false;
p2vr_txt.text = title_string;
}
doReposElements();
}
static function doKeyDown() {
pc.lastkeycode = Key.getCode();
if (Key.getAscii() == 43) {
pc.changeFov(-1);
}
if (Key.getAscii() == 45) {
pc.changeFov(1);
}
if (Key.isDown(16)) {
if (Key.getCode() == 73) {
showfps = !showfps;
if (!showfps) {
fps_txt.text = "";
}
}
if (Key.getCode() == 72) {
pc.meshBase++;
}
if (Key.getCode() == 76) {
pc.meshBase--;
}
}
pc.key_down = true;
pc.dirty = true;
}
static function doKeyUp() {
pc.key_down = false;
pc.dirty = true;
}
static function doStageResize() {
if (windowScale) {
pc.doStageResize();
doReposElements();
}
}
static function doEnterFrame() {
fc = ++fc;
if (showfps) {
if ((fc % 10) == 0) {
var _local3 = new Date();
var _local2;
_local2 = _local3.getTime();
fps_txt.text = (((("fps " + (Math.round(100000 / (_local2 - t_fps)) * 0.1)) + " Q: ") + pc.meshBase) + "/") + pc.cubeTiles;
t_fps = _local2;
}
}
if ((!pc.started) && (_root._currentframe > 5)) {
pc.init_faces();
pc.doPaint();
pc.started = true;
pc.dirty = true;
}
pc.doEnterFrame();
}
static function addHotspot(ap, at, typ, url) {
title_string = (((((("ap:" + ap) + "at:") + at) + "t:") + typ) + "url:") + url;
}
static function timestamp() {
var _local1 = new Date();
t1 = _local1.getTime();
t2 = t1;
}
static function doMouseDown() {
pc.doMouseDown();
}
static function doClickHotspot(id) {
if (pc.onClickHotspot != undefined) {
pc.onClickHotspot(id);
}
}
static function doRollOverHotspot(id) {
if (pc.onRollOverHotspot != undefined) {
pc.onRollOverHotspot(id);
}
}
static function doRollOutHotspot(id) {
if (pc.onRollOutHotspot != undefined) {
pc.onRollOutHotspot(id);
}
}
static function doMouseUp() {
pc.doMouseUp();
}
static function doReposElements() {
_root.p2vr_txt._x = (Stage.width - _root.p2vr_txt._width) - 15;
_root.p2vr_txt._y = Stage.height - 20;
pc.reposElements();
}
static function setWindowSize(wx, wy) {
if (wx == 0) {
windowScale = true;
pc.doStageResize();
} else {
windowScale = false;
windowWidth = wx;
windowHeight = wy;
pc.rect.width = windowWidth;
pc.rect.height = windowHeight;
}
}
static function setWindowPos(wx, wy) {
var _local2 = pc.rect.width;
var _local3 = pc.rect.height;
pc.rect.top = wx;
pc.rect.left = wy;
pc.rect.width = _local2;
pc.rect.height = _local3;
_root._x = wx;
_root._y = wy;
}
static function findHotspot(aid) {
var _local2;
var _local1;
_local1 = pc.hotspots.length - 1;
while (_local1 >= 0) {
_local2 = pc.hotspots[_local1];
if (_local2.id == aid) {
return(_local2);
}
_local1--;
}
return(null);
}
static function controller_callback(id, v) {
if (v != undefined) {
if (id == "zoom") {
pc.changeFov(-v);
}
if (id == "fov") {
pc.changeFov(v);
}
if (id == "pan") {
pc.changePan(v);
}
if (id == "tilt") {
pc.changeTilt(v);
}
if (id == "quality") {
if (v == 0) {
pc.cubeTiles = 4;
}
if (v == 1) {
pc.cubeTiles = 4;
}
}
if (id == "autoplay") {
pc.autoplay = v != 0;
if (v == 0) {
pc.resetlastaction();
}
}
if (id == "autorotate") {
pc.autorotate = v != 0;
}
} else {
if ((id == "zoom") || (id == "fov")) {
return(pc.fov.cur);
}
if (id == "pan") {
return(pc.pan.cur);
}
if (id == "tilt") {
return(pc.tilt.cur);
}
if (id == "autoplay") {
return((pc.autoplay ? 1 : 0));
}
if (id == "autorotate") {
return((pc.autorotate ? 1 : 0));
}
}
}
static var title_string = "";
static var fov_init = 70;
static var fov_min = 30;
static var fov_max = 100;
static var pan_init = 0;
static var pan_min = 0;
static var pan_max = 360;
static var tilt_init = 0;
static var tilt_min = -90;
static var tilt_max = 90;
static var qualityMotion = "HIGH";
static var qualityStatic = "HIGH";
static var mqual = 0;
static var isinfocus = false;
static var showfps = false;
static var windowScale = true;
static var windowWidth = 400;
static var windowHeight = 300;
}
Symbol 207 MovieClip [__Packages.PanoCube] Frame 0
class PanoCube
{
var framecnt, fov, pan, tilt, bmp_in, bmp_loaded, va, vat, m, hotspots, mdown, mdownt, _aaa, _bbb, turn, cubeTiles, rect, hs_local, dPan, dPanm, dTiltm, dTilt, autorotate_pan, autorotate_tilt_force, autorotate_timeout, autorotate, autorotate_onlyinfocus, enable_callback, controllerPos, controllerAlpha, bmpSmooth, isCylinder, cylTilesXS, completed, preloadColor, windowScaleIgnore, lastaction_dt, bclip, cv, dirty, cylTilesXBase, cylTilesX, mat_sf, cv2, ed, cylTilesY, started, dA, lastkeycode, autoplay, onRotate;
function PanoCube () {
framecnt = 0;
fov = new PanoViewLimits(90, 20, 120);
pan = new PanoViewLimits(0, 0, 360);
tilt = new PanoViewLimits(0, -90, 90);
bmp_in = new Array();
bmp_loaded = new Array();
va = new Array();
vat = new Array();
m = new flash.geom.Matrix();
hotspots = new Array();
mdown = new flash.geom.Point();
mdownt = 0;
_aaa = 0;
_bbb = 0;
turn = false;
cubeTiles = meshBase;
rect = new flash.geom.Rectangle();
hs_local = 0;
dPan = 0;
dPanm = 0;
dTiltm = 0;
dTilt = 0;
autorotate_pan = 0.5;
autorotate_tilt_force = 0.01;
autorotate_timeout = 5;
autorotate = false;
autorotate_onlyinfocus = true;
enable_callback = false;
controllerPos = 6;
controllerAlpha = 100;
bmpSmooth = true;
rect.width = Stage.width;
rect.height = Stage.height;
isCylinder = false;
cylTilesXS = 4;
enable_callback = true;
completed = false;
preloadColor = 16777216 /* 0x1000000 */;
windowScaleIgnore = false;
lastaction_dt = 0;
}
function init(pbclip) {
var _local5;
var _local4;
var _local3;
bclip = pbclip;
cv = bclip.createEmptyMovieClip("cv", 20);
cv._alpha = 100;
cv.blendMode = "normal";
cv.onRollOver = function () {
Main.isinfocus = true;
};
cv.onRollOut = function () {
Main.isinfocus = false;
};
cv.useHandCursor = false;
}
function setWindowSize(wx, wy) {
if (windowScaleIgnore == false) {
Main.setWindowSize(wx, wy);
}
}
function setWindowPos(wx, wy) {
Main.setWindowPos(wx, wy);
}
function doStageResize() {
_root._x = _root._x - ((Stage.width - rect.width) / 2);
_root._y = _root._y - ((Stage.height - rect.height) / 2);
rect.width = Stage.width;
rect.height = Stage.height;
dirty = true;
checkLimits();
}
function reposElements() {
var _local3;
var _local4;
_local3 = Math.floor(controllerPos / 3);
_local4 = controllerPos % 3;
if (_local3 == 0) {
_root.cclip._x = 0;
}
if (_local3 == 1) {
_root.cclip._x = (Stage.width - _root.cclip._width) / 2;
}
if (_local3 == 2) {
_root.cclip._x = Stage.width - _root.cclip._width;
}
if (_local4 == 0) {
_root.cclip._y = 0;
}
if (_local4 == 1) {
_root.cclip._y = (Stage.height - _root.cclip._height) / 2;
}
if (_local4 == 2) {
_root.cclip._y = Stage.height - _root.cclip._height;
}
}
function init_cube() {
var _local3;
var _local2;
var _local4 = 1.001;
if (Main.qualityMotion == "LOW") {
_local4 = 1.0025;
}
_local3 = 0;
while (_local3 < 6) {
va.push(new Vector3d(-_local4, -_local4, -1));
va.push(new Vector3d(_local4, -_local4, -1));
va.push(new Vector3d(-_local4, _local4, -1));
va.push(new Vector3d(_local4, _local4, -1));
if (_local3 < 4) {
_local2 = 0;
while (_local2 < 4) {
va[(va.length - 4) + _local2].roty(1.570796 * _local3);
_local2++;
}
}
if (_local3 == 4) {
_local2 = 0;
while (_local2 < 4) {
va[(va.length - 4) + _local2].rotx(1.570796);
_local2++;
}
}
if (_local3 == 5) {
_local2 = 0;
while (_local2 < 4) {
va[(va.length - 4) + _local2].rotx(-1.570796);
_local2++;
}
}
bmp_loaded.push(false);
_local3++;
}
setMeshDensity(0);
}
function init_faces() {
if (isCylinder) {
init_cylinder_tiles();
} else {
init_cubefaces();
}
dirty = true;
}
function init_cubefaces() {
var _local2;
_local2 = 0;
while (_local2 < 6) {
init_cubeface(_local2);
_local2++;
}
}
function init_cubeface(cf) {
var _local5;
var _local6;
if (initMovClip) {
var _local4 = bclip.attachMovie(("library.pat.test_pat_512_" + cf) + ".jpg", "mc", 10);
bmp_in[cf] = new flash.display.BitmapData(_local4._width, _local4._height, true, 4289344000);
bmp_in[cf].draw(_local4);
_local4.removeMovieClip();
} else if (!bmp_loaded[cf]) {
var _local3;
_local3 = flash.display.BitmapData.loadBitmap("cube_" + cf);
if (_local3 == undefined) {
_local3 = flash.display.BitmapData.loadBitmap("cube_" + cf);
if (_local3 != undefined) {
bmp_in[cf] = _local3;
}
if (bmp_in[cf] == undefined) {
if (preloadColor < 16777216) {
bmp_in[cf] = new flash.display.BitmapData(128, 128, false, preloadColor);
} else {
bmp_in[cf] = new flash.display.BitmapData(128, 128, false, 13421772);
bmp_in[cf].noise(23, 0, 95, 7, true);
}
}
} else {
bmp_in[cf] = _local3;
bmp_loaded[cf] = true;
}
}
}
function init_cylinder() {
var _local4;
var _local12;
var _local3;
var _local10;
var _local8;
var _local14;
var _local15;
var _local13;
if (cylTilesXS < 1) {
cylTilesXS = 1;
}
_local4 = 0;
while (_local4 < cylTilesXS) {
bmp_loaded.push(false);
_local4++;
}
pan.max = 360;
pan.min = 0;
fov.min = 0.5;
var _local9 = pan.max - pan.min;
if (meshBase > 5) {
cylTilesXBase = 12 * Math.floor((meshBase - 3) / 2);
meshCylBase = Math.floor((meshBase + 4) / 2);
} else {
cylTilesXBase = 12;
meshCylBase = 4;
}
cylTilesXBase = Math.ceil(((cylTilesXBase * _local9) / 360) / cylTilesXS);
if ((cylTilesXBase * cylTilesXS) < 10) {
cylTilesXBase = Math.ceil(10 / cylTilesXS);
}
cylTilesX = cylTilesXBase;
isCylinder = true;
init_cylinder_tiles();
if (bmp_loaded[0]) {
_local10 = cylTilesXS * bmp_in[0].width;
_local8 = bmp_in[0].height;
} else {
_local10 = cylinderImageWidth;
_local8 = cylinderImageHeight;
}
var _local11 = 57.29578 * Math.atan((_local8 * 3.141593) / (_local10 * (360 / _local9)));
tilt.min = -_local11;
tilt.max = _local11;
checkLimits();
var _local7 = _local10 / (cylTilesX * cylTilesXS);
_local4 = 0;
while (_local4 < (cylTilesX * cylTilesXS)) {
var _local5 = Math.cos(3.141593 / (cylTilesX * cylTilesXS));
var _local2 = ((3.141593 / (cylTilesX * cylTilesXS)) * (_local9 / 360)) * 1.0002;
var _local6 = ((-_local2) / _local7) * _local8;
va.push(new Vector3d(_local2, _local6, _local5, _local4 * _local7, 0));
va.push(new Vector3d(-_local2, _local6, _local5, (_local4 + 1) * _local7, 0));
va.push(new Vector3d(_local2, -_local6, _local5, _local4 * _local7, _local8));
va.push(new Vector3d(-_local2, -_local6, _local5, (_local4 + 1) * _local7, _local8));
_local3 = 0;
while (_local3 < 4) {
va[(va.length - 4) + _local3].roty((((2 * _local4) * _local2) + _local2) + ((((-pan.max) + 180) * 3.141593) / 180));
_local3++;
}
_local4++;
}
}
function resetlastaction() {
var _local2 = new Date();
lastaction_dt = _local2.getTime();
}
function init_cylinder_tiles() {
var _local2;
_local2 = 0;
while (_local2 < cylTilesXS) {
init_cylinder_tile(_local2);
_local2++;
}
}
function init_cylinder_tile(ti) {
if (initMovClip) {
var _local4 = bclip.attachMovie("library.pat.cyl_1800_200.jpg", "obj_mc", 10);
bmp_in[ti] = new flash.display.BitmapData(_local4._width, _local4._height, true, 4289344000);
bmp_in[ti].draw(_local4);
_local4.removeMovieClip();
bmp_loaded[ti] = true;
} else if (!bmp_loaded[ti]) {
var _local3;
_local3 = flash.display.BitmapData.loadBitmap("cube_" + ti);
if (_local3 == undefined) {
_local3 = flash.display.BitmapData.loadBitmap("prevcube_" + ti);
if (_local3 != undefined) {
bmp_in[ti] = _local3;
}
if (bmp_in[ti] == undefined) {
bmp_in[ti] = new flash.display.BitmapData(128, 128, false, 13421772);
bmp_in[ti].noise(23, 0, 95, 7, true);
}
} else {
bmp_in[ti] = _local3;
bmp_loaded[ti] = true;
}
}
}
function calMatrix1(v1, v2, v3) {
m.a = v3.px - v2.px;
m.b = v3.py - v2.py;
m.c = ((2 * v1.px) - v2.px) - v3.px;
m.d = ((2 * v1.py) - v2.py) - v3.py;
m.scale(mat_sf, mat_sf);
m.tx = v2.px;
m.ty = v2.py;
}
function calMatrix2(v1, v2, v3) {
m.a = v3.px - v2.px;
m.b = v3.py - v2.py;
m.c = -(((2 * v1.px) - v2.px) - v3.px);
m.d = -(((2 * v1.py) - v2.py) - v3.py);
m.scale(mat_sf, mat_sf);
m.tx = v1.px + ((v2.px - v3.px) / 2);
m.ty = v1.py + ((v2.py - v3.py) / 2);
}
function calMatrix3(v1, v2, v3) {
m.a = ((2 * v1.px) - v2.px) - v3.px;
m.b = ((2 * v1.py) - v2.py) - v3.py;
m.c = v3.px - v2.px;
m.d = v3.py - v2.py;
m.scale(mat_sf, mat_sf);
m.tx = v2.px;
m.ty = v2.py;
}
function calMatrix4(v1, v2, v3) {
m.a = -(((2 * v1.px) - v2.px) - v3.px);
m.b = -(((2 * v1.py) - v2.py) - v3.py);
m.c = v3.px - v2.px;
m.d = v3.py - v2.py;
m.scale(mat_sf, mat_sf);
m.tx = v1.px + ((v2.px - v3.px) / 2);
m.ty = v1.py + ((v2.py - v3.py) / 2);
}
function calMatrix2a(v1, v2, v3) {
m.a = v3.px - v2.px;
m.b = v3.py - v2.py;
m.c = -(((2 * v1.px) - v2.px) - v3.px);
m.d = -(((2 * v1.py) - v2.py) - v3.py);
m.scale(mat_sf, mat_sf);
m.tx = (2 * v1.px) - v3.px;
m.ty = (2 * v1.py) - v3.py;
}
function calMatrix4a(v1, v2, v3) {
m.a = -(((2 * v1.px) - v2.px) - v3.px);
m.b = -(((2 * v1.py) - v2.py) - v3.py);
m.c = v3.px - v2.px;
m.d = v3.py - v2.py;
m.scale(mat_sf, mat_sf);
m.tx = (2 * v1.px) - v3.px;
m.ty = (2 * v1.py) - v3.py;
}
function calMatrixNew(sp, invTex, Ap, Bp, Cp, Dp, m1, m2) {
m1.a = (Bp.x - Ap.x) * invTex.x;
m1.c = (Cp.x - Bp.x) * invTex.y;
m1.b = (Bp.y - Ap.y) * invTex.x;
m1.d = (Cp.y - Bp.y) * invTex.y;
m1.tx = (Ap.x - (sp.x * m1.a)) - (sp.y * m1.c);
m1.ty = (Ap.y - (sp.x * m1.b)) - (sp.y * m1.d);
m2.a = (Cp.x - Dp.x) * invTex.x;
m2.c = (Dp.x - Ap.x) * invTex.y;
m2.b = (Cp.y - Dp.y) * invTex.x;
m2.d = (Dp.y - Ap.y) * invTex.y;
m2.tx = (Ap.x - (sp.x * m2.a)) - (sp.y * m2.c);
m2.ty = (Ap.y - (sp.x * m2.b)) - (sp.y * m2.d);
}
function paint_n(colofs, colf, blend) {
var _local42;
var _local41;
var _local22;
var _local13;
var _local20;
var _local21;
var _local7;
var _local19;
var _local18;
var _local43;
var _local44;
var _local40 = 50;
var _local35 = 1;
var _local34 = 0;
var _local25 = -0.15;
var _local24;
var _local23;
var _local16;
var _local14;
var _local45;
var _local29 = new Vector3d();
var _local30 = new Vector3d();
var _local6 = new Vector3d();
var _local15 = new Vector3d();
var _local17 = new Vector3d();
var _local8 = new Vector3d();
var _local39 = new Vector3d();
var _local2;
var _local3;
var _local4;
var _local5;
var _local9;
var _local10;
var _local11;
var _local12;
var _local26;
var _local37;
var _local31;
var _local33 = new flash.geom.ColorTransform();
var _local32 = new flash.geom.ColorTransform();
var _local27 = new flash.geom.Matrix();
var _local28 = new flash.geom.Matrix();
transform();
_local26 = bmp_in[0].width / cubeTiles;
_local37 = _local26 / 2;
mat_sf = 1 / _local26;
_local31 = new flash.geom.Point(mat_sf, mat_sf);
framecnt++;
_local35 = 0;
_local34 = -1;
cv._alpha = 100;
if (_local34 >= 0) {
cv2._alpha = blend * 100;
} else {
cv2._alpha = 0;
}
_local33.redOffset = colofs;
_local33.redMultiplier = colf;
_local33.greenOffset = _local33.redOffset;
_local33.greenMultiplier = _local33.redMultiplier;
_local33.blueOffset = _local33.redOffset;
_local33.blueMultiplier = _local33.redMultiplier;
_local33.alphaMultiplier = 1;
_local32.redOffset = colofs;
_local32.redMultiplier = colf;
_local32.greenOffset = _local32.redOffset;
_local32.greenMultiplier = _local32.redMultiplier;
_local32.blueOffset = _local32.redOffset;
_local32.blueMultiplier = _local32.redMultiplier;
_local32.alphaMultiplier = 1;
_local24 = rect.width;
_local16 = _local24 / 2;
_local23 = rect.height;
_local14 = _local23 / 2;
cv.clear();
_local18 = _local14 / Math.tan((fov.cur * 3.141593) / 360);
_local19 = 0;
while (_local19 < 6) {
if (_local19 == 0) {
_local2 = vat[0];
_local3 = vat[1];
_local4 = vat[2];
_local5 = vat[3];
}
if (_local19 == 1) {
_local2 = vat[1];
_local3 = vat[5];
_local4 = vat[3];
_local5 = vat[7];
}
if (_local19 == 2) {
_local2 = vat[5];
_local3 = vat[4];
_local4 = vat[7];
_local5 = vat[6];
}
if (_local19 == 3) {
_local2 = vat[4];
_local3 = vat[0];
_local4 = vat[6];
_local5 = vat[2];
}
if (_local19 == 4) {
_local2 = vat[4];
_local3 = vat[5];
_local4 = vat[0];
_local5 = vat[1];
}
if (_local19 == 5) {
_local2 = vat[2];
_local3 = vat[3];
_local4 = vat[6];
_local5 = vat[7];
}
_local22 = 0;
_local13 = 0;
if (((_local2.z <= _local3.z) && (_local2.z <= _local4.z)) && (_local2.z <= _local5.z)) {
_local22 = 0;
_local13 = 0;
}
if (((_local3.z <= _local2.z) && (_local3.z <= _local4.z)) && (_local3.z <= _local5.z)) {
_local22 = 1;
_local13 = 0;
}
if (((_local4.z <= _local2.z) && (_local4.z <= _local3.z)) && (_local4.z <= _local5.z)) {
_local22 = 0;
_local13 = 1;
}
if (((_local5.z <= _local2.z) && (_local5.z <= _local3.z)) && (_local5.z <= _local4.z)) {
_local22 = 1;
_local13 = 1;
}
_local6.interpol4(_local2, _local3, _local4, _local5, _local22, _local13);
_local15.interpol4(_local2, _local3, _local4, _local5, _local22 + 0.01, _local13);
_local17.interpol4(_local2, _local3, _local4, _local5, _local22, _local13 + 0.01);
_local8.interpol4(_local2, _local3, _local4, _local5, _local22 + 0.01, _local13 + 0.01);
_local6.project(_local18, _local16, _local14);
_local15.project(_local18, _local16, _local14);
_local17.project(_local18, _local16, _local14);
_local8.project(_local18, _local16, _local14);
_local29.x = _local6.px - _local15.px;
_local29.y = _local6.py - _local15.py;
_local30.x = _local6.px - _local17.px;
_local30.y = _local6.py - _local17.py;
if (((_local29.x * _local30.y) - (_local29.y * _local30.x)) > 0) {
_local22 = 0;
while (_local22 < cubeTiles) {
_local13 = 0;
while (_local13 < cubeTiles) {
_local7 = 1 / cubeTiles;
_local20 = _local22 * _local7;
_local21 = _local13 * _local7;
_local9 = _local6.interpol4proj(_local2, _local3, _local4, _local5, _local20, _local21, _local18, _local16, _local14);
_local10 = _local15.interpol4proj(_local2, _local3, _local4, _local5, _local20 + _local7, _local21, _local18, _local16, _local14);
_local11 = _local17.interpol4proj(_local2, _local3, _local4, _local5, _local20, _local21 + _local7, _local18, _local16, _local14);
_local12 = _local8.interpol4proj(_local2, _local3, _local4, _local5, _local20 + _local7, _local21 + _local7, _local18, _local16, _local14);
if ((((((((_local6.pz < _local25) && (_local15.pz < _local25)) && (_local17.pz < _local25)) && (_local8.pz < _local25)) && ((((_local9.x >= 0) || (_local10.x >= 0)) || (_local11.x >= 0)) || (_local12.x >= 0))) && ((((_local9.y >= 0) || (_local10.y >= 0)) || (_local11.y >= 0)) || (_local12.y >= 0))) && ((((_local9.x <= _local24) || (_local10.x <= _local24)) || (_local11.x <= _local24)) || (_local12.x <= _local24))) && ((((_local9.y <= _local23) || (_local10.y <= _local23)) || (_local11.y <= _local23)) || (_local12.y <= _local23))) {
calMatrixNew(new flash.geom.Point(_local22 * _local26, _local13 * _local26), _local31, _local9, _local10, _local12, _local11, _local27, _local28);
cv.beginBitmapFill(bmp_in[_local19], _local27, false, false);
cv.moveTo(_local6.px, _local6.py);
cv.lineTo(_local15.px, _local15.py);
cv.lineTo(_local8.px, _local8.py);
cv.endFill();
cv.beginBitmapFill(bmp_in[_local19], _local28, false, false);
cv.moveTo(_local6.px, _local6.py);
cv.lineTo(_local17.px, _local17.py);
cv.lineTo(_local8.px, _local8.py);
cv.endFill();
}
_local13++;
}
_local22++;
}
}
_local19++;
}
}
function DisplayTile(cf, sp, invTex, v1, v2, v3, v4, deep, splits) {
var _local21 = -0.01;
var _local19 = rect.width;
var _local20 = rect.height;
if (((((splits < 5) && (!isCylinder)) || ((splits < 2) && (isCylinder))) || ((((v1.pz < _local21) && (v2.pz < _local21)) && (v3.pz < _local21)) && (v4.pz < _local21))) && ((splits < 1) || (((((((v1.px >= 0) || (v2.px >= 0)) || (v3.px >= 0)) || (v4.px >= 0)) && ((((v1.py >= 0) || (v2.py >= 0)) || (v3.py >= 0)) || (v4.py >= 0))) && ((((v1.px <= _local19) || (v2.px <= _local19)) || (v3.px <= _local19)) || (v4.px <= _local19))) && ((((v1.py <= _local20) || (v2.py <= _local20)) || (v3.py <= _local20)) || (v4.py <= _local20))))) {
if (deep > 0) {
var _local23;
var _local2 = new Vector3d();
var _local3 = new Vector3d();
var _local22;
var _local15;
var _local13 = rect.width >> 1;
var _local14 = rect.height >> 1;
var _local10;
if (((deep & 1) == 0) || (isCylinder)) {
_local2.x = (v1.x + v3.x) * 0.5;
_local2.y = (v1.y + v3.y) * 0.5;
_local2.z = (_local2.pz = (v1.z + v3.z) * 0.5);
_local3.x = (v2.x + v4.x) * 0.5;
_local3.y = (v2.y + v4.y) * 0.5;
_local3.z = (_local3.pz = (v2.z + v4.z) * 0.5);
if (_local2.z < 0) {
_local10 = ((_local2.z > -1E-5) ? 10000 : ((-ed) / _local2.z));
_local2.px = (_local2.x * _local10) + _local13;
_local2.py = (_local2.y * _local10) + _local14;
} else {
_local2.px = (_local2.x * 1000) + _local13;
_local2.py = (_local2.y * 1000) + _local14;
}
if (_local3.z < 0) {
_local10 = ((_local3.z > -1E-5) ? 10000 : ((-ed) / _local3.z));
_local3.px = (_local3.x * _local10) + _local13;
_local3.py = (_local3.y * _local10) + _local14;
} else {
_local3.px = (_local3.x * 1000) + _local13;
_local3.py = (_local3.y * 1000) + _local14;
}
_local15 = new flash.geom.Point(invTex.x, invTex.y * 2);
_local22 = new flash.geom.Point(sp.x, sp.y + (1 / _local15.y));
DisplayTile(cf, sp, _local15, v1, v2, _local2, _local3, deep - 1, splits + 1);
DisplayTile(cf, _local22, _local15, _local2, _local3, v3, v4, deep - 1, splits + 1);
} else {
_local2.x = (v1.x + v2.x) * 0.5;
_local2.y = (v1.y + v2.y) * 0.5;
_local2.z = (_local2.pz = (v1.z + v2.z) * 0.5);
_local3.x = (v3.x + v4.x) * 0.5;
_local3.y = (v3.y + v4.y) * 0.5;
_local3.z = (_local3.pz = (v3.z + v4.z) * 0.5);
if (_local2.z < 0) {
_local10 = ((_local2.z > -1E-5) ? 10000 : ((-ed) / _local2.z));
_local2.px = (_local2.x * _local10) + _local13;
_local2.py = (_local2.y * _local10) + _local14;
} else {
_local2.px = (_local2.x * 1000) + _local13;
_local2.py = (_local2.y * 1000) + _local14;
}
if (_local3.z < 0) {
_local10 = ((_local3.z > -1E-5) ? 10000 : ((-ed) / _local3.z));
_local3.px = (_local3.x * _local10) + _local13;
_local3.py = (_local3.y * _local10) + _local14;
} else {
_local3.px = (_local3.x * 1000) + _local13;
_local3.py = (_local3.y * 1000) + _local14;
}
_local15 = new flash.geom.Point(invTex.x * 2, invTex.y);
_local22 = new flash.geom.Point(sp.x + (1 / _local15.x), sp.y);
DisplayTile(cf, sp, _local15, v1, _local2, v3, _local3, deep - 1, splits + 1);
DisplayTile(cf, _local22, _local15, _local2, v2, _local3, v4, deep - 1, splits + 1);
}
} else {
var _local9 = new flash.geom.Matrix();
var _local11 = new flash.geom.Matrix();
_local9.a = (v2.px - v1.px) * invTex.x;
_local9.c = (v4.px - v2.px) * invTex.y;
_local9.b = (v2.py - v1.py) * invTex.x;
_local9.d = (v4.py - v2.py) * invTex.y;
_local9.tx = (v1.px - (sp.x * _local9.a)) - (sp.y * _local9.c);
_local9.ty = (v1.py - (sp.x * _local9.b)) - (sp.y * _local9.d);
_local11.a = (v4.px - v3.px) * invTex.x;
_local11.c = (v3.px - v1.px) * invTex.y;
_local11.b = (v4.py - v3.py) * invTex.x;
_local11.d = (v3.py - v1.py) * invTex.y;
_local11.tx = (v1.px - (sp.x * _local11.a)) - (sp.y * _local11.c);
_local11.ty = (v1.py - (sp.x * _local11.b)) - (sp.y * _local11.d);
cv.beginBitmapFill(bmp_in[cf], _local9, false, bmpSmooth);
cv.moveTo(v1.px, v1.py);
cv.lineTo(v2.px, v2.py);
cv.lineTo(v4.px, v4.py);
cv.endFill();
cv.beginBitmapFill(bmp_in[cf], _local11, false, bmpSmooth);
cv.moveTo(v1.px, v1.py);
cv.lineTo(v3.px, v3.py);
cv.lineTo(v4.px, v4.py);
cv.endFill();
}
}
}
function doPaint() {
checkLimits();
if (isCylinder) {
paint_cylinder(1);
} else {
paint_cube(1);
}
}
function paint_cube(blend) {
var _local38;
var _local34;
var _local7;
var _local8;
var _local30;
var _local31;
var _local35;
var _local6;
var _local29;
var _local32;
var _local25 = 50;
var _local23 = 1;
var _local20 = 0;
var _local26 = -0.15;
var _local21;
var _local22;
var _local10;
var _local9;
var _local16;
var _local19;
var _local36;
var _local13 = new Vector3d();
var _local14 = new Vector3d();
var _local11 = new Vector3d();
var _local15 = new Vector3d();
var _local12 = new Vector3d();
var _local17 = new Vector3d();
var _local24 = new Vector3d();
var _local2;
var _local3;
var _local4;
var _local5;
var _local37;
var _local39;
var _local27;
var _local28;
var _local18;
if (cubeTiles < 2) {
cubeTiles = 2;
}
transform();
framecnt++;
_local23 = 0;
_local20 = -1;
cv._alpha = 100;
if (_local20 >= 0) {
cv2._alpha = blend * 100;
} else {
cv2._alpha = 0;
}
_local21 = rect.width;
_local10 = _local21 / 2;
_local22 = rect.height;
_local9 = _local22 / 2;
cv.clear();
ed = _local9 / Math.tan((fov.cur * 3.141593) / 360);
_local6 = 0;
while (_local6 < 6) {
_local16 = bmp_in[_local6].width;
_local19 = _local16 / 2;
mat_sf = 1 / _local16;
_local18 = new flash.geom.Point(mat_sf, mat_sf);
_local2 = vat[(_local6 * 4) + 0];
_local3 = vat[(_local6 * 4) + 1];
_local4 = vat[(_local6 * 4) + 2];
_local5 = vat[(_local6 * 4) + 3];
_local7 = 0;
_local8 = 0;
if (((_local2.z <= _local3.z) && (_local2.z <= _local4.z)) && (_local2.z <= _local5.z)) {
_local7 = 0;
_local8 = 0;
}
if (((_local3.z <= _local2.z) && (_local3.z <= _local4.z)) && (_local3.z <= _local5.z)) {
_local7 = 1;
_local8 = 0;
}
if (((_local4.z <= _local2.z) && (_local4.z <= _local3.z)) && (_local4.z <= _local5.z)) {
_local7 = 0;
_local8 = 1;
}
if (((_local5.z <= _local2.z) && (_local5.z <= _local3.z)) && (_local5.z <= _local4.z)) {
_local7 = 1;
_local8 = 1;
}
_local11.interpol4(_local2, _local3, _local4, _local5, _local7, _local8);
_local15.interpol4(_local2, _local3, _local4, _local5, _local7 + 0.01, _local8);
_local12.interpol4(_local2, _local3, _local4, _local5, _local7, _local8 + 0.01);
_local17.interpol4(_local2, _local3, _local4, _local5, _local7 + 0.01, _local8 + 0.01);
_local11.project(ed, _local10, _local9);
_local15.project(ed, _local10, _local9);
_local12.project(ed, _local10, _local9);
_local17.project(ed, _local10, _local9);
_local13.x = _local11.px - _local15.px;
_local13.y = _local11.py - _local15.py;
_local14.x = _local11.px - _local12.px;
_local14.y = _local11.py - _local12.py;
if (((_local13.x * _local14.y) - (_local13.y * _local14.x)) > 0) {
_local2.project(ed, _local10, _local9);
_local3.project(ed, _local10, _local9);
_local4.project(ed, _local10, _local9);
_local5.project(ed, _local10, _local9);
DisplayTile(_local6, new flash.geom.Point(0, 0), _local18, _local2, _local3, _local4, _local5, cubeTiles, 0);
}
_local6++;
}
}
function paint_cylinder(blend) {
var _local36;
var _local31;
var _local2;
var _local37;
var _local32;
var _local33;
var _local27;
var _local28;
var _local34;
var _local4;
var _local26;
var _local29;
var _local21 = 50;
var _local19 = 1;
var _local15 = 0;
var _local22 = -0.15;
var _local16;
var _local17;
var _local6;
var _local5;
var _local12;
var _local14;
var _local38;
var _local20 = new Vector3d();
var _local7;
var _local8;
var _local9;
var _local10;
var _local35;
var _local39;
var _local24;
var _local25;
var _local13;
if (cubeTiles < 2) {
cubeTiles = 2;
}
transform();
framecnt++;
_local19 = 0;
_local15 = -1;
cv._alpha = 100;
if (_local15 >= 0) {
cv2._alpha = blend * 100;
} else {
cv2._alpha = 0;
}
_local16 = rect.width;
_local6 = _local16 / 2;
_local17 = rect.height;
_local5 = _local17 / 2;
cv.clear();
ed = _local5 / Math.tan((fov.cur * 3.141593) / 360);
var _local18 = fov.cur / 2;
var _local23 = (Math.atan((rect.width / rect.height) * Math.tan((_local18 * 3.141593) / 180)) * 180) / 3.141593;
cylTilesX = cylTilesXBase / 1;
var _local11 = cylTilesXBase / cylTilesX;
_local4 = 0;
while (_local4 < cylTilesXS) {
_local12 = bmp_in[_local4].width;
_local14 = bmp_in[_local4].height;
mat_sf = 1 / _local12;
_local13 = new flash.geom.Point(cylTilesX / _local12, 1 / _local14);
_local2 = 0;
while (_local2 < cylTilesX) {
var _local3 = (((cylTilesX * _local4) * _local11) + _local2) * 4;
_local7 = vat[_local3];
_local9 = vat[_local3 + 2];
_local3 = (((((cylTilesX * _local4) * _local11) + _local2) + _local11) - 1) * 4;
_local8 = vat[_local3 + 1];
_local10 = vat[_local3 + 3];
if ((((_local7.z < 0) || (_local8.z < 0)) || (_local9.z < 0)) || (_local10.z < 0)) {
_local7.project(ed, _local6, _local5);
_local8.project(ed, _local6, _local5);
_local9.project(ed, _local6, _local5);
_local10.project(ed, _local6, _local5);
DisplayTile(_local4, new flash.geom.Point((_local2 * _local12) / cylTilesX, 0), _local13, _local7, _local8, _local9, _local10, cylTilesY, 0);
}
_local2++;
}
_local4++;
}
}
function changePan(a) {
if (!isNaN(a)) {
setPan(pan.cur + a);
}
}
function changeTilt(a) {
if (!isNaN(a)) {
setTilt(tilt.cur + a);
}
}
function changeFov(a) {
if (!isNaN(a)) {
setFov(fov.cur + a);
}
}
function setPan(a) {
if (!isNaN(a)) {
pan.cur = a;
}
checkLimits();
dirty = true;
}
function setTilt(a) {
if (!isNaN(a)) {
tilt.cur = a;
}
checkLimits();
dirty = true;
}
function setFov(a) {
if (!isNaN(a)) {
fov.cur = a;
}
checkLimits();
dirty = true;
}
function getPan() {
return(pan.cur);
}
function getTilt() {
return(tilt.cur);
}
function getFov() {
return(fov.cur);
}
function checkLimits() {
var _local2;
var _local3;
_local2 = fov.cur / 2;
if (_local2 > 55) {
_local2 = 55;
fov.cur = _local2 * 2;
}
_local3 = (Math.atan((rect.width / rect.height) * Math.tan((_local2 * 3.141593) / 180)) * 180) / 3.141593;
if (_local3 > 55) {
_local3 = 55;
_local2 = (Math.atan((rect.height / rect.width) * Math.tan((_local3 * 3.141593) / 180)) * 180) / 3.141593;
fov.cur = _local2 * 2;
}
if (fov.cur > fov.max) {
fov.cur = fov.max;
}
if (fov.cur < fov.min) {
fov.cur = fov.min;
}
if (fov.cur > (tilt.max - tilt.min)) {
fov.cur = tilt.max - tilt.min;
}
if (tilt.max < 90) {
if ((tilt.cur + _local2) > tilt.max) {
tilt.cur = tilt.max - _local2;
}
} else if (tilt.cur > tilt.max) {
tilt.cur = tilt.max;
}
if (tilt.min > -90) {
if ((tilt.cur - _local2) < tilt.min) {
tilt.cur = tilt.min + _local2;
}
} else if (tilt.cur < tilt.min) {
tilt.cur = tilt.min;
}
if ((pan.max - pan.min) < 359.99) {
var _local4 = 0;
if (tilt.cur != 0) {
var _local9;
var _local7;
var _local8 = rect.width / 2;
var _local6 = rect.height / 2;
_local9 = _local8 * Math.tan((_local3 * 3.141593) / 180);
_local7 = _local6 * Math.tan((_local2 * 3.141593) / 180);
var _local5 = _local6 / Math.tan((Math.abs(tilt.cur) * 3.141593) / 180);
_local5 = _local5 - _local7;
if (_local5 > 0) {
_local4 = (Math.atan(1 / (_local5 / _local7)) * 180) / 3.141593;
_local4 = (_local4 * (pan.max - pan.min)) / 360;
}
}
if ((pan.cur + (_local3 + _local4)) > pan.max) {
pan.cur = pan.max - (_local3 + _local4);
}
if ((pan.cur - (_local3 + _local4)) < pan.min) {
pan.cur = pan.min + (_local3 + _local4);
}
if ((tilt.cur + _local2) > tilt.max) {
tilt.cur = tilt.max - _local2;
}
if ((tilt.cur - _local2) < tilt.min) {
tilt.cur = tilt.min + _local2;
}
}
}
function setMeshDensity(dA) {
if (meshAuto) {
if (dA < 0.25) {
cubeTiles = meshBase;
cylTilesY = meshCylBase;
} else if (dA < 4) {
cubeTiles = meshBase - 1;
cylTilesY = meshCylBase - 1;
} else {
cubeTiles = meshBase - 2;
cylTilesY = meshCylBase - 2;
}
if (cubeTiles < 2) {
cubeTiles = 2;
}
if (cylTilesY < 2) {
cylTilesY = 2;
}
} else {
cubeTiles = meshBase;
cylTilesY = meshCylBase;
}
}
function doEnterFrame() {
if (((pan.cur == NaN) || (tilt.cur == NaN)) || (fov.cur == NaN)) {
pan.cur = 0;
tilt.cur = 0;
fov.cur = 70;
}
if (started) {
dA = 0;
if ((lastkeycode == 32) && (_global.krai == true)) {
_root.happyend.removeMovieClip();
_root.gameover.removeMovieClip();
_root.gotoAndPlay(1);
resetlastaction();
autoplay = false;
dPan = 0;
dTilt = 0;
}
trace(_global.otkaz);
if (_global.otkaz == false) {
if (turn) {
resetlastaction();
var _local4 = new Date();
mdownt = 100;
dTilt = (((-(bclip._ymouse - mdown.y)) * mdownt) * 1E-5) * fov.cur;
dPan = (((-(bclip._xmouse - mdown.x)) * mdownt) * 1E-5) * fov.cur;
dA = (dPan * dPan) + (dTilt * dTilt);
setMeshDensity(dA);
mdownt = _local4.getTime();
changeTilt(dTilt);
changePan(dPan);
dTiltm = dTiltm + dTilt;
if (dTiltm > 90) {
dTiltm = 90;
}
if (dTiltm < -90) {
dTiltm = 90;
}
dPanm = dPanm + dPan;
if (dPanm > 360) {
dPanm = dPanm - 360;
}
if (dPanm < -360) {
dPanm = dPanm + 360;
}
dirty = (dA != 0) || (cubeTiles != meshBase);
}
}
if (autorotate && (!autoplay)) {
var _local4 = new Date();
if (((_local4.getTime() - lastaction_dt) / 1000) > autorotate_timeout) {
autoplay = true;
}
}
if (autoplay && ((!autorotate_onlyinfocus) || (Main.isinfocus))) {
var _local5 = 0;
dTilt = (autorotate_tilt_force * (tilt.def - tilt.cur)) / 100;
_local5 = (autorotate_tilt_force * (fov.def - fov.cur)) / 100;
dPan = (dPan * 0.8) + ((-autorotate_pan) * 0.2);
dA = (dPan * dPan) + (dTilt * dTilt);
setMeshDensity(dA);
changeTilt(dTilt);
changePan(dPan);
changeFov(_local5);
dirty = true;
dTiltm = dTiltm + dTilt;
if (dTiltm > 90) {
dTiltm = 90;
}
if (dTiltm < -90) {
dTiltm = 90;
}
dPanm = dPanm + dPan;
if (dPanm > 360) {
dPanm = dPanm - 360;
}
if (dPanm < -360) {
dPanm = dPanm + 360;
}
}
if (((!key_down) && (!turn)) && (!autoplay)) {
dTilt = dTilt * 0.7;
dPan = dPan * 0.7;
dA = (dPan * dPan) + (dTilt * dTilt);
if (dA < 0.01) {
setMeshDensity(0);
if (dA > 0) {
dirty = true;
}
dTilt = 0;
dPan = 0;
} else {
setMeshDensity(dA);
changeTilt(dTilt);
changePan(dPan);
dirty = true;
}
}
if (dA < 0.01) {
bmpSmooth = true;
cv._quality = Main.qualityStatic;
cv2._quality = Main.qualityStatic;
} else {
cv2._quality = Main.qualityMotion;
cv._quality = Main.qualityMotion;
}
if (dirty) {
doPaint();
dirty = false;
}
}
_root.aaa._y = 200 + ((tilt.cur * 2) * 3.141593);
if (pan.cur > 180) {
pan.cur = pan.cur - 360;
}
if (pan.cur < -180) {
pan.cur = pan.cur + 360;
}
_aaa = 300 + ((pan.cur * 2) * 3.141593);
_root.aaa._x = _aaa;
}
function transform() {
var _local4;
var _local5;
var _local7;
var _local2;
var _local3;
var _local6;
var _local8 = new Matrix4d();
var _local9 = new Matrix4d();
_local8.setRotX((((-tilt.cur) * 2) * 3.141593) / 360);
_local9.setRotY(((pan.cur * 2) * 3.141593) / 360);
_local6 = Matrix4d.multiply(_local8, _local9);
_local7 = (rect.height / 2) / Math.tan((fov.cur * 3.141593) / 360);
vat = new Array();
_local4 = 0;
while (_local4 < va.length) {
_local2 = va[_local4];
_local3 = new Vector3d();
_local6.mulVector(_local2, _local3);
vat.push(_local3);
_local2.pz = _local3.z;
if (_local2.pz < 0) {
_local5 = _local7 / _local3.z;
if (_local3.z > -1E-5) {
_local5 = 10000;
}
_local2.px = _local3.x * _local5;
_local2.py = (-_local3.y) * _local5;
_local2.px = _local2.px + (rect.width / 2);
_local2.py = _local2.py + (rect.height / 2);
} else {
_local2.px = _local3.x * 1000;
_local2.py = (-_local3.y) * 1000;
}
_local4++;
}
updateHotspots(_local6);
if (enable_callback) {
if (onRotate != undefined) {
onRotate(pan.cur, tilt.cur, fov.cur);
}
}
}
function hide() {
cv._alpha = 0;
cv2._alpha = 0;
}
function updateHotspots(m) {
var _local4;
var _local5 = new Vector3d();
var _local3;
var _local2;
var _local6;
_local6 = (rect.height / 2) / Math.tan((fov.cur * 3.141593) / 360);
_local4 = 0;
while (_local4 < hotspots.length) {
_local2 = hotspots[_local4];
_local5.init(0, 0, -1);
_local5.rotx((_local2.posTilt * 3.141593) / 180);
_local5.roty(((-_local2.posPan) * 3.141593) / 180);
_local3 = new Vector3d();
m.mulVector(_local5, _local3);
_local3.project(_local6, rect.width / 2, rect.height / 2);
_local2.clip._visible = _local3.pz < 0;
_local2.clip._x = _local2.ofs.x + _local3.px;
_local2.clip._y = _local2.ofs.y + _local3.py;
_local4++;
}
}
function doMouseDown() {
mdown.x = bclip._xmouse;
mdown.y = bclip._ymouse;
if (Main.isinfocus) {
bclip._focusrect = false;
Selection.setFocus(bclip);
turn = true;
autoplay = false;
}
}
function doMouseWheel(delta) {
changeFov(delta / 3);
autoplay = false;
resetlastaction();
}
function doMouseUp() {
if (turn) {
turn = false;
dirty = true;
}
}
function addHotspot(aid, apan, atilt, aclip, url, target) {
var _local2 = new Hotspot();
_local2.id = aid;
_local2.posPan = apan;
_local2.posTilt = atilt;
_local2.clip = aclip;
_local2.url = url;
_local2.target = target;
if (hs_local == 1) {
_local2.ofs.x = 0;
_local2.ofs.y = 0;
} else {
_local2.ofs.x = bclip._x;
_local2.ofs.y = bclip._y;
}
aclip._visible = false;
hotspots.push(_local2);
}
function addClickHotspot(aid, apan, atilt, hstext) {
var _local4 = _root.createEmptyMovieClip("hs_mc", _root.getNextHighestDepth());
var _local3 = _local4.attachMovie("hs_textmc", aid, _local4.getNextHighestDepth());
_local3.hstext.text = hstext;
_local3.hstext._visible = false;
if (enable_callback) {
_local3.onRelease = function () {
Main.doClickHotspot(this._name);
};
_local3.onRollOver = function () {
Main.doRollOverHotspot(this._name);
hstext._visible = true;
};
_local3.onRollOut = function () {
Main.doRollOutHotspot(this._name);
hstext._visible = false;
};
}
addHotspot(aid, apan, atilt, _local3);
}
function addUrlHotspot(aid, apan, atilt, hstext, url, target) {
var _local4 = _root.createEmptyMovieClip("hs_mc", _root.getNextHighestDepth());
var _local3 = _local4.attachMovie("hs_textmc", aid, _local4.getNextHighestDepth());
_local3.hstext.text = hstext;
_local3.hstext._visible = false;
if (enable_callback) {
_local3.onRelease = function () {
var _local3;
_local3 = Main.findHotspot(this._name);
if (_local3 != null) {
_root.getURL(_local3.url, _local3.target);
}
};
_local3.onRollOver = function () {
var _local1;
hstext._visible = true;
};
_local3.onRollOut = function () {
Main.doRollOutHotspot(this._name);
hstext._visible = false;
};
}
addHotspot(aid, apan, atilt, _local3, url, target);
}
function addTextHotspot(aid, apan, atilt, hstext) {
var _local4 = _root.createEmptyMovieClip("hs_mc", _root.getNextHighestDepth());
var _local3 = _local4.attachMovie("hs_textmc", aid, _local4.getNextHighestDepth());
_local3.hstext.text = hstext;
_local3.hstext._visible = false;
_local3.useHandCursor = false;
if (enable_callback) {
_local3.onRelease = function () {
Main.doClickHotspot(this._name);
};
_local3.onRollOver = function () {
Main.doRollOverHotspot(this._name);
hstext._visible = true;
};
_local3.onRollOut = function () {
Main.doRollOutHotspot(this._name);
hstext._visible = false;
};
}
addHotspot(aid, apan, atilt, _local3);
}
function initHotspots() {
var _local3 = _root.createEmptyMovieClip("mmmc", _root.getNextHighestDepth());
var _local4 = _local3.attachMovie("hs_target", "hs1", _local3.getNextHighestDepth());
var _local5 = _local4.transform.matrix;
_local5.scale(5, 5);
_local4.transform.matrix = _local5;
_local3.onRelease = function () {
};
_local3.play();
_local3.enabled = true;
addHotspot("id1", 0, 0, _local3);
addUrlHotspot("test", 10, 10, "testurl", "http://sinnfrei.at", "_blank");
addClickHotspot("test", 10, 10, "testurl");
}
function unloadHotspots() {
var _local2;
var _local3;
_local2 = 0;
while (_local2 < hotspots.length) {
_local3 = hotspots[_local2];
_local3.clip.unloadMovie();
_local2++;
}
}
function addController(ctrlUrl, pos, alpha) {
var cclip = bclip.createEmptyMovieClip("cclip", 10000);
var _local6;
cclip._visible = false;
cclip._lockroot = true;
cclip._alpha = controllerAlpha;
if ((pos >= 0) && (pos <= 8)) {
controllerPos = pos;
}
if (alpha > 0) {
controllerAlpha = alpha;
}
var _local3 = new MovieClipLoader();
var _local2 = new Object();
_local2.onLoadInit = function () {
cclip.playerControl = Main.controller_callback;
cclip._visible = true;
Main.doReposElements();
};
_local3.addListener(_local2);
_local3.loadClip(ctrlUrl, cclip);
}
function setPanLimits(vmin, vmax) {
pan.min = vmin;
pan.max = vmax;
checkLimits();
}
function setTiltLimits(vmin, vmax) {
tilt.min = vmin;
tilt.max = vmax;
checkLimits();
}
function setFovLimits(vmin, vmax) {
fov.min = vmin;
fov.max = vmax;
checkLimits();
}
function isComplete() {
return(completed);
}
function controller(id, v) {
return(Main.controller_callback(id, v));
}
function setAutorotate(vSpeed, vDelay, vReturnToH, vFocus) {
autorotate_pan = vSpeed;
autorotate = vSpeed != 0;
if (!isNaN(vDelay)) {
autorotate_timeout = vDelay;
}
if (!isNaN(vReturnToH)) {
autorotate_tilt_force = vReturnToH;
}
autorotate_onlyinfocus = vFocus == true;
if (vSpeed == 0) {
autoplay = false;
}
}
var meshBase = 8;
var meshCylBase = 6;
var meshAuto = true;
var cylinderImageWidth = 0;
var cylinderImageHeight = 0;
var key_down = false;
var initMovClip = true;
var controllerFlags = "";
}
Symbol 208 MovieClip [__Packages.PanoViewLimits] Frame 0
class PanoViewLimits
{
var def, min, max, cur;
function PanoViewLimits (def, min, max) {
init(def, min, max);
}
function init(def, min, max) {
this.def = def;
this.min = min;
this.max = max;
cur = def;
}
}
Symbol 209 MovieClip [__Packages.Vector3d] Frame 0
class Vector3d
{
var x, y, z, u, v, pz, px, py;
function Vector3d (ix, iy, iz, iu, iv) {
x = ix;
y = iy;
z = iz;
u = iu;
v = iv;
}
function init(ix, iy, iz) {
x = ix;
y = iy;
z = iz;
}
function rotx(a) {
var _local4;
var _local5;
var _local3;
var _local2;
_local2 = Math.sin(a);
_local3 = Math.cos(a);
_local4 = (_local3 * y) + (_local2 * z);
_local5 = ((-_local2) * y) + (_local3 * z);
y = _local4;
z = _local5;
}
function roty(a) {
var _local4;
var _local5;
var _local3;
var _local2;
_local2 = Math.sin(a);
_local3 = Math.cos(a);
_local4 = (_local3 * x) - (_local2 * z);
_local5 = (_local2 * x) + (_local3 * z);
x = _local4;
z = _local5;
}
function rotz(a) {
var _local4;
var _local5;
var _local3;
var _local2;
_local2 = Math.sin(a);
_local3 = Math.cos(a);
_local4 = (_local3 * x) - (_local2 * y);
_local5 = (_local2 * x) + (_local3 * y);
x = _local4;
y = _local5;
}
function sub(v) {
var _local2 = new Vector3d();
_local2.x = x - v.x;
_local2.y = y - v.y;
_local2.z = z - v.z;
return(_local2);
}
function project(ed, ofsx, ofsy) {
var _local2;
pz = z;
if (z < 0) {
_local2 = (-ed) / z;
if (Math.abs(z) < 1E-5) {
_local2 = ((z > 0) ? -10000 : 10000);
}
px = x * _local2;
py = y * _local2;
px = px + ofsx;
py = py + ofsy;
} else {
px = x * 1000;
py = y * 1000;
}
}
function asPoint() {
var _local2 = new flash.geom.Point();
_local2.x = px;
_local2.y = py;
return(_local2);
}
function cp(v) {
v.x = x;
v.y = y;
v.z = z;
v.px = px;
v.py = py;
}
function pdist2(v) {
return(((v.px - px) * (v.px - px)) + ((v.py - py) * (v.py - py)));
}
function interpol2(a, b, s) {
x = (a.x * s) + (b.x * (1 - s));
y = (a.y * s) + (b.y * (1 - s));
z = (a.z * s) + (b.z * (1 - s));
}
function interpol2proj(a, b, s, ed, ofsx, ofsy) {
var _local2 = 1 - s;
var _local3;
x = (a.x * s) + (b.x * _local2);
y = (a.y * s) + (b.y * _local2);
z = (a.z * s) + (b.z * _local2);
pz = z;
if (z < 0) {
if (z > -1E-5) {
_local3 = 10000;
} else {
_local3 = (-ed) / z;
}
px = (x * _local3) + ofsx;
py = (y * _local3) + ofsy;
} else {
px = x * 1000;
py = y * 1000;
}
}
function interpol4(a, b, c, d, u, v) {
x = (((a.x * (1 - u)) + (b.x * u)) * (1 - v)) + (((c.x * (1 - u)) + (d.x * u)) * v);
y = (((a.y * (1 - u)) + (b.y * u)) * (1 - v)) + (((c.y * (1 - u)) + (d.y * u)) * v);
z = (((a.z * (1 - u)) + (b.z * u)) * (1 - v)) + (((c.z * (1 - u)) + (d.z * u)) * v);
}
function interpol4proj(a, b, c, d, u, v, ed, ofsx, ofsy) {
var _local2 = 1 - u;
var _local4 = 1 - v;
var _local5;
x = (((a.x * _local2) + (b.x * u)) * _local4) + (((c.x * _local2) + (d.x * u)) * v);
y = (((a.y * _local2) + (b.y * u)) * _local4) + (((c.y * _local2) + (d.y * u)) * v);
z = (((a.z * _local2) + (b.z * u)) * _local4) + (((c.z * _local2) + (d.z * u)) * v);
pz = z;
if (z < 0) {
if (z > -1E-5) {
_local5 = 10000;
} else {
_local5 = (-ed) / z;
}
px = (x * _local5) + ofsx;
py = (y * _local5) + ofsy;
} else {
px = x * 1000;
py = y * 1000;
}
return(new flash.geom.Point(px, py));
}
function toString() {
return(((((((((("(" + x) + ",") + y) + ",") + z) + ") - (") + px) + ",") + py) + ")");
}
}
Symbol 210 MovieClip [__Packages.Matrix4d] Frame 0
class Matrix4d
{
var n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44;
function Matrix4d () {
setIdent();
}
function setIdent() {
n11 = 1;
n12 = 0;
n13 = 0;
n14 = 0;
n21 = 0;
n22 = 1;
n23 = 0;
n24 = 0;
n31 = 0;
n32 = 0;
n33 = 1;
n34 = 0;
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
}
function setRotX(a) {
var _local3 = Math.cos(a);
var _local2 = Math.sin(a);
n11 = 1;
n12 = 0;
n13 = 0;
n14 = 0;
n21 = 0;
n22 = _local3;
n23 = _local2;
n24 = 0;
n31 = 0;
n32 = -_local2;
n33 = _local3;
n34 = 0;
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
}
function setRotY(a) {
var _local3 = Math.cos(a);
var _local2 = Math.sin(a);
n11 = _local3;
n12 = 0;
n13 = -_local2;
n14 = 0;
n21 = 0;
n22 = 1;
n23 = 0;
n24 = 0;
n31 = _local2;
n32 = 0;
n33 = _local3;
n34 = 0;
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
}
function setRotZ(a) {
var _local3 = Math.cos(a);
var _local2 = Math.sin(a);
n11 = _local3;
n12 = _local2;
n13 = 0;
n14 = 0;
n21 = -_local2;
n22 = _local3;
n23 = 0;
n24 = 0;
n31 = 0;
n32 = 0;
n33 = 1;
n34 = 0;
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
}
function setScale(s) {
n11 = s;
n12 = 0;
n13 = 0;
n14 = 0;
n21 = 0;
n22 = s;
n23 = 0;
n24 = 0;
n31 = 0;
n32 = 0;
n33 = s;
n34 = 0;
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
}
static function multiply(m1, m2) {
var _local3 = new Matrix4d();
var _local33;
var _local25;
var _local23;
var _local30;
var _local7;
var _local13;
var _local34;
var _local27;
var _local10;
var _local28;
var _local4;
var _local8;
var _local17;
var _local35;
var _local9;
var _local31;
var _local32;
var _local5;
var _local15;
var _local29;
var _local20;
var _local16;
var _local22;
var _local6;
var _local14;
var _local26;
var _local19;
var _local11;
var _local21;
var _local18;
var _local24;
var _local12;
_local33 = m1.n11;
_local25 = m2.n11;
_local10 = m1.n12;
_local30 = m2.n21;
_local32 = m1.n13;
_local13 = m2.n31;
_local14 = m1.n14;
_local27 = m2.n41;
_local3.n11 = (((m1.n11 * m2.n11) + (m1.n12 * m2.n21)) + (m1.n13 * m2.n31)) + (m1.n14 * m2.n41);
_local28 = m2.n12;
_local8 = m2.n22;
_local35 = m2.n32;
_local31 = m2.n42;
_local3.n12 = (((_local33 * m2.n12) + (_local10 * m2.n22)) + (_local32 * m2.n32)) + (_local14 * m2.n42);
_local5 = m2.n13;
_local29 = m2.n23;
_local16 = m2.n33;
_local6 = m2.n43;
_local3.n13 = (((_local33 * m2.n13) + (_local10 * m2.n23)) + (_local32 * m2.n33)) + (_local14 * m2.n43);
_local26 = m2.n14;
_local11 = m2.n24;
_local18 = m2.n34;
_local12 = m2.n44;
_local3.n14 = (((_local33 * m2.n14) + (_local10 * m2.n24)) + (_local32 * m2.n34)) + (_local14 * m2.n44);
_local23 = m1.n21;
_local4 = m1.n22;
_local15 = m1.n23;
_local19 = m1.n24;
_local3.n21 = (((m1.n21 * _local25) + (m1.n22 * _local30)) + (m1.n23 * _local13)) + (m1.n24 * _local27);
_local3.n22 = (((_local23 * _local28) + (_local4 * _local8)) + (_local15 * _local35)) + (_local19 * _local31);
_local3.n23 = (((_local23 * _local5) + (_local4 * _local29)) + (_local15 * _local16)) + (_local19 * _local6);
_local3.n24 = (((_local23 * _local26) + (_local4 * _local11)) + (_local15 * _local18)) + (_local19 * _local12);
_local7 = m1.n31;
_local17 = m1.n32;
_local20 = m1.n33;
_local21 = m1.n34;
_local3.n31 = (((m1.n31 * _local25) + (m1.n32 * _local30)) + (m1.n33 * _local13)) + (m1.n34 * _local27);
_local3.n32 = (((_local7 * _local28) + (_local17 * _local8)) + (_local20 * _local35)) + (_local21 * _local31);
_local3.n33 = (((_local7 * _local5) + (_local17 * _local29)) + (_local20 * _local16)) + (_local21 * _local6);
_local3.n34 = (((_local7 * _local26) + (_local17 * _local11)) + (_local20 * _local18)) + (_local21 * _local12);
_local34 = m1.n41;
_local9 = m1.n42;
_local22 = m1.n43;
_local24 = m1.n44;
_local3.n41 = (((m1.n41 * _local25) + (m1.n42 * _local30)) + (m1.n43 * _local13)) + (m1.n44 * _local27);
_local3.n42 = (((_local34 * _local28) + (_local9 * _local8)) + (_local22 * _local35)) + (_local24 * _local31);
_local3.n43 = (((_local34 * _local5) + (_local9 * _local29)) + (_local22 * _local16)) + (_local24 * _local6);
_local3.n44 = (((_local34 * _local26) + (_local9 * _local11)) + (_local22 * _local18)) + (_local24 * _local12);
return(_local3);
}
function mulVector(v, w) {
w.x = ((v.x * n11) + (v.y * n12)) + (v.z * n13);
w.y = ((v.x * n21) + (v.y * n22)) + (v.z * n23);
w.z = ((v.x * n31) + (v.y * n32)) + (v.z * n33);
}
function toString() {
var _local2 = new String("Matrix(\n");
_local2 = _local2 + (((((((n11 + "\t") + n12) + "\t") + n13) + "\t") + n14) + newline);
_local2 = _local2 + (((((((n21 + "\t") + n22) + "\t") + n23) + "\t") + n24) + newline);
_local2 = _local2 + (((((((n31 + "\t") + n32) + "\t") + n33) + "\t") + n34) + newline);
_local2 = _local2 + (((((((n41 + "\t") + n42) + "\t") + n43) + "\t") + n44) + ")\n");
return(_local2);
}
}
Symbol 211 MovieClip [__Packages.Hotspot] Frame 0
class Hotspot
{
var ofs;
function Hotspot () {
ofs = new flash.geom.Point();
}
}
Symbol 194 MovieClip Frame 1
maxlight = "30";
dxstep = "0.1";
dx = "0.5";
setProperty("li0", _visible , "1");
Symbol 194 MovieClip Frame 2
i = "1";
while (Number(i) <= Number(maxlight)) {
duplicateMovieClip ("li0", "li" + i, i);
setProperty("li" + i, _xscale , getProperty("li" + (i - 1), _xscale) + (i * 0.3));
setProperty("li" + i, _yscale , getProperty("li" + (i - 1), _yscale) + (i * 0.3));
setProperty("li" + i, _alpha , 20 - (i * 0.2));
setProperty("li" + i, _x , getProperty("li" + (i - 1), _x) + (i * dx));
i = Number(i) + 1;
}
Symbol 194 MovieClip Frame 3
dx = dx - dxstep;
if ((Number(dx) > 0.5) or (Number(dx) < Number(-0.5))) {
dxstep = -dxstep;
}
i = 1;
while (Number(i) <= Number(maxlight)) {
setProperty("li" + i, _x , getProperty("li" + (i - 1), _x) + (i * dx));
setProperty("li" + i, _y , getProperty("li" + (i - 1), _y) + ((i * dx) / 20));
i = Number(i) + 1;
}
Symbol 194 MovieClip Frame 4
gotoAndPlay(_currentframe - 1);
Symbol 196 Button
on (rollOver) {
this._parent.menu.text = "Press Start button to play";
}
on (rollOut) {
this._parent.menu.text = "";
}
on (press) {
_root.attachMovie("symphony", "symphony", 1);
_root.intro.steam.gotoAndPlay(2);
this._parent._visible = false;
}
Symbol 197 Button
on (rollOver) {
this._parent.menu.text = "Once upon a time there were a three dancing fairies. They lived in a castle in Nottinghamshire. One day, an old witch came. She cast a spell on them turning them into demon statues...";
}
on (rollOut) {
this._parent.menu.text = "";
}
Symbol 199 Button
on (rollOver) {
this._parent.menu.text = "Three Dancing Fairies is an educational fun math game. The game has 3 levels of difficulty and exercises for Addition. Objective of the game is to answer correctly all given excercises, as fast as possible.";
}
on (rollOut) {
this._parent.menu.text = "";
}
Symbol 200 Button
on (rollOver) {
this._parent.menu.text = "Developed for FLASHLOADED.HIT.BG. Click the CREDITS button to visit the site.";
}
on (rollOut) {
this._parent.menu.text = "";
}
on (press) {
getURL ("http://flashloaded.hit.bg", "_blank");
}
Symbol 201 Button
on (rollOver) {
this._parent.menu.text = "Use the mouse to move the cursor. Left click and hold down the mouse button to move the camera around. To get started click the Start button on the scroll and start entering solutions. It will automatically submit if the solution is correct.The timer will start after the first question.";
}
on (rollOut) {
this._parent.menu.text = "";
}
Symbol 205 MovieClip Frame 1
_global.otkaz = true;
Symbol 205 MovieClip Frame 20
stop();