Section 1
//MainTimeline (flash3dpano_empty_fla.MainTimeline)
package flash3dpano_empty_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.text.*;
import flash.media.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
import flash.utils.*;
public dynamic class MainTimeline extends MovieClip {
public var menuItem:ContextMenuItem;
public var skin2:SkinClass;
public var sprite_anchor:Array;
public var video:VideoPanoClass;
public var sprite_y:Array;
public var skin:SkinClass;
public var pano:PanoCube;
public var customContextMenu:ContextMenu;
public var skinstr:String;
public var prestr:String;
public var sprite_x:Array;
public var pre:PreloaderClass;
public var sprite_enabled:Array;
public var videostr:String;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 9, frame10);
}
public function attachVideo(_arg1:String){
var str = _arg1;
try {
video = new VideoPanoClass(pano);
video.xmlConfig(new XML(str));
skin.video = video;
if (skin2){
skin2.video = video;
};
} catch(error:Error) {
};
}
function frame10(){
removeEventListener(Event.ENTER_FRAME, doEnterFrame);
pano.init_faces();
pre.cleanup();
removeChild(pre);
stop();
}
function frame1(){
try {
if (stage){
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
};
} catch(err:Error) {
};
sprite_x = new Array();
sprite_y = new Array();
sprite_anchor = new Array();
sprite_enabled = new Array();
pano = new PanoCube();
addChild(pano);
try {
if (stage){
pano.windowWidth = stage.stageWidth;
pano.windowHeight = stage.stageHeight;
};
} catch(err:Error) {
};
panoramastr = "<panorama>\n<view>\n<start pan=\"128.5\" tilt=\"10\" fov=\"70\"/>\n<min pan=\"0\" tilt=\"-90\" fov=\"5\"/>\n<max pan=\"360\" tilt=\"90\" fov=\"120\"/>\n</view><display width=\"720\" height=\"500\" quality=\"9\" changemotionquality=\"1\" changestagequality=\"1\" smoothing=\"1\" scalemode=\"stage\" />\n<input tilesize=\"1000\" order=\"324501\" ><preview images=\"1\" color=\"0x808080\"/></input><control sensitifity=\"8\" simulatemass=\"1\" locked=\"0\" /><cursor ownonmovement=\"1\" ownondefault=\"1\" /><qthotspots>\n<label width=\"0\" height=\"1\" movement=\"1\" textcolor=\"0x000000\" background=\"1\" backgroundcolor=\"0xffffff\" border=\"1\" bordercolor=\"0x000000\" /><hotspot id=\"1\" title=\"test\" url=\"\" target=\"\" />\n</qthotspots></panorama>";
pano.xmlConfig(new XML(panoramastr));
if (root.loaderInfo.parameters.panorama){
pano.xmlConfig(new XML(root.loaderInfo.parameters.panorama));
};
prestr = "<preloader anchor=\"0\" hideabout=\"1\" width=\"720\" height=\"500\"><bar x=\"10\" y=\"30\" width=\"180\" height=\"10\" color=\"0xff5500\" alpha=\"0.878431\" bgcolor=\"0xffffff\" bgalpha=\"0.501961\" /><text x=\"10\" y=\"10\" color=\"0xff5500\" alpha=\"1\" /></preloader>";
if (root.loaderInfo.parameters.preload){
prestr = root.loaderInfo.parameters.preload;
};
pre = new PreloaderClass(new XML(prestr));
addChild(pre);
addEventListener(Event.ENTER_FRAME, doEnterFrame);
skin = new SkinClass(pano);
skinstr = "<skin><element x=\"-45\" y=\"-40\" width=\"32\" height=\"32\" anchor=\"8\" btn=\"skin_0\" >\n<action type=\"10\" value=\"\" value2=\"\" />\n</element></skin>";
if (root.loaderInfo.parameters.skin){
skinstr = root.loaderInfo.parameters.skin;
};
try {
skin.xmlConfig(new XML(skinstr));
} catch(error:Error) {
};
addChild(skin);
if (root.loaderInfo.parameters.skin2){
try {
skin2 = new SkinClass(pano);
skin2.xmlConfig(new XML(root.loaderInfo.parameters.skin2));
addChild(skin2);
} catch(error:Error) {
};
};
customContextMenu = new ContextMenu();
customContextMenu.hideBuiltInItems();
if (root.loaderInfo.parameters.hideabout){
pre.showAboutPano2VR = !((root.loaderInfo.parameters.hideabout == 1));
};
if (pre.showAboutPano2VR){
menuItem = new ContextMenuItem("About Pano2VR Player...");
menuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, about);
customContextMenu.customItems.push(menuItem);
};
contextMenu = customContextMenu;
if (root.loaderInfo.parameters.pan){
pano.setPan(root.loaderInfo.parameters.pan);
};
if (root.loaderInfo.parameters.tilt){
pano.setTilt(root.loaderInfo.parameters.tilt);
};
if (root.loaderInfo.parameters.fov){
pano.setFov(root.loaderInfo.parameters.fov);
};
videostr = "<video></video>";
if (root.loaderInfo.parameters.video){
videostr = root.loaderInfo.parameters.video;
attachVideo(videostr);
};
}
function frame2(){
}
public function doEnterFrame(_arg1:Event):void{
if (currentFrame >= 2){
pano.init_faces();
};
}
public function about(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://gardengnomesoftware.com/pano2vr");
navigateToURL(_local2, "_blank");
}
}
}//package flash3dpano_empty_fla
Section 2
//CursorDataClass (CursorDataClass)
package {
import flash.display.*;
public dynamic class CursorDataClass extends BitmapData {
public function CursorDataClass(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 3
//Hotspot (Hotspot)
package {
import flash.display.*;
import flash.geom.*;
public class Hotspot {
var onCallback:Function;
var posPan:Number;
var clip:MovieClip;
var posTilt:Number;
var target:String;
var id:String;
var ofs:Point;
var url:String;
var title:String;
public function Hotspot(){
ofs = new Point();
}
}
}//package
Section 4
//HotspotImageClass (HotspotImageClass)
package {
import flash.display.*;
public dynamic class HotspotImageClass extends BitmapData {
public function HotspotImageClass(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 5
//HotspotTile0Class (HotspotTile0Class)
package {
import flash.display.*;
public dynamic class HotspotTile0Class extends BitmapData {
public function HotspotTile0Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 6
//HotspotTile1Class (HotspotTile1Class)
package {
import flash.display.*;
public dynamic class HotspotTile1Class extends BitmapData {
public function HotspotTile1Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 7
//ImageRepository (ImageRepository)
package {
import flash.display.*;
public class ImageRepository {
public function getImage(_arg1:String):BitmapData{
if (_arg1 == "skin_0"){
return (new ReposImage_skin_0Class(0, 0));
};
return (new BitmapData(16, 16));
}
}
}//package
Section 8
//Matrix4d (Matrix4d)
package {
public class Matrix4d {
private var n31:Number;
private var n32:Number;
private var n11:Number;
private var n13:Number;
private var n14:Number;
private var n33:Number;
private var n12:Number;
private var n42:Number;
private var n21:Number;
private var n22:Number;
private var n23:Number;
private var n24:Number;
private var n34:Number;
private var n41:Number;
private var n43:Number;
private var n44:Number;
public function Matrix4d(){
setIdent();
}
public function setScale(_arg1:Number):void{
n11 = _arg1;
n12 = 0;
n13 = 0;
n14 = 0;
n21 = 0;
n22 = _arg1;
n23 = 0;
n24 = 0;
n31 = 0;
n32 = 0;
n33 = _arg1;
n34 = 0;
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
}
public function setRotZ(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
n11 = _local2;
n12 = _local3;
n13 = 0;
n14 = 0;
n21 = -(_local3);
n22 = _local2;
n23 = 0;
n24 = 0;
n31 = 0;
n32 = 0;
n33 = 1;
n34 = 0;
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
}
public function setRotY(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
n11 = _local2;
n12 = 0;
n13 = -(_local3);
n14 = 0;
n21 = 0;
n22 = 1;
n23 = 0;
n24 = 0;
n31 = _local3;
n32 = 0;
n33 = _local2;
n34 = 0;
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
}
public function setRotX(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
n11 = 1;
n12 = 0;
n13 = 0;
n14 = 0;
n21 = 0;
n22 = _local2;
n23 = _local3;
n24 = 0;
n31 = 0;
n32 = -(_local3);
n33 = _local2;
n34 = 0;
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
}
public function toString():String{
var _local1:String;
_local1 = new String("Matrix(\n");
_local1 = (_local1 + (((((((n11 + "\t") + n12) + "\t") + n13) + "\t") + n14) + "\n"));
_local1 = (_local1 + (((((((n21 + "\t") + n22) + "\t") + n23) + "\t") + n24) + "\n"));
_local1 = (_local1 + (((((((n31 + "\t") + n32) + "\t") + n33) + "\t") + n34) + "\n"));
_local1 = (_local1 + (((((((n41 + "\t") + n42) + "\t") + n43) + "\t") + n44) + ")\n"));
return (_local1);
}
public function setIdent():void{
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;
}
public function mulVector(_arg1:Vector3d, _arg2:Vector3d):void{
_arg2.x = (((_arg1.x * n11) + (_arg1.y * n12)) + (_arg1.z * n13));
_arg2.y = (((_arg1.x * n21) + (_arg1.y * n22)) + (_arg1.z * n23));
_arg2.z = (((_arg1.x * n31) + (_arg1.y * n32)) + (_arg1.z * n33));
}
public static function multiply(_arg1:Matrix4d, _arg2:Matrix4d):Matrix4d{
var _local3:Matrix4d;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
_local3 = new (Matrix4d);
_local4 = _arg1.n11;
_local5 = _arg2.n11;
_local12 = _arg1.n12;
_local7 = _arg2.n21;
_local20 = _arg1.n13;
_local9 = _arg2.n31;
_local28 = _arg1.n14;
_local11 = _arg2.n41;
_local3.n11 = ((((_local4 * _local5) + (_local12 * _local7)) + (_local20 * _local9)) + (_local28 * _local11));
_local13 = _arg2.n12;
_local15 = _arg2.n22;
_local17 = _arg2.n32;
_local19 = _arg2.n42;
_local3.n12 = ((((_local4 * _local13) + (_local12 * _local15)) + (_local20 * _local17)) + (_local28 * _local19));
_local21 = _arg2.n13;
_local23 = _arg2.n23;
_local25 = _arg2.n33;
_local27 = _arg2.n43;
_local3.n13 = ((((_local4 * _local21) + (_local12 * _local23)) + (_local20 * _local25)) + (_local28 * _local27));
_local29 = _arg2.n14;
_local31 = _arg2.n24;
_local33 = _arg2.n34;
_local35 = _arg2.n44;
_local3.n14 = ((((_local4 * _local29) + (_local12 * _local31)) + (_local20 * _local33)) + (_local28 * _local35));
_local6 = _arg1.n21;
_local14 = _arg1.n22;
_local22 = _arg1.n23;
_local30 = _arg1.n24;
_local3.n21 = ((((_local6 * _local5) + (_local14 * _local7)) + (_local22 * _local9)) + (_local30 * _local11));
_local3.n22 = ((((_local6 * _local13) + (_local14 * _local15)) + (_local22 * _local17)) + (_local30 * _local19));
_local3.n23 = ((((_local6 * _local21) + (_local14 * _local23)) + (_local22 * _local25)) + (_local30 * _local27));
_local3.n24 = ((((_local6 * _local29) + (_local14 * _local31)) + (_local22 * _local33)) + (_local30 * _local35));
_local8 = _arg1.n31;
_local16 = _arg1.n32;
_local24 = _arg1.n33;
_local32 = _arg1.n34;
_local3.n31 = ((((_local8 * _local5) + (_local16 * _local7)) + (_local24 * _local9)) + (_local32 * _local11));
_local3.n32 = ((((_local8 * _local13) + (_local16 * _local15)) + (_local24 * _local17)) + (_local32 * _local19));
_local3.n33 = ((((_local8 * _local21) + (_local16 * _local23)) + (_local24 * _local25)) + (_local32 * _local27));
_local3.n34 = ((((_local8 * _local29) + (_local16 * _local31)) + (_local24 * _local33)) + (_local32 * _local35));
_local10 = _arg1.n41;
_local18 = _arg1.n42;
_local26 = _arg1.n43;
_local34 = _arg1.n44;
_local3.n41 = ((((_local10 * _local5) + (_local18 * _local7)) + (_local26 * _local9)) + (_local34 * _local11));
_local3.n42 = ((((_local10 * _local13) + (_local18 * _local15)) + (_local26 * _local17)) + (_local34 * _local19));
_local3.n43 = ((((_local10 * _local21) + (_local18 * _local23)) + (_local26 * _local25)) + (_local34 * _local27));
_local3.n44 = ((((_local10 * _local29) + (_local18 * _local31)) + (_local26 * _local33)) + (_local34 * _local35));
return (_local3);
}
}
}//package
Section 9
//PanoConfigXML (PanoConfigXML)
package {
public class PanoConfigXML {
public function applyConfig(_arg1:XML, _arg2:PanoCube){
var os:String;
var i:int;
var h:String;
var hotspot:XML;
var title:String;
var url:String;
var target:String;
var id:String;
var pan:Number;
var tilt:Number;
var width:int;
var height:int;
var config = _arg1;
var pano = _arg2;
try {
if (config.hasOwnProperty("input")){
if (config.input.hasOwnProperty("@order")){
os = (pano.faceOrder[0] = config.input.@order);
i = 0;
while (i < 6) {
pano.faceOrder[i] = os.charAt(i);
i = (i + 1);
};
};
if (config.input.hasOwnProperty("@cylinder")){
pano.isCylinder = (config.input.@cylinder == 1);
};
if (config.input.hasOwnProperty("@width")){
pano.cylinderImageWidth = config.input.@width;
};
if (config.input.hasOwnProperty("@height")){
pano.cylinderImageHeight = config.input.@height;
};
if (config.input.hasOwnProperty("@tilesize")){
pano.tileSize = config.input.@tilesize;
};
if (config.input.hasOwnProperty("preview")){
if (config.input.preview.hasOwnProperty("@images")){
pano.hasPrevImages = (config.input.preview.@images == 1);
};
if (config.input.preview.hasOwnProperty("@color")){
pano.preloadColor = config.input.preview.@color;
};
};
};
if (config.hasOwnProperty("view")){
if (config.view.hasOwnProperty("start")){
if (config.view.start.hasOwnProperty("@pan")){
pano.pan.cur = config.view.start.@pan;
pano.pan.def = config.view.start.@pan;
};
if (config.view.start.hasOwnProperty("@tilt")){
pano.tilt.cur = config.view.start.@tilt;
pano.tilt.def = config.view.start.@tilt;
};
if (config.view.start.hasOwnProperty("@fov")){
pano.fov.cur = config.view.start.@fov;
pano.fov.def = config.view.start.@fov;
};
};
if (config.view.hasOwnProperty("min")){
if (config.view.min.hasOwnProperty("@pan")){
pano.pan.min = config.view.min.@pan;
};
if (config.view.min.hasOwnProperty("@tilt")){
pano.tilt.min = config.view.min.@tilt;
};
if (config.view.min.hasOwnProperty("@fov")){
pano.fov.min = config.view.min.@fov;
};
};
if (config.view.hasOwnProperty("max")){
if (config.view.max.hasOwnProperty("@pan")){
pano.pan.max = config.view.max.@pan;
};
if (config.view.max.hasOwnProperty("@tilt")){
pano.tilt.max = config.view.max.@tilt;
};
if (config.view.max.hasOwnProperty("@fov")){
pano.fov.max = config.view.max.@fov;
};
};
};
if (config.hasOwnProperty("autorotate")){
pano.autorotate = true;
if (config.autorotate.hasOwnProperty("@delay")){
pano.autorotate_timeout = config.autorotate.@delay;
};
if (config.autorotate.hasOwnProperty("@speed")){
pano.autorotate = !((config.autorotate.@speed == 0));
pano.autorotate_pan = config.autorotate.@speed;
};
if (config.autorotate.hasOwnProperty("@returntohorizon")){
pano.autorotate_tilt_force = config.autorotate.@returntohorizon;
};
if (config.autorotate.hasOwnProperty("@onlyinfocus")){
pano.autorotate_onlyinfocus = (config.autorotate.@onlyinfocus == 1);
};
if (config.autorotate.hasOwnProperty("@startloaded")){
pano.autorotate_onlyloaded = (config.autorotate.@startloaded == 1);
};
};
if (config.hasOwnProperty("control")){
if (config.control.hasOwnProperty("@sensitifity")){
pano.sensitifity = config.control.@sensitifity;
};
if (config.control.hasOwnProperty("@simulatemass")){
pano.simulateMass = (config.control.@simulatemass == 1);
};
if (config.control.hasOwnProperty("@locked")){
pano.setLocked((config.control.@locked == 1));
};
};
if (config.hasOwnProperty("cursor")){
if (config.cursor.hasOwnProperty("@ownonmovement")){
pano.useOwnMoveCursor = (config.cursor.@ownonmovement == 1);
};
if (config.cursor.hasOwnProperty("@ownondefault")){
pano.useOwnCursor = (config.cursor.@ownondefault == 1);
};
};
if (config.hasOwnProperty("display")){
if (config.display.hasOwnProperty("@width")){
pano.windowWidth = config.display.@width;
};
if (config.display.hasOwnProperty("@height")){
pano.windowHeight = config.display.@height;
};
if (config.display.hasOwnProperty("@quality")){
pano.meshBase = config.display.@quality;
};
if (config.display.hasOwnProperty("@changemotionquality")){
pano.meshAuto = (config.display.@changemotionquality == 1);
};
if (config.display.hasOwnProperty("@changestagequality")){
pano.changeStageQuality = (config.display.@changestagequality == 1);
};
if (config.display.hasOwnProperty("@smoothing")){
pano.changeBmpSmooth = (config.display.@smoothing == 1);
};
if (config.display.hasOwnProperty("@scalemode")){
h = config.display.@scalemode;
pano.stageMode = h;
pano.windowScaleIgnore = (h == "no");
};
};
if (config.hasOwnProperty("qthotspots")){
pano.hasHotspots = true;
if (config.qthotspots.hasOwnProperty("label")){
if (config.qthotspots.label.hasOwnProperty("@width")){
pano.hotspottxtWidth = config.qthotspots.label.@width;
};
if (config.qthotspots.label.hasOwnProperty("@height")){
pano.hotspottxtHeight = config.qthotspots.label.@height;
};
if (config.qthotspots.label.hasOwnProperty("@movement")){
pano.hotspottxtContinous = (config.qthotspots.label.@movement == 1);
};
if (config.qthotspots.label.hasOwnProperty("@border")){
pano.hotspottxtBorder = (config.qthotspots.label.@border == 1);
};
if (config.qthotspots.label.hasOwnProperty("@background")){
pano.hotspottxtBackground = (config.qthotspots.label.@background == 1);
};
if (config.qthotspots.label.hasOwnProperty("@bordercolor")){
pano.hotspottxtBorderColor = config.qthotspots.label.@bordercolor;
};
if (config.qthotspots.label.hasOwnProperty("@backgroundcolor")){
pano.hotspottxtBackgroundColor = config.qthotspots.label.@backgroundcolor;
};
if (config.qthotspots.label.hasOwnProperty("@textcolor")){
pano.hotspottxtTextColor = config.qthotspots.label.@textcolor;
};
};
for each (hotspot in config.qthotspots.hotspot) {
if (hotspot.hasOwnProperty("@id")){
if (hotspot.hasOwnProperty("@title")){
title = hotspot.@title;
};
if (hotspot.hasOwnProperty("@url")){
url = hotspot.@url;
};
if (hotspot.hasOwnProperty("@target")){
target = hotspot.@target;
};
pano.addQtHotspot(hotspot.@id, title, url, target);
};
};
};
if (config.hasOwnProperty("hotspots")){
for each (hotspot in config.hotspots.hotspot) {
if (hotspot.hasOwnProperty("@id")){
id = hotspot.@id;
};
if (hotspot.hasOwnProperty("@title")){
title = hotspot.@title;
};
url = "";
if (hotspot.hasOwnProperty("@url")){
url = hotspot.@url;
};
if (hotspot.hasOwnProperty("@target")){
target = hotspot.@target;
};
pan = 0;
if (hotspot.hasOwnProperty("@pan")){
pan = hotspot.@pan;
};
tilt = 0;
if (hotspot.hasOwnProperty("@tilt")){
tilt = hotspot.@tilt;
};
width = 0;
if (hotspot.hasOwnProperty("@width")){
width = hotspot.@width;
};
height = 0;
if (hotspot.hasOwnProperty("@height")){
height = hotspot.@height;
};
if (url == ""){
pano.addTextHotspot(id, pan, tilt, title, width, height);
} else {
pano.addUrlHotspot(id, pan, tilt, title, url, target, width, height);
};
};
};
} catch(error:Error) {
};
}
}
}//package
Section 10
//PanoCube (PanoCube)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
public class PanoCube extends Sprite {
public var autorotate_timeout:Number;
public var onRotate:Function;
private var cursorData:BitmapData;
private var bmp_in:Array;
public var isInFocus:Boolean;
private var cylTilesXBase:Number;
public var onClickQtHotspot:Function;
public var hasHotspots:Boolean;
public var autorotate_onlyloaded:Boolean;
public var completed:Boolean;
public var cubeTiles:Number;
public var dA:Number;
public var controllerFlags:String;// = ""
public var meshBase:Number;// = 8
public var useOwnMoveCursor:Boolean;// = false
private var oldCursorId:int;// = -1
private var m:Matrix;
public var autorotate_tilt_force:Number;
public var key_down:Boolean;// = false
public var turn:Boolean;
private var mdown:Point;
public var started:Boolean;
public var keyAltDown:Boolean;// = false
public var onRollOutQtHotspot:Function;
public var pan:PanoViewLimits;
private var ed:Number;
public var keyShiftDown:Boolean;// = false
public var canv:MovieClip;
public var qthotspots:Array;
public var autorotate_pan:Number;
private var va:Array;
public var cylinderImageHeight:Number;// = 0
private var mcur:Point;
public var useOwnCursor:Boolean;// = false
public var hotspottxtBorderColor:uint;// = 0
public var autorotate_onlyinfocus:Boolean;
public var tilt:PanoViewLimits;
public var sensitifity:Number;
public var onRollOverHotspot:Function;
public var hasPrevImages:Boolean;// = true
private var imageRepos:ImageRepository;
public var showfps:Boolean;
public var fov:PanoViewLimits;
public var currentHotspotId:int;
public var hotspottxtBorder:Boolean;// = true
public var preloadColor:Number;
public var lastkeyascii:Number;
private var framecnt:Number;
private var lastMouseDown:Number;
public var hotspot_txt:TextField;
public var hotspottxtWidth:Number;// = 0
private var locked:Boolean;// = false
public var useMask:Boolean;
public var onRollOverQtHotspot:Function;
public var isCylinder:Boolean;
public var controllerAlpha:Number;
public var currentHotspot:Hotspot;
private var vat:Array;
public var faceOrder:Array;
public var keyCtrlDown:Boolean;// = false
private var hs_local:Number;
public var simulateMass:Boolean;
public var meshAuto:Boolean;// = true
public var dTilt:Number;
public var controllerPos:Number;
public var hotspottxtBackground:Boolean;// = true
public var initMovClip:Boolean;// = true
private var cursor:Bitmap;
public var autoplay:Boolean;
private var mat:Matrix4d;
private var lastaction_dt:Number;
private var panomask:Shape;
public var windowHeight:Number;// = 300
public var lastkeycode:Number;
public var enable_callback:Boolean;
public var hotspots:Array;
public var dPan:Number;
public var cylinderImageWidth:Number;// = 0
public var onClickHotspot:Function;
public var hotspottxtBackgroundColor:uint;// = 0xFFFFFF
public var cylTilesXS:Number;
public var windowScaleIgnore:Boolean;
private var bmpSmooth:Boolean;
public var windowWidth:Number;// = 300
public var onRollOutHotspot:Function;
public var stageMode:String;
public var changeBmpSmooth:Boolean;// = false
private var mdownt:Number;
private var cylTilesX:Number;
private var cylTilesY:Number;
public var tileSize:Number;
public var autorotate:Boolean;
public var dirty:Boolean;
public var hotspottxtContinous:Boolean;// = true
public var hotspottxtHeight:Number;// = 0
public var dirtyMask:Boolean;
public var dFov:Number;
public var rect:Rectangle;
public var changeStageQuality:Boolean;// = true
public var busy:Boolean;
public var meshCylBase:Number;// = 6
public var hotspottxtTextColor:uint;// = 0
public var bmpVideo:BitmapData;
private var bmp_loaded:Array;
public function PanoCube(){
var _local1:Number;
hasPrevImages = true;
locked = false;
meshBase = 8;
meshCylBase = 6;
meshAuto = true;
changeBmpSmooth = false;
changeStageQuality = true;
cylinderImageWidth = 0;
cylinderImageHeight = 0;
key_down = false;
keyShiftDown = false;
keyCtrlDown = false;
keyAltDown = false;
initMovClip = true;
controllerFlags = "";
hotspottxtWidth = 0;
hotspottxtHeight = 0;
hotspottxtTextColor = 0;
hotspottxtBorderColor = 0;
hotspottxtBackgroundColor = 0xFFFFFF;
hotspottxtBorder = true;
hotspottxtBackground = true;
hotspottxtContinous = true;
windowWidth = 300;
windowHeight = 300;
useOwnCursor = false;
useOwnMoveCursor = false;
oldCursorId = -1;
super();
framecnt = 0;
fov = new PanoViewLimits(90, 20, 120);
pan = new PanoViewLimits(0, 0, 360);
tilt = new PanoViewLimits(0, -90, 90);
imageRepos = new ImageRepository();
canv = new MovieClip();
bmp_in = new Array();
bmp_loaded = new Array();
va = new Array();
vat = new Array();
m = new Matrix();
hotspots = new Array();
qthotspots = new Array();
mdown = new Point();
mcur = new Point();
mdownt = 0;
turn = false;
cubeTiles = meshBase;
rect = new Rectangle();
hs_local = 0;
dPan = 0;
dTilt = 0;
dFov = 0;
autorotate_pan = 0.5;
autorotate_tilt_force = 0.5;
autorotate_timeout = 5;
autorotate = false;
autorotate_onlyinfocus = true;
enable_callback = false;
controllerPos = (0 + (2 * 3));
controllerAlpha = 100;
bmpSmooth = true;
isCylinder = false;
cylTilesXS = 6;
enable_callback = true;
completed = false;
preloadColor = 16777216;
windowScaleIgnore = false;
lastaction_dt = 0;
tileSize = 0;
sensitifity = 8;
simulateMass = true;
hasHotspots = false;
hotspottxt_width = 200;
hotspottxt_height = 20;
onClickQtHotspot = undefined;
useMask = true;
faceOrder = new Array();
_local1 = 0;
while (_local1 < 8) {
faceOrder[_local1] = _local1;
_local1++;
};
addEventListener(Event.ENTER_FRAME, init);
}
public function setWindowPos(_arg1:Number, _arg2:Number){
rect.top = _arg1;
rect.right = _arg2;
dirtyMask = true;
}
public function init_cube():void{
var _local1:Number;
_local1 = 0;
while (_local1 < 12) {
bmp_loaded.push(false);
_local1++;
};
setup_cube();
setMeshDensity(0);
}
public function setLocked(_arg1:Boolean):void{
locked = _arg1;
}
public function setWindowSize(_arg1:Number, _arg2:Number){
rect.width = _arg1;
windowWidth = _arg1;
rect.height = _arg2;
windowHeight = _arg2;
dirtyMask = true;
}
public function init_cylinder(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local7 = (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 * _local7) / 360) / cylTilesXS));
if ((cylTilesXBase * cylTilesXS) < 10){
cylTilesXBase = Math.ceil((10 / cylTilesXS));
};
cylTilesX = cylTilesXBase;
isCylinder = true;
if (cylTilesXS < 1){
cylTilesXS = 1;
};
_local1 = 0;
while (_local1 < cylTilesXS) {
bmp_loaded.push(false);
_local1++;
};
if (bmp_loaded[0]){
_local4 = (cylTilesXS * bmp_in[0].width);
_local5 = bmp_in[0].height;
} else {
_local4 = cylinderImageWidth;
_local5 = cylinderImageHeight;
};
setup_cylinder(_local4, _local5);
_local8 = ((180 / Math.PI) * Math.atan(((_local5 * Math.PI) / (_local4 * (360 / _local7)))));
if (tilt.min < -(_local8)){
tilt.min = -(_local8);
};
if (tilt.max > _local8){
tilt.max = _local8;
};
checkLimits();
}
private function init_cubefaces():void{
loadBitmaps();
setup_cube();
}
function redrawCursor(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:int;
if (_arg1 != null){
if (_arg1.type == MouseEvent.MOUSE_MOVE){
isInFocus = true;
};
};
if (useOwnMoveCursor){
if (((((useOwnCursor) || (turn))) && (isInFocus))){
cursor.visible = true;
Mouse.hide();
cursor.x = (root.mouseX - 16);
cursor.y = (root.mouseY - 16);
_local2 = (mdown.x - root.mouseX);
_local3 = (mdown.y - root.mouseY);
_local4 = (Math.abs(_local2) + Math.abs(_local3));
_local5 = 9;
if (turn){
if (_local4 < 2){
_local5 = 4;
} else {
if (_local2 > (2 * Math.abs(_local3))){
_local5 = 1;
};
if (-(_local2) > (2 * Math.abs(_local3))){
_local5 = 7;
};
if (_local3 > (2 * Math.abs(_local2))){
_local5 = 3;
};
if (-(_local3) > (2 * Math.abs(_local2))){
_local5 = 5;
};
if (_local5 == 9){
if ((((_local2 > 0)) && ((_local3 > 0)))){
_local5 = 0;
};
if ((((_local2 < 0)) && ((_local3 > 0)))){
_local5 = 6;
};
if ((((_local2 > 0)) && ((_local3 < 0)))){
_local5 = 2;
};
if ((((_local2 < 0)) && ((_local3 < 0)))){
_local5 = 8;
};
};
};
} else {
if (currentHotspotId > 0){
if (currentHotspot){
if (currentHotspot.url != ""){
_local5 = 10;
} else {
_local5 = 12;
};
} else {
_local5 = 11;
};
};
};
if (_local5 != oldCursorId){
oldCursorId = _local5;
cursor.bitmapData.copyPixels(cursorData, new Rectangle((int((_local5 / 3)) * 32), ((_local5 % 3) * 32), 32, 32), new Point(0, 0), null, null, false);
};
} else {
Mouse.show();
cursor.visible = false;
};
};
}
public function setTilt(_arg1:Number):void{
if (!isNaN(_arg1)){
dirty = ((dirty) || (!((tilt.cur == _arg1))));
tilt.cur = _arg1;
};
checkLimits();
}
public function xmlConfig(_arg1:XML):void{
var _local2:PanoConfigXML;
_local2 = new PanoConfigXML();
_local2.applyConfig(_arg1, this);
}
public function removeAllListener():void{
removeEventListener(Event.ENTER_FRAME, doEnterFrame);
removeEventListener(MouseEvent.MOUSE_DOWN, doMouseDown);
removeEventListener(MouseEvent.MOUSE_UP, doMouseUp);
removeEventListener(MouseEvent.MOUSE_MOVE, doMouseMove);
removeEventListener(MouseEvent.MOUSE_WHEEL, doMouseWheel);
removeEventListener(KeyboardEvent.KEY_DOWN, doKeyDown);
removeEventListener(KeyboardEvent.KEY_UP, doKeyUp);
try {
if (stage){
stage.removeEventListener(Event.RESIZE, doStageResize);
stage.removeEventListener(Event.ENTER_FRAME, doEnterFrame);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, doMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, doMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, doMouseMove);
stage.removeEventListener(MouseEvent.MOUSE_WHEEL, doMouseWheel);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, doKeyDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, doKeyUp);
};
} catch(err:Error) {
};
removeEventListener(MouseEvent.MOUSE_MOVE, redrawCursor);
canv.removeEventListener(MouseEvent.MOUSE_OVER, doRollOver);
canv.removeEventListener(MouseEvent.MOUSE_OUT, doRollOut);
cursor.removeEventListener(MouseEvent.MOUSE_OVER, doRollOver);
cursor.removeEventListener(MouseEvent.MOUSE_OUT, doRollOut);
stage.removeEventListener(Event.MOUSE_LEAVE, hideCursor);
}
private function doClickHotspot(_arg1:Event){
var hs:MovieClip;
var i:int;
var request:URLRequest;
var e = _arg1;
hs = MovieClip(e.currentTarget);
i = 0;
while (i < hotspots.length) {
if (hotspots[i].clip == hs){
if (onClickHotspot != null){
try {
onClickHotspot(hotspots[i].id, hotspots[i].clip, hotspots[i].url, hotspots[i].target);
} catch(error:Error) {
};
} else {
if (hotspots[i].url != ""){
request = new URLRequest(hotspots[i].url);
navigateToURL(request, hotspots[i].target);
};
};
};
i = (i + 1);
};
}
public function doEnterFrame(_arg1:Event):void{
var _local2:Date;
var _local3:Date;
if (((((isNaN(pan.cur)) || (isNaN(tilt.cur)))) || (isNaN(fov.cur)))){
pan.cur = 0;
tilt.cur = 0;
fov.cur = 70;
};
if (started){
dA = 0;
if (key_down){
resetlastaction();
autoplay = false;
dPan = 0;
dTilt = 0;
dFov = 0;
if (lastkeycode == 39){
dPan = -1;
};
if (lastkeycode == 37){
dPan = 1;
};
if (lastkeycode == 40){
dTilt = -1;
};
if (lastkeycode == 38){
dTilt = 1;
};
if (lastkeyascii == 43){
dFov = -1;
};
if (lastkeyascii == 45){
dFov = 1;
};
if (keyCtrlDown){
dFov = 1;
};
if (keyShiftDown){
dFov = -1;
};
changeTilt(dTilt);
changePan(dPan);
changeFov(dFov);
dA = (((dPan * dPan) + (dTilt * dTilt)) + (dFov * dFov));
setMeshDensity(dA);
};
if (turn){
resetlastaction();
_local2 = new Date();
mdownt = ((2 * sensitifity) * 1E-5);
dTilt = ((-((mcur.y - mdown.y)) * mdownt) * fov.cur);
dPan = ((-((mcur.x - mdown.x)) * mdownt) * fov.cur);
dA = (((dPan * dPan) + (dTilt * dTilt)) + (dFov * dFov));
setMeshDensity(dA);
changeTilt(dTilt);
changePan(dPan);
dirty = ((!((dA == 0))) || (!((cubeTiles == meshBase))));
};
if (((autorotate) && (!(autoplay)))){
_local3 = new Date();
if (((_local3.getTime() - lastaction_dt) / 1000) > autorotate_timeout){
autoplay = true;
};
};
if (((((autoplay) && (((!(autorotate_onlyinfocus)) || (isInFocus))))) && (((!(autorotate_onlyloaded)) || (completed))))){
dTilt = ((autorotate_tilt_force * (0 - tilt.cur)) / 100);
dFov = ((autorotate_tilt_force * (fov.def - fov.cur)) / 100);
dPan = ((dPan * 0.95) + (-(autorotate_pan) * 0.05));
dA = (((dPan * dPan) + (dTilt * dTilt)) + (dFov * dFov));
setMeshDensity(dA);
changeTilt(dTilt);
changePan(dPan);
changeFov(dFov);
dirty = true;
};
if (((((!(key_down)) && (!(turn)))) && (!(autoplay)))){
if (simulateMass){
dTilt = (dTilt * 0.85);
dPan = (dPan * 0.85);
dFov = (dFov * 0.85);
dA = (((dPan * dPan) + (dTilt * dTilt)) + (dFov * dFov));
} else {
dA = 0;
};
if (dA < 0.01){
setMeshDensity(0);
if (dA > 0){
dirty = true;
};
dTilt = 0;
dPan = 0;
dFov = 0;
} else {
setMeshDensity(dA);
changeTilt(dTilt);
changePan(dPan);
changeFov(dFov);
dirty = true;
};
};
if (dA < 0.01){
if (changeBmpSmooth){
bmpSmooth = true;
};
if (changeStageQuality){
if (stage){
stage.quality = "HIGH";
};
};
} else {
if (changeBmpSmooth){
bmpSmooth = false;
};
if (changeStageQuality){
if (stage){
stage.quality = "LOW";
};
};
};
if (dirty){
dirty = false;
doPaint();
};
if (hasHotspots){
checkHotspots(mcur.x, mcur.y);
};
};
}
private function DisplayTile(_arg1:BitmapData, _arg2:Point, _arg3:Point, _arg4:Vector3d, _arg5:Vector3d, _arg6:Vector3d, _arg7:Vector3d, _arg8:Number, _arg9:Number):void{
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Vector3d;
var _local15:Vector3d;
var _local16:Point;
var _local17:Point;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Matrix;
var _local22:Matrix;
_local10 = -0.01;
_local11 = rect.width;
_local12 = rect.height;
if ((((((((((_arg9 < 5)) && (!(isCylinder)))) || ((((_arg9 < 2)) && (isCylinder))))) || ((((((((_arg4.pz < _local10)) && ((_arg5.pz < _local10)))) && ((_arg6.pz < _local10)))) && ((_arg7.pz < _local10)))))) && ((((_arg9 < 1)) || ((((((((((((((_arg4.px >= 0)) || ((_arg5.px >= 0)))) || ((_arg6.px >= 0)))) || ((_arg7.px >= 0)))) && ((((((((_arg4.py >= 0)) || ((_arg5.py >= 0)))) || ((_arg6.py >= 0)))) || ((_arg7.py >= 0)))))) && ((((((((_arg4.px <= _local11)) || ((_arg5.px <= _local11)))) || ((_arg6.px <= _local11)))) || ((_arg7.px <= _local11)))))) && ((((((((_arg4.py <= _local12)) || ((_arg5.py <= _local12)))) || ((_arg6.py <= _local12)))) || ((_arg7.py <= _local12)))))))))){
if ((_arg8 > 0)){
_local14 = new Vector3d();
_local15 = new Vector3d();
_local18 = (rect.width >> 1);
_local19 = (rect.height >> 1);
if (((((_arg8 & 1) == 0)) || (isCylinder))){
_local14.x = ((_arg4.x + _arg6.x) * 0.5);
_local14.y = ((_arg4.y + _arg6.y) * 0.5);
_local14.z = (_local14.pz = ((_arg4.z + _arg6.z) * 0.5));
_local15.x = ((_arg5.x + _arg7.x) * 0.5);
_local15.y = ((_arg5.y + _arg7.y) * 0.5);
_local15.z = (_local15.pz = ((_arg5.z + _arg7.z) * 0.5));
if (_local14.z < 0){
_local20 = ((_local14.z)>-1E-5) ? 10000 : (-(ed) / _local14.z);
_local14.px = ((_local14.x * _local20) + _local18);
_local14.py = ((_local14.y * _local20) + _local19);
} else {
_local14.px = ((_local14.x * 1000) + _local18);
_local14.py = ((_local14.y * 1000) + _local19);
};
if (_local15.z < 0){
_local20 = ((_local15.z)>-1E-5) ? 10000 : (-(ed) / _local15.z);
_local15.px = ((_local15.x * _local20) + _local18);
_local15.py = ((_local15.y * _local20) + _local19);
} else {
_local15.px = ((_local15.x * 1000) + _local18);
_local15.py = ((_local15.y * 1000) + _local19);
};
_local17 = new Point(_arg3.x, (_arg3.y * 2));
_local16 = new Point(_arg2.x, (_arg2.y + (1 / _local17.y)));
DisplayTile(_arg1, _arg2, _local17, _arg4, _arg5, _local14, _local15, (_arg8 - 1), (_arg9 + 1));
DisplayTile(_arg1, _local16, _local17, _local14, _local15, _arg6, _arg7, (_arg8 - 1), (_arg9 + 1));
} else {
_local14.x = ((_arg4.x + _arg5.x) * 0.5);
_local14.y = ((_arg4.y + _arg5.y) * 0.5);
_local14.z = (_local14.pz = ((_arg4.z + _arg5.z) * 0.5));
_local15.x = ((_arg6.x + _arg7.x) * 0.5);
_local15.y = ((_arg6.y + _arg7.y) * 0.5);
_local15.z = (_local15.pz = ((_arg6.z + _arg7.z) * 0.5));
if (_local14.z < 0){
_local20 = ((_local14.z)>-1E-5) ? 10000 : (-(ed) / _local14.z);
_local14.px = ((_local14.x * _local20) + _local18);
_local14.py = ((_local14.y * _local20) + _local19);
} else {
_local14.px = ((_local14.x * 1000) + _local18);
_local14.py = ((_local14.y * 1000) + _local19);
};
if (_local15.z < 0){
_local20 = ((_local15.z)>-1E-5) ? 10000 : (-(ed) / _local15.z);
_local15.px = ((_local15.x * _local20) + _local18);
_local15.py = ((_local15.y * _local20) + _local19);
} else {
_local15.px = ((_local15.x * 1000) + _local18);
_local15.py = ((_local15.y * 1000) + _local19);
};
_local17 = new Point((_arg3.x * 2), _arg3.y);
_local16 = new Point((_arg2.x + (1 / _local17.x)), _arg2.y);
DisplayTile(_arg1, _arg2, _local17, _arg4, _local14, _arg6, _local15, (_arg8 - 1), (_arg9 + 1));
DisplayTile(_arg1, _local16, _local17, _local14, _arg5, _local15, _arg7, (_arg8 - 1), (_arg9 + 1));
};
} else {
_local21 = new Matrix();
_local22 = new Matrix();
_local21.a = ((_arg5.px - _arg4.px) * _arg3.x);
_local21.c = ((_arg7.px - _arg5.px) * _arg3.y);
_local21.b = ((_arg5.py - _arg4.py) * _arg3.x);
_local21.d = ((_arg7.py - _arg5.py) * _arg3.y);
_local21.tx = ((_arg4.px - (_arg2.x * _local21.a)) - (_arg2.y * _local21.c));
_local21.ty = ((_arg4.py - (_arg2.x * _local21.b)) - (_arg2.y * _local21.d));
_local22.a = ((_arg7.px - _arg6.px) * _arg3.x);
_local22.c = ((_arg6.px - _arg4.px) * _arg3.y);
_local22.b = ((_arg7.py - _arg6.py) * _arg3.x);
_local22.d = ((_arg6.py - _arg4.py) * _arg3.y);
_local22.tx = ((_arg4.px - (_arg2.x * _local22.a)) - (_arg2.y * _local22.c));
_local22.ty = ((_arg4.py - (_arg2.x * _local22.b)) - (_arg2.y * _local22.d));
canv.graphics.beginBitmapFill(_arg1, _local21, false, bmpSmooth);
canv.graphics.moveTo(_arg4.px, _arg4.py);
canv.graphics.lineTo(_arg5.px, _arg5.py);
canv.graphics.lineTo(_arg7.px, _arg7.py);
canv.graphics.endFill();
canv.graphics.beginBitmapFill(_arg1, _local22, false, bmpSmooth);
canv.graphics.moveTo(_arg4.px, _arg4.py);
canv.graphics.lineTo(_arg6.px, _arg6.py);
canv.graphics.lineTo(_arg7.px, _arg7.py);
canv.graphics.endFill();
};
};
}
public function setMeshDensity(_arg1:Number):void{
if (meshAuto){
if (_arg1 < 0.25){
cubeTiles = meshBase;
cylTilesY = meshCylBase;
} else {
if (_arg1 < 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;
};
}
public function isComplete():Boolean{
return (completed);
}
public function changeTilt(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
if (!isNaN(_arg1)){
setTilt((tilt.cur + _arg1));
if (_arg2){
dTilt = _arg1;
};
if (_arg3){
resetlastaction();
autoplay = false;
};
};
}
public function doRollOut(_arg1:MouseEvent):void{
isInFocus = false;
if (((useOwnCursor) || (useOwnMoveCursor))){
cursor.visible = false;
Mouse.show();
};
}
private function paint_cylinder(_arg1:Number){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Vector3d;
var _local25:Vector3d;
var _local26:Vector3d;
var _local27:Vector3d;
var _local28:Vector3d;
var _local29:Vector3d;
var _local30:Point;
var _local31:Point;
var _local32:Point;
var _local33:Point;
var _local34:Point;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
_local14 = 50;
_local15 = 1;
_local16 = 0;
_local17 = -0.15;
_local25 = new Vector3d();
if (cubeTiles < 2){
cubeTiles = 2;
};
transformCorners();
framecnt++;
_local15 = 0;
_local16 = -1;
if (_local16 >= 0){
};
_local18 = rect.width;
_local20 = (_local18 / 2);
_local19 = rect.height;
_local21 = (_local19 / 2);
canv.graphics.clear();
ed = (_local21 / Math.tan(((fov.cur * Math.PI) / 360)));
_local35 = (fov.cur / 2);
_local36 = ((Math.atan(((rect.width / rect.height) * Math.tan(((_local35 * Math.PI) / 180)))) * 180) / Math.PI);
cylTilesX = (cylTilesXBase / 1);
_local37 = (cylTilesXBase / cylTilesX);
_local11 = 0;
while (_local11 < cylTilesXS) {
_local22 = bmp_in[_local11].width;
_local23 = bmp_in[_local11].height;
_local34 = new Point((cylTilesX / _local22), (1 / _local23));
_local4 = 0;
while (_local4 < cylTilesX) {
_local38 = ((((cylTilesX * _local11) * _local37) + _local4) * 4);
_local26 = vat[_local38];
_local28 = vat[(_local38 + 2)];
_local38 = ((((((cylTilesX * _local11) * _local37) + _local4) + _local37) - 1) * 4);
_local27 = vat[(_local38 + 1)];
_local29 = vat[(_local38 + 3)];
if ((((((((_local26.z < 0)) || ((_local27.z < 0)))) || ((_local28.z < 0)))) || ((_local29.z < 0)))){
_local26.project(ed, _local20, _local21);
_local27.project(ed, _local20, _local21);
_local28.project(ed, _local20, _local21);
_local29.project(ed, _local20, _local21);
DisplayTile(bmp_in[_local11], new Point(((_local4 * _local22) / cylTilesX), 0), _local34, _local26, _local27, _local28, _local29, cylTilesY, 0);
};
_local4++;
};
_local11++;
};
}
public function doMouseWheel(_arg1:MouseEvent):void{
changeFov((_arg1.delta / 3), true);
autoplay = false;
resetlastaction();
_arg1.stopImmediatePropagation();
_arg1.preventDefault();
}
public function doRollOver(_arg1:MouseEvent):void{
isInFocus = true;
}
public function cleanup():void{
removeAllListener();
}
function checkHotspots(_arg1:int, _arg2:int){
var d:Number;
var dx:Number;
var dy:Number;
var px:int;
var py:int;
var cpan:Number;
var ctilt:Number;
var v:Vector3d;
var ix:Number;
var iy:Number;
var face:Number;
var p:Point;
var facec:Number;
var pd:Number;
var hsnr:Number;
var cp:Number;
var pmm:Number;
var cw:Number;
var hs:Hotspot;
var npx:Number;
var npy:Number;
var x = _arg1;
var y = _arg2;
if (hasHotspots){
p = getPositionAngles(x, y);
cpan = p.x;
ctilt = p.y;
v = new Vector3d(0, 0, -1);
v.rotx(((ctilt * Math.PI) / 180));
v.roty(((cpan * Math.PI) / 180));
v.rotx(((-(tilt.cur) * Math.PI) / 180));
v.roty(((-(pan.cur) * Math.PI) / 180));
if (isCylinder){
cp = 0;
pmm = (pan.max - pan.min);
cp = (Math.atan2(v.x, -(v.z)) - ((pan.min * Math.PI) / 180));
if (cp < 0){
cp = (cp + (2 * Math.PI));
};
cp = (((6 * cp) * 360) / ((2 * Math.PI) * pmm));
face = Math.floor(cp);
ix = (cp - face);
cw = (cylinderImageWidth / 6);
px = Math.floor((cw * ix));
iy = (-(v.y) / Math.sqrt(((v.x * v.x) + (v.z * v.z))));
py = Math.floor((((((cylinderImageWidth / Math.PI) * (360 / pmm)) * iy) + cylinderImageHeight) / 2));
if (px < 0){
px = 0;
};
if (py < 0){
py = 0;
};
if (px >= cw){
px = (cw - 1);
};
if (py >= cylinderImageHeight){
py = (cylinderImageHeight - 1);
};
} else {
if ((((((v.z < 0)) && ((v.z <= -(Math.abs(v.x)))))) && ((v.z <= -(Math.abs(v.y)))))){
ix = (0.5 * (1 - (v.x / v.z)));
iy = (0.5 * (1 + (v.y / v.z)));
face = 0;
};
if ((((((v.x >= 0)) && ((v.x >= Math.abs(v.y))))) && ((v.x >= Math.abs(v.z))))){
ix = (0.5 * (1 + (v.z / v.x)));
iy = (0.5 * (1 - (v.y / v.x)));
face = 1;
};
if ((((((v.z >= 0)) && ((v.z >= Math.abs(v.x))))) && ((v.z >= Math.abs(v.y))))){
ix = (0.5 * (1 - (v.x / v.z)));
iy = (0.5 * (1 - (v.y / v.z)));
face = 2;
};
if ((((((v.x <= 0)) && ((v.x <= -(Math.abs(v.y)))))) && ((v.x <= -(Math.abs(v.z)))))){
ix = (0.5 * (1 + (v.z / v.x)));
iy = (0.5 * (1 + (v.y / v.x)));
face = 3;
};
if ((((((v.y >= 0)) && ((v.y >= Math.abs(v.x))))) && ((v.y >= Math.abs(v.z))))){
ix = (0.5 * (1 + (v.x / v.y)));
iy = (0.5 * (1 - (v.z / v.y)));
face = 4;
};
if ((((((v.y <= 0)) && ((v.y <= -(Math.abs(v.x)))))) && ((v.y <= -(Math.abs(v.z)))))){
ix = (0.5 * (1 - (v.x / v.y)));
iy = (0.5 * (1 - (v.z / v.y)));
face = 5;
};
px = Math.floor((tileSize * ix));
py = Math.floor((tileSize * iy));
};
facec = Math.floor((face / 3));
pd = bmp_in[(6 + facec)].getPixel(px, py);
hsnr = 0;
if (!isNaN(pd)){
if ((((face == 2)) || ((face == 5)))){
hsnr = (pd % 0x0100);
};
if ((((face == 1)) || ((face == 4)))){
hsnr = (Math.floor((pd / 0x0100)) % 0x0100);
};
if ((((face == 0)) || ((face == 3)))){
hsnr = (Math.floor((pd / (0x0100 * 0x0100))) % 0x0100);
};
};
canv.useHandCursor = (hsnr > 0);
canv.buttonMode = (hsnr > 0);
if ((((hsnr > 0)) && (isInFocus))){
hs = this.qthotspots[hsnr];
if (hs != null){
if (currentHotspot != hs){
if (((!((onRollOutQtHotspot == null))) && (!((currentHotspot == null))))){
try {
onRollOutQtHotspot(currentHotspot.id, currentHotspot.title, currentHotspot.url, currentHotspot.target);
} catch(error:Error) {
};
};
if (hotspottxtWidth > 0){
hotspot_txt.autoSize = TextFieldAutoSize.NONE;
hotspot_txt.width = hotspottxtWidth;
hotspot_txt.height = hotspottxtHeight;
} else {
hotspot_txt.autoSize = TextFieldAutoSize.CENTER;
hotspot_txt.wordWrap = true;
};
hotspot_txt.htmlText = hs.title;
hotspot_txt.visible = (hs.title.length > 0);
hotspot_txt.backgroundColor = hotspottxtBackgroundColor;
hotspot_txt.borderColor = hotspottxtBorderColor;
hotspot_txt.border = hotspottxtBorder;
hotspot_txt.textColor = hotspottxtTextColor;
hotspot_txt.background = hotspottxtBackground;
hotspot_txt.selectable = false;
currentHotspot = hs;
if (((!((onRollOverQtHotspot == null))) && (!((currentHotspot == null))))){
try {
onRollOverQtHotspot(currentHotspot.id, currentHotspot.title, currentHotspot.url, currentHotspot.target);
} catch(error:Error) {
};
};
};
npx = ((hs.ofs.x + x) - (hotspot_txt.width / 2));
npy = ((hs.ofs.y + y) + 20);
if (((((((hotspottxtContinous) || (!((currentHotspot == hs))))) || ((Math.abs((hotspot_txt.x - npx)) > (hotspot_txt.width / 2))))) || (((Math.abs((hotspot_txt.y - npy)) - 25) > hotspot_txt.height)))){
hotspot_txt.x = npx;
hotspot_txt.y = npy;
};
};
} else {
if (((!((onRollOutQtHotspot == null))) && (!((currentHotspot == null))))){
try {
onRollOutQtHotspot(currentHotspot.id, currentHotspot.title, currentHotspot.url, currentHotspot.target);
} catch(error:Error) {
};
};
currentHotspot = null;
hotspot_txt.visible = false;
};
if (currentHotspotId != hsnr){
currentHotspotId = hsnr;
redrawCursor(null);
};
} else {
currentHotspotId = 0;
};
}
public function update(){
dirty = true;
}
function doMouseClick(){
var request:URLRequest;
if (currentHotspot != null){
if (onClickQtHotspot != null){
try {
onClickQtHotspot(currentHotspot.id, currentHotspot.title, currentHotspot.url, currentHotspot.target);
} catch(error:Error) {
};
} else {
if (currentHotspot.onCallback != null){
currentHotspot.onCallback(currentHotspot.id);
} else {
if (currentHotspot.url.length > 0){
request = new URLRequest(currentHotspot.url);
navigateToURL(request, currentHotspot.target);
};
};
};
};
}
public function doKeyDown(_arg1:KeyboardEvent):void{
if (!locked){
lastkeycode = _arg1.keyCode;
lastkeyascii = _arg1.charCode;
keyShiftDown = _arg1.shiftKey;
keyCtrlDown = _arg1.ctrlKey;
keyAltDown = _arg1.altKey;
if (_arg1.shiftKey){
if (_arg1.keyCode == 73){
showfps = !(showfps);
if (!showfps){
};
};
if (_arg1.keyCode == 72){
meshBase++;
};
if (_arg1.keyCode == 76){
meshBase--;
};
};
key_down = true;
dirty = true;
};
}
public function setup_cube():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = 1.0025;
if (isCylinder == true){
return;
};
_local4 = ((fov.cur / 2) * (Math.PI / 180));
_local5 = Math.floor((((rect.height / 2) / Math.tan(_local4)) * 2));
if (tileSize > 0){
_local3 = (1.0005 + (((tileSize / _local5) * 2) / tileSize));
};
va = new Array();
_local1 = 0;
while (_local1 < 6) {
va.push(new Vector3d(-(_local3), -(_local3), -1));
va.push(new Vector3d(_local3, -(_local3), -1));
va.push(new Vector3d(-(_local3), _local3, -1));
va.push(new Vector3d(_local3, _local3, -1));
if (_local1 < 4){
_local2 = 0;
while (_local2 < 4) {
va[((va.length - 4) + _local2)].roty(((Math.PI * 0.5) * _local1));
_local2++;
};
};
if (_local1 == 4){
_local2 = 0;
while (_local2 < 4) {
va[((va.length - 4) + _local2)].rotx((Math.PI * 0.5));
_local2++;
};
};
if (_local1 == 5){
_local2 = 0;
while (_local2 < 4) {
va[((va.length - 4) + _local2)].rotx((-(Math.PI) * 0.5));
_local2++;
};
};
_local1++;
};
}
public function resetlastaction():void{
var _local1:Date;
_local1 = new Date();
lastaction_dt = _local1.getTime();
}
public function changePan(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
if (!isNaN(_arg1)){
setPan((pan.cur + _arg1));
if (_arg2){
dPan = _arg1;
};
if (_arg3){
resetlastaction();
autoplay = false;
};
};
}
public function doPaint():void{
try {
checkLimits();
if (isCylinder){
paint_cylinder(1);
} else {
setup_cube();
paint_cube(1);
};
} catch(error:Error) {
};
if (dirtyMask){
dirtyMask = false;
updateMask();
};
}
public function setPan(_arg1:Number):void{
if (!isNaN(_arg1)){
dirty = ((dirty) || (!((pan.cur == _arg1))));
pan.cur = _arg1;
};
checkLimits();
}
public function addHotspot(_arg1:String, _arg2:Number, _arg3:Number, _arg4:MovieClip, _arg5:String="", _arg6:String=""){
var _local7:Hotspot;
_local7 = new Hotspot();
_local7.id = _arg1;
_local7.posPan = _arg2;
_local7.posTilt = _arg3;
_local7.clip = _arg4;
_local7.url = _arg5;
_local7.target = _arg6;
if (hs_local == 1){
_local7.ofs.x = 0;
_local7.ofs.y = 0;
} else {
_local7.ofs.x = canv.x;
_local7.ofs.y = canv.y;
};
_arg4.visible = false;
canv.addChild(_arg4);
if (enable_callback){
_arg4.addEventListener(MouseEvent.CLICK, doClickHotspot);
_arg4.addEventListener(MouseEvent.MOUSE_OVER, doRollOverHotspot);
_arg4.addEventListener(MouseEvent.MOUSE_OUT, doRollOutHotspot);
};
hotspots.push(_local7);
}
public function setPanLimits(_arg1:Number, _arg2:Number):void{
pan.min = _arg1;
pan.max = _arg2;
checkLimits();
}
private function doRollOverHotspot(_arg1:Event){
var hs:MovieClip;
var i:int;
var e = _arg1;
hs = MovieClip(e.currentTarget);
if (onRollOverHotspot != null){
i = 0;
while (i < hotspots.length) {
if (hotspots[i].clip == hs){
try {
onRollOverHotspot(hotspots[i].id, hotspots[i].clip);
} catch(error:Error) {
};
};
i = (i + 1);
};
} else {
if (hs.hasOwnProperty("hstext")){
hs.hstext.visible = true;
};
};
}
public function changeFov(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
if (!isNaN(_arg1)){
setFov((fov.cur + _arg1));
if (_arg2){
dFov = _arg1;
};
if (_arg3){
resetlastaction();
autoplay = false;
};
};
}
public function doMouseDown(_arg1:MouseEvent):void{
var _local2:Date;
var _local3:Number;
mdown.x = _arg1.stageX;
mdown.y = _arg1.stageY;
if (!locked){
if (((!(useOwnCursor)) && (useOwnMoveCursor))){
Mouse.hide();
cursor.visible = true;
redrawCursor(_arg1);
};
_local2 = new Date();
_local3 = _local2.getTime();
if ((_local3 - lastMouseDown) < 500){
};
lastMouseDown = _local3;
if (isInFocus){
this.turn = true;
autoplay = false;
};
if (useOwnCursor){
redrawCursor(_arg1);
};
};
}
private function init_cylinder_tiles(){
loadBitmaps();
}
public function init(_arg1:Event):void{
var v:Vector3d;
var cf:Number;
var k:Number;
var text_fmt:TextFormat;
var event = _arg1;
started = false;
removeEventListener(Event.ENTER_FRAME, init);
if (isCylinder){
init_cylinder();
} else {
init_cube();
};
addChild(canv);
panomask = new Shape();
addChild(panomask);
rect.width = windowWidth;
rect.height = windowHeight;
isInFocus = false;
addEventListener(Event.ENTER_FRAME, doEnterFrame, false, 0, true);
try {
if (stage){
stage.addEventListener(KeyboardEvent.KEY_DOWN, doKeyDown, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_UP, doKeyUp, false, 0, true);
stage.addEventListener(Event.RESIZE, doStageResize, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_DOWN, doMouseDown, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, doMouseUp, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_MOVE, doMouseMove, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_WHEEL, doMouseWheel, false, 0, true);
} else {
addEventListener(KeyboardEvent.KEY_DOWN, doKeyDown, false, 0, true);
addEventListener(KeyboardEvent.KEY_UP, doKeyUp, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, doMouseDown, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, doMouseUp, false, 0, true);
addEventListener(MouseEvent.MOUSE_MOVE, doMouseMove, false, 0, true);
addEventListener(MouseEvent.MOUSE_WHEEL, doMouseWheel, false, 0, true);
};
} catch(err:Error) {
};
addEventListener(MouseEvent.MOUSE_MOVE, redrawCursor, false, 0, true);
canv.addEventListener(MouseEvent.MOUSE_OVER, doRollOver, false, 0, true);
canv.addEventListener(MouseEvent.MOUSE_OUT, doRollOut, false, 0, true);
stage.addEventListener(Event.MOUSE_LEAVE, hideCursor, false, 0, true);
try {
if (((stage) && (!((stageMode == ""))))){
if (stageMode == "no"){
stage.scaleMode = StageScaleMode.NO_SCALE;
};
if (stageMode == "stage"){
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
};
if (stageMode == "noborder"){
stage.scaleMode = StageScaleMode.NO_BORDER;
};
if (stageMode == "exact"){
stage.scaleMode = StageScaleMode.EXACT_FIT;
};
};
} catch(err:Error) {
};
setMeshDensity(0);
hotspot_txt = new TextField();
text_fmt = new TextFormat();
text_fmt.font = "Verdana";
text_fmt.size = 12;
text_fmt.color = 0;
text_fmt.align = TextFormatAlign.CENTER;
hotspot_txt.defaultTextFormat = text_fmt;
hotspot_txt.selectable = false;
hotspot_txt.borderColor = 0;
hotspot_txt.backgroundColor = 0xFFFFFF;
hotspot_txt.type = TextFieldType.DYNAMIC;
hotspot_txt.htmlText = "HS";
hotspot_txt.alpha = 70;
hotspot_txt.border = true;
hotspot_txt.background = true;
hotspot_txt.multiline = true;
hotspot_txt.visible = false;
addChild(hotspot_txt);
doStageResize(null);
updateMask();
cursor = new Bitmap();
cursor.bitmapData = new BitmapData(32, 32, true);
root.addChild(cursor);
cursor.addEventListener(MouseEvent.MOUSE_OVER, doRollOver, false, 0, true);
cursor.addEventListener(MouseEvent.MOUSE_OUT, doRollOut, false, 0, true);
cursor.visible = false;
cursorData = new CursorDataClass(0, 0);
if (useOwnCursor){
Mouse.hide();
};
}
public function setFov(_arg1:Number):void{
if (!isNaN(_arg1)){
if (fov.cur != _arg1){
setup_cube();
fov.cur = _arg1;
dirty = true;
};
};
checkLimits();
}
public function doMouseUp(_arg1:MouseEvent):void{
var _local2:Date;
var _local3:Number;
if (((!(useOwnCursor)) && (useOwnMoveCursor))){
Mouse.show();
cursor.visible = false;
};
if (turn){
turn = false;
dirty = true;
};
_local2 = new Date();
_local3 = _local2.getTime();
if (((((((_local3 - lastMouseDown) < 500)) && ((Math.abs((mdown.x - _arg1.stageX)) < 10)))) && ((Math.abs((mdown.y - _arg1.stageY)) < 10)))){
doMouseClick();
};
if (useOwnCursor){
redrawCursor(_arg1);
};
}
public function setFovLimits(_arg1:Number, _arg2:Number):void{
fov.min = _arg1;
fov.max = _arg2;
checkLimits();
}
function doMouseDoubleClick(){
}
public function hideCursor(_arg1:Event):void{
if (((useOwnCursor) || (useOwnMoveCursor))){
cursor.visible = false;
Mouse.show();
};
}
private function checkLimits():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = (fov.cur / 2);
if (_local1 > 55){
_local1 = 55;
fov.cur = (_local1 * 2);
};
_local2 = ((Math.atan(((rect.width / rect.height) * Math.tan(((_local1 * Math.PI) / 180)))) * 180) / Math.PI);
if (_local2 > 55){
_local2 = 55;
_local1 = ((Math.atan(((rect.height / rect.width) * Math.tan(((_local2 * Math.PI) / 180)))) * 180) / Math.PI);
fov.cur = (_local1 * 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 + _local1) > tilt.max){
tilt.cur = (tilt.max - _local1);
};
} else {
if (tilt.cur > tilt.max){
tilt.cur = tilt.max;
};
};
if (tilt.min > -90){
if ((tilt.cur - _local1) < tilt.min){
tilt.cur = (tilt.min + _local1);
};
} else {
if (tilt.cur < tilt.min){
tilt.cur = tilt.min;
};
};
if ((pan.max - pan.min) < 359.99){
_local3 = 0;
if (tilt.cur != 0){
_local6 = (rect.width / 2);
_local7 = (rect.height / 2);
_local4 = (_local6 * Math.tan(((_local2 * Math.PI) / 180)));
_local5 = (_local7 * Math.tan(((_local1 * Math.PI) / 180)));
_local8 = (_local7 / Math.tan(((Math.abs(tilt.cur) * Math.PI) / 180)));
_local8 = (_local8 - _local5);
if (_local8 > 0){
_local3 = ((Math.atan((1 / (_local8 / _local5))) * 180) / Math.PI);
_local3 = ((_local3 * (pan.max - pan.min)) / 360);
};
};
if ((pan.cur + (_local2 + _local3)) > pan.max){
pan.cur = (pan.max - (_local2 + _local3));
if (autoplay){
autorotate_pan = -(autorotate_pan);
dPan = 0;
};
};
if ((pan.cur - (_local2 + _local3)) < pan.min){
pan.cur = (pan.min + (_local2 + _local3));
if (autoplay){
autorotate_pan = -(autorotate_pan);
dPan = 0;
};
};
if ((tilt.cur + _local1) > 90){
tilt.cur = (90 - _local1);
};
if ((tilt.cur - _local1) < -90){
tilt.cur = (-90 + _local1);
};
};
}
private function updateMask():void{
if (((useMask) && (started))){
panomask.graphics.clear();
panomask.graphics.moveTo(rect.left, rect.top);
panomask.graphics.beginFill(136);
panomask.graphics.lineTo((rect.right + 1), rect.top);
panomask.graphics.lineTo((rect.right + 1), (rect.bottom + 1));
panomask.graphics.lineTo(rect.left, (rect.bottom + 1));
panomask.graphics.endFill();
canv.mask = panomask;
} else {
canv.mask = null;
};
}
private function doRollOutHotspot(_arg1:Event){
var hs:MovieClip;
var i:int;
var e = _arg1;
hs = MovieClip(e.currentTarget);
if (onRollOutHotspot != null){
i = 0;
while (i < hotspots.length) {
if (hotspots[i].clip == hs){
try {
onRollOutHotspot(hotspots[i].id, hotspots[i].clip);
} catch(error:Error) {
};
};
i = (i + 1);
};
} else {
if (hs.hasOwnProperty("hstext")){
hs.hstext.visible = false;
};
};
}
private function updateHotspots(_arg1:Matrix4d){
var _local2:Number;
var _local3:Vector3d;
var _local4:Vector3d;
var _local5:Hotspot;
var _local6:Number;
_local3 = new Vector3d();
_local6 = ((rect.height / 2) / Math.tan(((fov.cur * Math.PI) / 360)));
_local2 = 0;
while (_local2 < this.hotspots.length) {
_local5 = this.hotspots[_local2];
_local3.init(0, 0, -1);
_local3.rotx(((_local5.posTilt * Math.PI) / 180));
_local3.roty(((-(_local5.posPan) * Math.PI) / 180));
_local4 = new Vector3d();
_arg1.mulVector(_local3, _local4);
_local4.project(_local6, (rect.width / 2), (rect.height / 2));
_local5.clip.visible = (_local4.pz < 0);
_local5.clip.x = (_local5.ofs.x + _local4.px);
_local5.clip.y = (_local5.ofs.y + _local4.py);
_local2++;
};
}
public function getTilt():Number{
return (tilt.cur);
}
private function paint_cube(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Vector3d;
var _local23:Vector3d;
var _local24:Vector3d;
var _local25:Vector3d;
var _local26:Vector3d;
var _local27:Vector3d;
var _local28:Vector3d;
var _local29:Vector3d;
var _local30:Vector3d;
var _local31:Vector3d;
var _local32:Vector3d;
var _local33:Vector3d;
var _local34:Point;
var _local35:Point;
var _local36:Point;
var _local37:Point;
var _local38:Point;
var _local39:Number;
var _local40:int;
var _local41:int;
_local12 = 50;
_local13 = 1;
_local14 = 0;
_local15 = -0.15;
_local23 = new Vector3d();
_local24 = new Vector3d();
_local25 = new Vector3d();
_local26 = new Vector3d();
_local27 = new Vector3d();
_local28 = new Vector3d();
_local29 = new Vector3d();
if (cubeTiles < 2){
cubeTiles = 2;
};
transformCorners();
framecnt++;
_local13 = 0;
_local14 = -1;
_local16 = rect.width;
_local18 = (_local16 / 2);
_local17 = rect.height;
_local19 = (_local17 / 2);
canv.graphics.clear();
ed = (_local19 / Math.tan(((fov.cur * Math.PI) / 360)));
_local9 = 0;
while (_local9 < 6) {
if (bmpVideo == null){
_local20 = bmp_in[_local9].width;
_local38 = new Point((1 / _local20), (1 / _local20));
} else {
_local20 = (bmpVideo.width / 3);
_local38 = new Point((1 / (_local20 - 8)), (1 / (_local20 - 8)));
};
_local21 = (_local20 / 2);
_local30 = vat[((_local9 * 4) + 0)];
_local31 = vat[((_local9 * 4) + 1)];
_local32 = vat[((_local9 * 4) + 2)];
_local33 = vat[((_local9 * 4) + 3)];
_local4 = 0;
_local5 = 0;
if ((((((_local30.z <= _local31.z)) && ((_local30.z <= _local32.z)))) && ((_local30.z <= _local33.z)))){
_local4 = 0;
_local5 = 0;
};
if ((((((_local31.z <= _local30.z)) && ((_local31.z <= _local32.z)))) && ((_local31.z <= _local33.z)))){
_local4 = 1;
_local5 = 0;
};
if ((((((_local32.z <= _local30.z)) && ((_local32.z <= _local31.z)))) && ((_local32.z <= _local33.z)))){
_local4 = 0;
_local5 = 1;
};
if ((((((_local33.z <= _local30.z)) && ((_local33.z <= _local31.z)))) && ((_local33.z <= _local32.z)))){
_local4 = 1;
_local5 = 1;
};
_local25.interpol4(_local30, _local31, _local32, _local33, _local4, _local5);
_local26.interpol4(_local30, _local31, _local32, _local33, (_local4 + 0.01), _local5);
_local27.interpol4(_local30, _local31, _local32, _local33, _local4, (_local5 + 0.01));
_local28.interpol4(_local30, _local31, _local32, _local33, (_local4 + 0.01), (_local5 + 0.01));
_local25.project(ed, _local18, _local19);
_local26.project(ed, _local18, _local19);
_local27.project(ed, _local18, _local19);
_local28.project(ed, _local18, _local19);
_local23.x = (_local25.px - _local26.px);
_local23.y = (_local25.py - _local26.py);
_local24.x = (_local25.px - _local27.px);
_local24.y = (_local25.py - _local27.py);
if (((_local23.x * _local24.y) - (_local23.y * _local24.x)) > 0){
_local30.project(ed, _local18, _local19);
_local31.project(ed, _local18, _local19);
_local32.project(ed, _local18, _local19);
_local33.project(ed, _local18, _local19);
if (bmpVideo == null){
DisplayTile(bmp_in[_local9], new Point(0, 0), _local38, _local30, _local31, _local32, _local33, cubeTiles, 0);
} else {
_local40 = 0;
_local41 = 0;
_local40 = ((_local20 * (_local9 % 3)) + 4);
_local41 = 4;
if (_local9 >= 3){
_local41 = (_local41 + _local20);
};
DisplayTile(bmpVideo, new Point(_local40, _local41), _local38, _local30, _local31, _local32, _local33, cubeTiles, 0);
};
};
_local9++;
};
}
public function getPan():Number{
return (pan.cur);
}
private function loadBitmaps():void{
var bmp_tmp:Bitmap;
var cf:int;
var cf2:int;
var notLoaded:Boolean;
notLoaded = false;
cf = 0;
while (cf < 6) {
if (!bmp_loaded[cf]){
notLoaded = true;
};
cf = (cf + 1);
};
cf2 = 0;
while (cf2 < (hasHotspots) ? 8 : 6) {
cf = faceOrder[cf2];
try {
if (!bmp_loaded[cf]){
switch (cf2){
case 0:
bmp_in[cf] = new PanoTile0Class(0, 0);
break;
case 1:
bmp_in[cf] = new PanoTile1Class(0, 0);
break;
case 2:
bmp_in[cf] = new PanoTile2Class(0, 0);
break;
case 3:
bmp_in[cf] = new PanoTile3Class(0, 0);
break;
case 4:
bmp_in[cf] = new PanoTile4Class(0, 0);
break;
case 5:
bmp_in[cf] = new PanoTile5Class(0, 0);
break;
case 6:
bmp_in[cf] = new HotspotTile0Class(0, 0);
break;
case 7:
bmp_in[cf] = new HotspotTile1Class(0, 0);
break;
};
bmp_loaded[cf] = true;
tileSize = bmp_in[cf].width;
};
} catch(error:Error) {
if (bmp_in[cf] == null){
if (cf >= 6){
bmp_in[cf] = new BitmapData(128, 128, false, 0);
} else {
if (hasPrevImages){
try {
if (!bmp_loaded[cf]){
switch (cf){
case 0:
bmp_in[cf] = new PanoTilePrev0Class(0, 0);
break;
case 1:
bmp_in[cf] = new PanoTilePrev1Class(0, 0);
break;
case 2:
bmp_in[cf] = new PanoTilePrev2Class(0, 0);
break;
case 3:
bmp_in[cf] = new PanoTilePrev3Class(0, 0);
break;
case 4:
bmp_in[cf] = new PanoTilePrev4Class(0, 0);
break;
case 5:
bmp_in[cf] = new PanoTilePrev5Class(0, 0);
break;
};
};
} catch(error:Error) {
bmp_in[cf] = new BitmapData(128, 128, false, 0xCCCCCC);
bmp_in[cf].noise(23, 0, 95, 7, true);
};
} else {
if (preloadColor < 16777216){
bmp_in[cf] = new BitmapData(128, 128, false, preloadColor);
} else {
bmp_in[cf] = new BitmapData(128, 128, false, 204);
bmp_in[cf].noise(23, 0, 95, 7, true);
};
};
};
};
};
cf2 = (cf2 + 1);
};
if (hasHotspots){
cf = 6;
while (cf < 8) {
if (!bmp_loaded[cf]){
notLoaded = true;
};
cf = (cf + 1);
};
};
if (!notLoaded){
completed = true;
};
}
public function getPositionAngles(_arg1:int, _arg2:int):Point{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Point;
_local3 = (rect.height / (2 * Math.tan(((fov.cur * Math.PI) / 360))));
_local4 = (_arg1 - (rect.width / 2));
_local5 = (_arg2 - (rect.height / 2));
_local6 = new Point();
_local6.x = ((180 * Math.atan((_local4 / _local3))) / Math.PI);
_local6.y = ((180 * Math.atan((_local5 / Math.sqrt(((_local4 * _local4) + (_local3 * _local3)))))) / Math.PI);
return (_local6);
}
public function doKeyUp(_arg1:KeyboardEvent):void{
key_down = false;
dirty = true;
keyShiftDown = _arg1.shiftKey;
keyCtrlDown = _arg1.ctrlKey;
keyAltDown = _arg1.altKey;
}
public function getFov():Number{
return (fov.cur);
}
function controller(_arg1:String, _arg2:Number):Object{
return (controller_callback(_arg1, _arg2));
}
public function controller_callback(_arg1:String, _arg2:Number){
if (_arg2 != undefined){
if (_arg1 == "zoom"){
changeFov(-(_arg2));
return (true);
};
if (_arg1 == "fov"){
changeFov(_arg2);
return (true);
};
if (_arg1 == "pan"){
changePan(_arg2);
return (true);
};
if (_arg1 == "tilt"){
changeTilt(_arg2);
return (true);
};
if (_arg1 == "quality"){
if (_arg2 < 3){
cubeTiles = 4;
};
cubeTiles = _arg2;
return (true);
};
if (_arg1 == "autoplay"){
autoplay = !((_arg2 == 0));
if (_arg2 == 0){
resetlastaction();
};
return (true);
};
if (_arg1 == "autorotate"){
autorotate = !((_arg2 == 0));
return (true);
};
} else {
if ((((_arg1 == "zoom")) || ((_arg1 == "fov")))){
return (fov.cur);
};
if (_arg1 == "pan"){
return (pan.cur);
};
if (_arg1 == "tilt"){
return (tilt.cur);
};
if (_arg1 == "autoplay"){
return ((autoplay) ? 1 : 0);
};
if (_arg1 == "autorotate"){
return ((autorotate) ? 1 : 0);
};
if (_arg1 == "flags"){
return (controllerFlags);
};
};
return (false);
}
public function addQtHotspot(_arg1:Number, _arg2:String, _arg3:String, _arg4:String){
var _local5:Hotspot;
_local5 = new Hotspot();
_local5.id = ("" + _arg1);
_local5.url = _arg3;
_local5.title = _arg2;
_local5.target = _arg4;
_local5.ofs.x = 0;
_local5.ofs.y = 0;
qthotspots[_arg1] = _local5;
}
private function transformCorners():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Vector3d;
var _local5:Vector3d;
var _local6:Matrix4d;
var _local7:Matrix4d;
var _local8:Matrix4d;
_local7 = new Matrix4d();
_local8 = new Matrix4d();
_local7.setRotX((((-(tilt.cur) * 2) * Math.PI) / 360));
_local8.setRotY((((pan.cur * 2) * Math.PI) / 360));
_local6 = Matrix4d.multiply(_local7, _local8);
_local3 = ((rect.height / 2) / Math.tan(((fov.cur * Math.PI) / 360)));
vat = new Array();
_local1 = 0;
while (_local1 < this.va.length) {
_local4 = this.va[_local1];
_local5 = new Vector3d();
_local6.mulVector(_local4, _local5);
vat.push(_local5);
_local4.pz = _local5.z;
if (_local4.pz < 0){
_local2 = (_local3 / _local5.z);
if (_local5.z > -1E-5){
_local2 = 10000;
};
_local4.px = (_local5.x * _local2);
_local4.py = (-(_local5.y) * _local2);
_local4.px = (_local4.px + (rect.width / 2));
_local4.py = (_local4.py + (rect.height / 2));
} else {
_local4.px = (_local5.x * 1000);
_local4.py = (-(_local5.y) * 1000);
};
_local1++;
};
updateHotspots(_local6);
if (enable_callback){
if (onRotate != undefined){
onRotate(pan.cur, tilt.cur, fov.cur);
};
};
}
public function addTextHotspot(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String, _arg5:Number=0, _arg6:Number=0){
var _local7:MovieClip;
_local7 = new UrlHotspotClass();
_local7.hstext.htmlText = _arg4;
if (_arg5 > 0){
_local7.hstext.x = (_local7.hstext.x + ((_local7.hstext.width - _arg5) / 2));
_local7.hstext.width = _arg5;
};
if (_arg6 > 0){
_local7.hstext.height = _arg6;
};
if ((((_arg6 == 0)) && ((_arg5 == 0)))){
_local7.hstext.autoSize = TextFieldAutoSize.CENTER;
};
_local7.hstext.visible = false;
_local7.useHandCursor = false;
addHotspot(_arg1, _arg2, _arg3, _local7);
}
public function reposElements():void{
var _local1:Number;
var _local2:Number;
dirtyMask = true;
}
public function setAutorotate(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean):void{
autorotate_pan = _arg1;
autorotate = !((_arg1 == 0));
if (!isNaN(_arg2)){
autorotate_timeout = _arg2;
};
if (!isNaN(_arg3)){
autorotate_tilt_force = _arg3;
};
autorotate_onlyinfocus = (_arg4 == true);
if (_arg1 == 0){
autoplay = false;
};
}
public function setTiltLimits(_arg1:Number, _arg2:Number):void{
tilt.min = _arg1;
tilt.max = _arg2;
checkLimits();
}
public function doStageResize(_arg1:Event):void{
if (stage){
if (!windowScaleIgnore){
rect.width = stage.stageWidth;
rect.height = stage.stageHeight;
setup_cube();
dirty = true;
dirtyMask = true;
checkLimits();
reposElements();
};
};
}
public function init_faces():void{
if (isCylinder){
init_cylinder_tiles();
} else {
init_cubefaces();
};
started = true;
dirtyMask = true;
dirty = true;
}
public function decodeStrip(_arg1:BitmapData):void{
var _local2:int;
var _local3:int;
var _local4:Rectangle;
var _local5:int;
_local2 = _arg1.width;
_local3 = _arg1.height;
_local5 = 0;
while (_local5 < 6) {
if (_local2 < _local3){
tileSize = _local2;
_local4 = new Rectangle(0, (tileSize * _local5), tileSize, tileSize);
} else {
tileSize = _local3;
_local4 = new Rectangle((tileSize * _local5), 0, tileSize, tileSize);
};
bmp_in[_local5] = new BitmapData(tileSize, tileSize, false);
bmp_in[_local5].copyPixels(_arg1, _local4, new Point(0, 0));
bmp_loaded[_local5] = true;
_local5++;
};
}
public function doMouseMove(_arg1:MouseEvent):void{
mcur.x = _arg1.stageX;
mcur.y = _arg1.stageY;
}
public function setup_cylinder(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_local7 = (pan.max - pan.min);
va = new Array();
_local8 = (_arg1 / (cylTilesX * cylTilesXS));
_local3 = 0;
while (_local3 < (cylTilesX * cylTilesXS)) {
_local9 = Math.cos(((Math.PI / (cylTilesX * cylTilesXS)) * (_local7 / 360)));
_local10 = (((Math.PI / (cylTilesX * cylTilesXS)) * (_local7 / 360)) * 1);
_local11 = ((-(_local10) / _local8) * _arg2);
va.push(new Vector3d(_local10, _local11, _local9, (_local3 * _local8), 0));
va.push(new Vector3d(-(_local10), _local11, _local9, ((_local3 + 1) * _local8), 0));
va.push(new Vector3d(_local10, -(_local11), _local9, (_local3 * _local8), _arg2));
va.push(new Vector3d(-(_local10), -(_local11), _local9, ((_local3 + 1) * _local8), _arg2));
_local5 = 0;
while (_local5 < 4) {
va[((va.length - 4) + _local5)].roty(((((2 * _local3) * _local10) + _local10) + (((-(pan.max) + 180) * Math.PI) / 180)));
_local5++;
};
_local3++;
};
}
public function addUrlHotspot(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String, _arg5:String, _arg6:String, _arg7:Number=0, _arg8:Number=0){
var _local9:MovieClip;
_local9 = new UrlHotspotClass();
_local9.hstext.htmlText = _arg4;
if (_arg7 > 0){
_local9.hstext.x = (_local9.hstext.x + ((_local9.hstext.width - _arg7) / 2));
_local9.hstext.width = _arg7;
};
if (_arg8 > 0){
_local9.hstext.height = _arg8;
};
if ((((_arg8 == 0)) && ((_arg7 == 0)))){
_local9.hstext.autoSize = TextFieldAutoSize.CENTER;
};
_local9.buttonMode = true;
_local9.hstext.visible = false;
addHotspot(_arg1, _arg2, _arg3, _local9, _arg5, _arg6);
}
function unloadHotspots(){
var _local1:Number;
var _local2:Hotspot;
_local1 = 0;
while (_local1 < this.hotspots.length) {
_local2 = this.hotspots[_local1];
canv.removeChild(_local2.clip);
_local2.clip.unloadMovie();
_local1++;
};
}
}
}//package
Section 11
//PanoTile0Class (PanoTile0Class)
package {
import flash.display.*;
public dynamic class PanoTile0Class extends BitmapData {
public function PanoTile0Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 12
//PanoTile1Class (PanoTile1Class)
package {
import flash.display.*;
public dynamic class PanoTile1Class extends BitmapData {
public function PanoTile1Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 13
//PanoTile2Class (PanoTile2Class)
package {
import flash.display.*;
public dynamic class PanoTile2Class extends BitmapData {
public function PanoTile2Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 14
//PanoTile3Class (PanoTile3Class)
package {
import flash.display.*;
public dynamic class PanoTile3Class extends BitmapData {
public function PanoTile3Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 15
//PanoTile4Class (PanoTile4Class)
package {
import flash.display.*;
public dynamic class PanoTile4Class extends BitmapData {
public function PanoTile4Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 16
//PanoTile5Class (PanoTile5Class)
package {
import flash.display.*;
public dynamic class PanoTile5Class extends BitmapData {
public function PanoTile5Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 17
//PanoTilePrev0Class (PanoTilePrev0Class)
package {
import flash.display.*;
public dynamic class PanoTilePrev0Class extends BitmapData {
public function PanoTilePrev0Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 18
//PanoTilePrev1Class (PanoTilePrev1Class)
package {
import flash.display.*;
public dynamic class PanoTilePrev1Class extends BitmapData {
public function PanoTilePrev1Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 19
//PanoTilePrev2Class (PanoTilePrev2Class)
package {
import flash.display.*;
public dynamic class PanoTilePrev2Class extends BitmapData {
public function PanoTilePrev2Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 20
//PanoTilePrev3Class (PanoTilePrev3Class)
package {
import flash.display.*;
public dynamic class PanoTilePrev3Class extends BitmapData {
public function PanoTilePrev3Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 21
//PanoTilePrev4Class (PanoTilePrev4Class)
package {
import flash.display.*;
public dynamic class PanoTilePrev4Class extends BitmapData {
public function PanoTilePrev4Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 22
//PanoTilePrev5Class (PanoTilePrev5Class)
package {
import flash.display.*;
public dynamic class PanoTilePrev5Class extends BitmapData {
public function PanoTilePrev5Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 23
//PanoViewLimits (PanoViewLimits)
package {
public class PanoViewLimits {
public var cur:Number;
public var max:Number;
public var def:Number;
public var min:Number;
public function PanoViewLimits(_arg1:Number, _arg2:Number, _arg3:Number){
init(_arg1, _arg2, _arg3);
}
public function init(_arg1:Number, _arg2:Number, _arg3:Number):void{
this.def = _arg1;
this.min = _arg2;
this.max = _arg3;
this.cur = _arg1;
}
}
}//package
Section 24
//PreloaderClass (PreloaderClass)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class PreloaderClass extends Sprite {
var bar_bgalpha:Number;// = 0.3
var bar_bgcolor:Number;// = 0xFF
public var showAboutPano2VR:Boolean;// = true
var image_anchor:Number;// = 0
var text_str:String;
var stageInit:Boolean;// = false
var bar_alpha:Number;// = 1
var preimgurl:String;// = ""
var bar_color:Number;// = 128
var default_width:int;// = 0
var text_pos:Point;
var image_enabled:Boolean;// = false
var preimg:DisplayObject;
var image_pos:Point;
var text_fmt:TextFormat;
var bar_rect:Rectangle;
var prebar:Shape;
var default_height:int;// = 0
var pretxt:TextField;
public function PreloaderClass(_arg1:XML=null){
image_enabled = false;
bar_bgcolor = 0xFF;
bar_bgalpha = 0.3;
bar_color = 128;
bar_alpha = 1;
bar_rect = new Rectangle(10, 30, 180, 10);
image_anchor = 0;
image_pos = new Point(0, 0);
text_pos = new Point(10, 10);
preimgurl = "";
stageInit = false;
default_width = 0;
default_height = 0;
showAboutPano2VR = true;
super();
pretxt = new TextField();
prebar = new Shape();
text_fmt = new TextFormat();
pretxt.x = 10;
pretxt.y = 10;
pretxt.width = 180;
pretxt.height = 20;
pretxt.autoSize = TextFieldAutoSize.LEFT;
text_fmt.bold = true;
text_fmt.font = "Verdana";
text_fmt.size = 12;
text_str = "Loading... $p %";
pretxt.selectable = false;
pretxt.defaultTextFormat = text_fmt;
pretxt.text = "";
if (_arg1 != null){
xmlConfig(_arg1);
};
stageInit = true;
addEventListener(Event.ENTER_FRAME, doEnterFrame);
}
function pre_image_resize(_arg1:Event){
var _local2:int;
if (stage){
_local2 = image_anchor;
if ((((((_local2 == 1)) || ((_local2 == 4)))) || ((_local2 == 7)))){
prebar.x = ((stage.stageWidth - default_width) / 2);
};
if ((((((_local2 == 3)) || ((_local2 == 4)))) || ((_local2 == 5)))){
prebar.y = ((stage.stageHeight - default_height) / 2);
};
if ((((((_local2 == 2)) || ((_local2 == 5)))) || ((_local2 == 8)))){
prebar.x = (stage.stageWidth - default_width);
};
if ((((((_local2 == 6)) || ((_local2 == 7)))) || ((_local2 == 8)))){
prebar.y = (stage.stageHeight - default_height);
};
if (preimg != null){
preimg.x = (prebar.x + image_pos.x);
preimg.y = (prebar.y + image_pos.y);
};
pretxt.x = (prebar.x + text_pos.x);
pretxt.y = (prebar.y + text_pos.y);
};
}
public function xmlConfig(_arg1:XML):void{
if (_arg1.hasOwnProperty("@anchor")){
image_anchor = _arg1.@anchor;
};
if (_arg1.hasOwnProperty("@width")){
default_width = _arg1.@width;
};
if (_arg1.hasOwnProperty("@height")){
default_height = _arg1.@height;
};
if (_arg1.hasOwnProperty("@hideabout")){
showAboutPano2VR = !((_arg1.@hideabout == 1));
};
if (_arg1.hasOwnProperty("bar")){
if (_arg1.bar.hasOwnProperty("@x")){
bar_rect.left = _arg1.bar.@x;
};
if (_arg1.bar.hasOwnProperty("@y")){
bar_rect.top = _arg1.bar.@y;
};
if (_arg1.bar.hasOwnProperty("@width")){
bar_rect.width = _arg1.bar.@width;
};
if (_arg1.bar.hasOwnProperty("@height")){
bar_rect.height = _arg1.bar.@height;
};
if (_arg1.bar.hasOwnProperty("@color")){
bar_color = _arg1.bar.@color;
};
if (_arg1.bar.hasOwnProperty("@alpha")){
bar_alpha = _arg1.bar.@alpha;
};
if (_arg1.bar.hasOwnProperty("@bgcolor")){
bar_bgcolor = _arg1.bar.@bgcolor;
};
if (_arg1.bar.hasOwnProperty("@bgalpha")){
bar_bgalpha = _arg1.bar.@bgalpha;
};
};
if (_arg1.hasOwnProperty("text")){
if (_arg1.text.hasOwnProperty("@x")){
text_pos.x = _arg1.text.@x;
};
if (_arg1.text.hasOwnProperty("@y")){
text_pos.y = _arg1.text.@y;
};
if (_arg1.text.hasOwnProperty("@color")){
text_fmt.color = _arg1.text.@color;
};
if (_arg1.text.hasOwnProperty("@font")){
text_fmt.font = _arg1.text.@font;
};
if (_arg1.text.hasOwnProperty("@bold")){
text_fmt.bold = (_arg1.text.@bold == 1);
};
if (_arg1.text.hasOwnProperty("@italic")){
text_fmt.italic = (_arg1.text.@italic == 1);
};
if (_arg1.text.hasOwnProperty("@alpha")){
pretxt.alpha = _arg1.text.@alpha;
};
if (_arg1.text.hasOwnProperty("@string")){
text_str = _arg1.text.@string;
};
if (_arg1.text.hasOwnProperty("@anchor")){
if (_arg1.text.@anchor == 0){
pretxt.autoSize = TextFieldAutoSize.LEFT;
};
if (_arg1.text.@anchor == 1){
pretxt.autoSize = TextFieldAutoSize.CENTER;
};
if (_arg1.text.@anchor == 2){
pretxt.autoSize = TextFieldAutoSize.RIGHT;
};
};
pretxt.defaultTextFormat = text_fmt;
};
if (_arg1.hasOwnProperty("image")){
image_enabled = true;
if (_arg1.image.hasOwnProperty("@x")){
image_pos.x = _arg1.image.@x;
};
if (_arg1.image.hasOwnProperty("@y")){
image_pos.y = _arg1.image.@y;
};
if (_arg1.image.hasOwnProperty("@url")){
preimgurl = _arg1.image.@url;
};
};
pre_image_resize(null);
}
function doEnterFrame(_arg1:Event):void{
var x1:Number;
var x2:Number;
var y1:Number;
var y2:Number;
var pr:Number;
var ldr:Loader;
var urlReq:URLRequest;
var tmpstr:String;
var event = _arg1;
if (stageInit){
stageInit = false;
if (stage){
stage.addEventListener(Event.RESIZE, pre_image_resize);
};
if (image_enabled){
if (preimgurl == ""){
try {
preimg = new Bitmap(new PreloadImageClass(0, 0));
} catch(error:Error) {
};
} else {
ldr = new Loader();
urlReq = new URLRequest(preimgurl);
ldr.load(urlReq);
preimg = ldr;
};
if (preimg != null){
preimg.x = image_pos.x;
preimg.y = image_pos.y;
addChild(preimg);
};
};
addChild(pretxt);
addChild(prebar);
pre_image_resize(null);
};
pr = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
if (pr == 1){
} else {
pretxt.visible = true;
tmpstr = text_str;
tmpstr = tmpstr.replace("$p", Math.floor((100 * pr)));
tmpstr = tmpstr.replace("$n", (Math.floor((1000 * pr)) / 1000));
tmpstr = tmpstr.replace("$b", root.loaderInfo.bytesLoaded);
tmpstr = tmpstr.replace("$t", root.loaderInfo.bytesTotal);
tmpstr = tmpstr.replace("$B", Math.floor((root.loaderInfo.bytesLoaded / 1000)));
tmpstr = tmpstr.replace("$T", Math.floor((root.loaderInfo.bytesTotal / 1000)));
pretxt.text = tmpstr;
prebar.graphics.clear();
prebar.graphics.beginFill(bar_bgcolor, bar_bgalpha);
prebar.graphics.lineStyle(2, bar_color, bar_alpha);
x1 = bar_rect.left;
x2 = (x1 + (bar_rect.width * pr));
y1 = bar_rect.top;
y2 = (y1 + bar_rect.height);
prebar.graphics.moveTo(x1, y1);
prebar.graphics.lineTo(x2, y1);
prebar.graphics.lineTo(x2, y2);
prebar.graphics.lineTo(x1, y2);
prebar.graphics.lineTo(x1, y1);
prebar.graphics.endFill();
};
}
public function cleanup(){
removeEventListener(Event.RESIZE, pre_image_resize);
removeEventListener(Event.ENTER_FRAME, doEnterFrame);
}
}
}//package
Section 25
//PreloadImageClass (PreloadImageClass)
package {
import flash.display.*;
public dynamic class PreloadImageClass extends BitmapData {
public function PreloadImageClass(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 26
//ReposBitmapClass (ReposBitmapClass)
package {
import flash.display.*;
import flash.events.*;
public class ReposBitmapClass extends Bitmap {
var reposId:String;
static var imageRepos:ImageRepository = new ImageRepository();
public function ReposBitmapClass(_arg1:String){
reposId = _arg1;
addEventListener(Event.ENTER_FRAME, checkLoaded, false, 0, true);
}
function checkLoaded(_arg1:Event){
var bmd:BitmapData;
var e = _arg1;
try {
bmd = imageRepos.getImage(reposId);
bitmapData = bmd;
removeEventListener(Event.ENTER_FRAME, checkLoaded);
} catch(error:Error) {
};
}
}
}//package
Section 27
//ReposImage_skin_0Class (ReposImage_skin_0Class)
package {
import flash.display.*;
public dynamic class ReposImage_skin_0Class extends BitmapData {
public function ReposImage_skin_0Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 28
//SkinActionClass (SkinActionClass)
package {
import flash.geom.*;
public class SkinActionClass {
public var value2:String;
public var targetId:String;
public var value:String;
public var moveDiff:Point;
public var type:int;
}
}//package
Section 29
//SkinClass (SkinClass)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.net.*;
public class SkinClass extends Sprite {
private var objs:Array;
public var video:VideoPanoClass;
public var pano:PanoCube;
private var imageRepos:ImageRepository;
public var rootSkinObject:SkinObjectClass;
public function SkinClass(_arg1:PanoCube){
var _local2:SkinObjectClass;
super();
imageRepos = new ImageRepository();
pano = _arg1;
_local2 = new SkinObjectClass();
addChild(_local2);
}
public function checkLoaded(_arg1:Event){
var i:int;
var bmd:BitmapData;
var e = _arg1;
i = 0;
while (i < objs.length) {
if (!objs[i].isLoaded){
if (objs[i].irId != ""){
try {
bmd = imageRepos.getImage(objs[i].irId);
objs[i].addChild(new Bitmap(bmd));
objs[i].isLoaded = true;
} catch(error:Error) {
};
};
};
i = (i + 1);
};
}
public function xmlConfig(_arg1:XML):void{
var _local2:XML;
rootSkinObject = new SkinObjectClass();
rootSkinObject.skin = this;
addChild(rootSkinObject);
for each (_local2 in _arg1.element) {
xmlConfigElement(rootSkinObject, _local2);
};
}
function xmlConfigElement(_arg1:SkinObjectClass, _arg2:XML):void{
var x:int;
var y:int;
var skinObj:SkinObjectClass;
var action:XML;
var element:XML;
var a:SkinActionClass;
var rpb:ReposBitmapClass;
var ldr:Loader;
var button:SimpleButton;
var parent = _arg1;
var config = _arg2;
x = 0;
y = 0;
skinObj = new SkinObjectClass();
skinObj.skin = this;
parent.addChild(skinObj);
if (config.hasOwnProperty("@x")){
x = config.@x;
skinObj.x = x;
};
if (config.hasOwnProperty("@y")){
y = config.@y;
skinObj.y = y;
};
skinObj.defaultPos = new Point(x, y);
skinObj.currentPos = new Point(x, y);
for each (action in config.action) {
a = new SkinActionClass();
if (action.hasOwnProperty("@type")){
a.type = action.attribute("type");
};
if (action.hasOwnProperty("@value")){
a.value = action.attribute("value");
};
if (action.hasOwnProperty("@value2")){
a.value2 = action.attribute("value2");
};
a.moveDiff = new Point(x, y);
if (action.hasOwnProperty("@dx")){
a.moveDiff.x = int(action.@dx);
};
if (action.hasOwnProperty("@dy")){
a.moveDiff.y = int(action.@dy);
};
skinObj.actions.push(a);
};
if (config.hasOwnProperty("@img")){
rpb = new ReposBitmapClass(config.@img.toString());
skinObj.addChild(rpb);
};
if (config.hasOwnProperty("@imgurl")){
try {
ldr = new Loader();
ldr.load(new URLRequest(config.@imgurl));
skinObj.addChild(ldr);
} catch(error:Error) {
};
};
if (config.hasOwnProperty("@btn")){
button = new SimpleButton();
button.visible = true;
button.upState = new ReposBitmapClass(config.@btn.toString());
button.hitTestState = button.upState;
if (config.hasOwnProperty("@over")){
button.overState = new ReposBitmapClass(config.@over.toString());
} else {
button.overState = button.upState;
};
if (config.hasOwnProperty("@down")){
button.downState = new ReposBitmapClass(config.@down.toString());
} else {
button.downState = button.overState;
};
button.addEventListener(MouseEvent.CLICK, skinObj.doClick, false, 0, true);
button.addEventListener(MouseEvent.MOUSE_DOWN, skinObj.doMouseDown, false, 0, true);
button.addEventListener(MouseEvent.MOUSE_OVER, skinObj.doMouseOver, false, 0, true);
button.addEventListener(MouseEvent.MOUSE_OUT, skinObj.doMouseOut, false, 0, true);
skinObj.addChild(button);
};
if (config.hasOwnProperty("@btnurl")){
try {
button = new SimpleButton();
button.visible = true;
ldr = new Loader();
ldr.load(new URLRequest(config.@btnurl));
button.upState = ldr;
button.hitTestState = button.upState;
if (config.hasOwnProperty("@overurl")){
ldr = new Loader();
ldr.load(new URLRequest(config.@overurl));
button.overState = ldr;
} else {
button.overState = button.upState;
};
if (config.hasOwnProperty("@downurl")){
ldr = new Loader();
ldr.load(new URLRequest(config.@downurl));
button.downState = ldr;
} else {
button.downState = button.overState;
};
button.addEventListener(MouseEvent.CLICK, skinObj.doClick, false, 0, true);
button.addEventListener(MouseEvent.MOUSE_DOWN, skinObj.doMouseDown, false, 0, true);
button.addEventListener(MouseEvent.MOUSE_OVER, skinObj.doMouseOver, false, 0, true);
button.addEventListener(MouseEvent.MOUSE_OUT, skinObj.doMouseOut, false, 0, true);
skinObj.addChild(button);
} catch(error:Error) {
};
};
if (config.hasOwnProperty("@anchor")){
skinObj.anchor = config.@anchor;
};
if (config.hasOwnProperty("@width")){
skinObj.default_width = config.@width;
} else {
skinObj.default_height = skinObj.width;
};
if (config.hasOwnProperty("@height")){
skinObj.default_height = config.@height;
} else {
skinObj.default_height = skinObj.height;
};
skinObj.updatePosition();
for each (element in config.element) {
xmlConfigElement(skinObj, element);
};
}
}
}//package
Section 30
//SkinObjectClass (SkinObjectClass)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.net.*;
public class SkinObjectClass extends Sprite {
var loader:Loader;
public var currentPos:Point;
var activeState:Boolean;// = false
var stageInit:Boolean;
var default_width:int;
var speed:Number;// = 0.4
public var defaultPos:Point;
var cx:int;
var cy:int;
public var skin:SkinClass;
var mouseIn:Boolean;
var anchor:int;
var isLoaded:Boolean;
var default_height:int;
var mouseDown:Boolean;
var actions:Array;
public function SkinObjectClass(){
speed = 0.4;
actions = new Array();
activeState = false;
super();
isLoaded = false;
irId = "";
anchor = 0;
default_width = 0;
default_height = 0;
mouseDown = false;
mouseIn = false;
defaultPos = new Point(0, 0);
currentPos = new Point(0, 0);
activePos = new Point(0, 0);
stageInit = true;
addEventListener(Event.ENTER_FRAME, doEnterFrame, false, 0, true);
}
public function updatePosition(){
var _local1:int;
var _local2:int;
var _local3:int;
if (parent){
this.transform.matrix = new Matrix();
_local1 = parent.width;
_local2 = parent.height;
if (((((skin) && ((skin.rootSkinObject == parent)))) && (stage))){
_local1 = stage.stageWidth;
_local2 = stage.stageHeight;
};
_local3 = anchor;
if ((((((_local3 == 0)) || ((_local3 == 3)))) || ((_local3 == 6)))){
cx = currentPos.x;
};
if ((((((_local3 == 0)) || ((_local3 == 1)))) || ((_local3 == 2)))){
cy = currentPos.y;
};
if ((((((_local3 == 1)) || ((_local3 == 4)))) || ((_local3 == 7)))){
cx = (currentPos.x + (_local1 / 2));
};
if ((((((_local3 == 3)) || ((_local3 == 4)))) || ((_local3 == 5)))){
cy = (currentPos.y + (_local2 / 2));
};
if ((((((_local3 == 2)) || ((_local3 == 5)))) || ((_local3 == 8)))){
cx = (currentPos.x + _local1);
};
if ((((((_local3 == 6)) || ((_local3 == 7)))) || ((_local3 == 8)))){
cy = (currentPos.y + _local2);
};
x = cx;
y = cy;
};
}
function doMouseUp(_arg1:MouseEvent):void{
mouseDown = false;
}
function doMouseOut(_arg1:MouseEvent):void{
mouseIn = false;
}
function doResize(_arg1:Event):void{
updatePosition();
}
function doEnterFrame(_arg1:Event):void{
var transform:Boolean;
var rot:Number;
var sx:Number;
var sy:Number;
var tx:Number;
var ty:Number;
var action:SkinActionClass;
var ofs:Number;
var factor:Number;
var pan:Number;
var tilt:Number;
var pSkinObj:SkinObjectClass;
var targetPos:Point;
var diff:Point;
var mspeed:Number;
var l:Number;
var mat:Matrix;
var e = _arg1;
if (((!((stage == null))) && (stageInit))){
stageInit = false;
stage.addEventListener(MouseEvent.MOUSE_UP, doMouseUp, false, 0, true);
if (((((parent) && (skin))) && ((skin.rootSkinObject == parent)))){
doResize(null);
stage.addEventListener(Event.RESIZE, doResize);
};
};
transform = false;
rot = 0;
sx = 1;
sy = 1;
tx = 1;
ty = 1;
for each (action in actions) {
ofs = action.value;
if (action.value == ""){
ofs = 1;
};
if (isNaN(ofs)){
ofs = 0;
};
factor = action.value2;
if (action.value2 == ""){
factor = 1;
};
if (isNaN(factor)){
factor = 1;
};
pan = skin.pano.getPan();
while (pan > 180) {
pan = (pan - 360);
};
while (pan < -180) {
pan = (pan + 360);
};
tilt = skin.pano.getTilt();
while (tilt > 180) {
tilt = (tilt - 360);
};
while (tilt < -180) {
tilt = (tilt + 360);
};
if (((mouseDown) && (mouseIn))){
switch (action.type){
case 1:
skin.pano.changePan(speed, true, true);
break;
case 2:
skin.pano.changePan(-(speed), true, true);
break;
case 3:
skin.pano.changeTilt(speed, true, true);
break;
case 4:
skin.pano.changeTilt(-(speed), true, true);
break;
case 5:
skin.pano.changeFov(-(speed), true, true);
break;
case 6:
skin.pano.changeFov(speed, true, true);
break;
};
};
if (action.type == 201){
rot = (rot + ((-(skin.pano.getPan()) * factor) + ofs));
transform = true;
};
if (action.type == 202){
rot = (rot + ((skin.pano.getTilt() * factor) + ofs));
transform = true;
};
if (action.type == 203){
rot = (rot + ((skin.pano.getFov() * factor) + ofs));
transform = true;
};
if (action.type == 211){
sx = Math.cos(((((pan * factor) + ofs) * Math.PI) / 180));
transform = true;
};
if (action.type == 212){
sy = Math.cos(((((pan * factor) + ofs) * Math.PI) / 180));
transform = true;
};
if (action.type == 213){
sx = Math.cos(((((tilt * factor) + ofs) * Math.PI) / 180));
transform = true;
};
if (action.type == 214){
sy = Math.cos(((((tilt * factor) + ofs) * Math.PI) / 180));
transform = true;
};
if (action.type == 215){
sx = (Math.tan(((((skin.pano.getFov() * factor) / 2) * Math.PI) / 180)) + ofs);
transform = true;
};
if (action.type == 216){
sy = (Math.tan(((((skin.pano.getFov() * factor) / 2) * Math.PI) / 180)) + ofs);
transform = true;
};
if (action.type == 221){
tx = ((factor * pan) + ofs);
transform = true;
};
if (action.type == 222){
ty = ((factor * pan) + ofs);
transform = true;
};
if (action.type == 223){
tx = ((factor * tilt) + ofs);
transform = true;
};
if (action.type == 224){
ty = ((factor * tilt) + ofs);
transform = true;
};
if (action.type == 225){
tx = ((factor * skin.pano.getFov()) + ofs);
transform = true;
};
if (action.type == 226){
ty = ((factor * skin.pano.getFov()) + ofs);
transform = true;
};
if ((((action.type == 20)) && (parent))){
try {
pSkinObj = SkinObjectClass(parent);
if (activeState){
targetPos = pSkinObj.defaultPos.add(new Point(action.value, action.value2));
} else {
targetPos = pSkinObj.defaultPos;
};
diff = targetPos.subtract(pSkinObj.currentPos);
if (((!((diff.x == 0))) || (!((diff.y == 0))))){
mspeed = 10;
l = diff.length;
if ((l * 0.3) >= mspeed){
diff.normalize(mspeed);
} else {
if (l > 1.5){
diff.normalize((l * 0.3));
};
};
pSkinObj.currentPos = pSkinObj.currentPos.add(diff);
pSkinObj.updatePosition();
};
} catch(error:Error) {
};
};
};
if (transform){
mat = new Matrix();
mat.tx = (mat.tx - (default_width / 2));
mat.ty = (mat.ty - (default_height / 2));
ofs = action.value;
if (isNaN(ofs)){
ofs = 0;
};
mat.scale(sx, sy);
mat.rotate((1E-15 + ((rot * Math.PI) / 180)));
mat.tx = (mat.tx + (((default_width / 2) + cx) + tx));
mat.ty = (mat.ty + (((default_height / 2) + cy) + ty));
this.transform.matrix = mat;
};
}
function doClick(_arg1:MouseEvent):void{
var _local2:SkinActionClass;
var _local3:URLRequest;
for each (_local2 in actions) {
if (_local2.type == 10){
if (skin.pano.isComplete()){
switch (stage.displayState){
case StageDisplayState.FULL_SCREEN:
stage.displayState = StageDisplayState.NORMAL;
break;
case StageDisplayState.NORMAL:
default:
stage.displayState = StageDisplayState.FULL_SCREEN;
break;
};
};
};
if (_local2.type == 15){
skin.pano.setPan(skin.pano.pan.def);
skin.pano.setTilt(skin.pano.tilt.def);
skin.pano.setFov(skin.pano.fov.def);
};
if (_local2.type == 20){
activeState = !(activeState);
};
if (_local2.type == 30){
skin.pano.autorotate = !(skin.pano.autorotate);
skin.pano.autoplay = skin.pano.autorotate;
};
if (skin.video){
switch (_local2.type){
case 40:
skin.video.play();
break;
case 41:
skin.video.stop();
break;
case 42:
skin.video.pause();
break;
case 43:
skin.video.forward();
break;
case 44:
skin.video.backward();
break;
};
};
if (_local2.type == 100){
_local3 = new URLRequest(_local2.value);
navigateToURL(_local3, _local2.value2);
};
};
}
function doMouseDown(_arg1:MouseEvent):void{
mouseDown = true;
}
function doMouseOver(_arg1:MouseEvent):void{
mouseIn = true;
}
}
}//package
Section 31
//TextHotspotClass (TextHotspotClass)
package {
import flash.display.*;
import flash.text.*;
public dynamic class TextHotspotClass extends MovieClip {
public var hstext:TextField;
}
}//package
Section 32
//UrlHotspotClass (UrlHotspotClass)
package {
import flash.display.*;
import flash.text.*;
public dynamic class UrlHotspotClass extends MovieClip {
public var hstext:TextField;
}
}//package
Section 33
//Vector3d (Vector3d)
package {
import flash.geom.*;
public class Vector3d {
public var px:Number;
public var py:Number;
public var pz:Number;
public var z:Number;
public var u:Number;
public var v:Number;
public var x:Number;
public var y:Number;
public function Vector3d(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.u = _arg4;
this.v = _arg5;
}
public function sub(_arg1:Vector3d):Vector3d{
var _local2:Vector3d;
_local2 = new Vector3d();
_local2.x = (x - _arg1.x);
_local2.y = (y - _arg1.y);
_local2.z = (z - _arg1.z);
return (_local2);
}
public function roty(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local5 = Math.sin(_arg1);
_local4 = Math.cos(_arg1);
_local2 = ((_local4 * x) - (_local5 * z));
_local3 = ((_local5 * x) + (_local4 * z));
x = _local2;
z = _local3;
}
public function rotz(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local5 = Math.sin(_arg1);
_local4 = Math.cos(_arg1);
_local2 = ((_local4 * x) - (_local5 * y));
_local3 = ((_local5 * x) + (_local4 * y));
x = _local2;
y = _local3;
}
public function toString():String{
return ((((((((((("(" + x) + ",") + y) + ",") + z) + ") - (") + px) + ",") + py) + ")"));
}
public function interpol2proj(_arg1:Vector3d, _arg2:Vector3d, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):void{
var _local7:Number;
var _local8:Number;
_local7 = (1 - _arg3);
x = ((_arg1.x * _arg3) + (_arg2.x * _local7));
y = ((_arg1.y * _arg3) + (_arg2.y * _local7));
z = ((_arg1.z * _arg3) + (_arg2.z * _local7));
pz = z;
if (z < 0){
if (z > -1E-5){
_local8 = 10000;
} else {
_local8 = (-(_arg4) / z);
};
px = ((x * _local8) + _arg5);
py = ((y * _local8) + _arg6);
} else {
px = (x * 1000);
py = (y * 1000);
};
}
public function scale(_arg1:Number, _arg2:Number, _arg3:Number):void{
this.x = (this.x * _arg1);
this.y = (this.y * _arg2);
this.z = (this.z * _arg3);
}
public function rotx(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local5 = Math.sin(_arg1);
_local4 = Math.cos(_arg1);
_local2 = ((_local4 * y) + (_local5 * z));
_local3 = ((-(_local5) * y) + (_local4 * z));
y = _local2;
z = _local3;
}
public function move(_arg1:Number, _arg2:Number, _arg3:Number):void{
this.x = (this.x + _arg1);
this.y = (this.y + _arg2);
this.z = (this.z + _arg3);
}
public function interpol4proj(_arg1:Vector3d, _arg2:Vector3d, _arg3:Vector3d, _arg4:Vector3d, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number):Point{
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local10 = (1 - _arg5);
_local11 = (1 - _arg6);
x = ((((_arg1.x * _local10) + (_arg2.x * _arg5)) * _local11) + (((_arg3.x * _local10) + (_arg4.x * _arg5)) * _arg6));
y = ((((_arg1.y * _local10) + (_arg2.y * _arg5)) * _local11) + (((_arg3.y * _local10) + (_arg4.y * _arg5)) * _arg6));
z = ((((_arg1.z * _local10) + (_arg2.z * _arg5)) * _local11) + (((_arg3.z * _local10) + (_arg4.z * _arg5)) * _arg6));
pz = z;
if (z < 0){
if (z > -1E-5){
_local12 = 10000;
} else {
_local12 = (-(_arg7) / z);
};
px = ((x * _local12) + _arg8);
py = ((y * _local12) + _arg9);
} else {
px = (x * 1000);
py = (y * 1000);
};
return (new Point(px, py));
}
public function init(_arg1:Number, _arg2:Number, _arg3:Number):void{
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function project(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Number;
pz = z;
if (z < 0){
_local4 = (-(_arg1) / z);
if (Math.abs(z) < 1E-5){
_local4 = ((z > 0)) ? -10000 : 10000;
};
px = (x * _local4);
py = (y * _local4);
px = (px + _arg2);
py = (py + _arg3);
} else {
px = (x * 1000);
py = (y * 1000);
};
}
public function interpol2(_arg1:Vector3d, _arg2:Vector3d, _arg3:Number):void{
x = ((_arg1.x * _arg3) + (_arg2.x * (1 - _arg3)));
y = ((_arg1.y * _arg3) + (_arg2.y * (1 - _arg3)));
z = ((_arg1.z * _arg3) + (_arg2.z * (1 - _arg3)));
}
public function pdist2(_arg1:Vector3d):Number{
return ((((_arg1.px - px) * (_arg1.px - px)) + ((_arg1.py - py) * (_arg1.py - py))));
}
public function cp(_arg1:Vector3d):void{
_arg1.x = x;
_arg1.y = y;
_arg1.z = z;
_arg1.px = px;
_arg1.py = py;
}
public function project3d(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):void{
pz = z;
if (z < 0){
if (Math.abs(z) < 1E-5){
};
px = ((_arg4 * ((z * _arg1) - (x * _arg3))) / (z - _arg3));
py = ((_arg4 * ((z * _arg2) - (y * _arg3))) / (z - _arg3));
px = (px + _arg5);
py = (py + _arg6);
} else {
px = (x * 1000);
py = (y * 1000);
};
}
public function interpol4(_arg1:Vector3d, _arg2:Vector3d, _arg3:Vector3d, _arg4:Vector3d, _arg5:Number, _arg6:Number):void{
x = ((((_arg1.x * (1 - _arg5)) + (_arg2.x * _arg5)) * (1 - _arg6)) + (((_arg3.x * (1 - _arg5)) + (_arg4.x * _arg5)) * _arg6));
y = ((((_arg1.y * (1 - _arg5)) + (_arg2.y * _arg5)) * (1 - _arg6)) + (((_arg3.y * (1 - _arg5)) + (_arg4.y * _arg5)) * _arg6));
z = ((((_arg1.z * (1 - _arg5)) + (_arg2.z * _arg5)) * (1 - _arg6)) + (((_arg3.z * (1 - _arg5)) + (_arg4.z * _arg5)) * _arg6));
}
public function asPoint():Point{
var _local1:Point;
_local1 = new Point();
_local1.x = px;
_local1.y = py;
return (_local1);
}
}
}//package
Section 34
//VideoPanoClass (VideoPanoClass)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.net.*;
public class VideoPanoClass extends Sprite {
var videoURL:String;
var video:Video;
var dirSound:Boolean;
var lastTime:Number;
var stream:NetStream;
var pano:PanoCube;
public var bmp:BitmapData;
var connection:NetConnection;
var hasImage:Boolean;
public function VideoPanoClass(_arg1:PanoCube){
connection = new NetConnection();
connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
connection.connect(null);
hasImage = false;
bmp = null;
pano = _arg1;
lastTime = -1;
dirSound = true;
addEventListener(Event.ENTER_FRAME, copyVideo);
}
public function pause(){
stream.togglePause();
}
public function stop(){
stream.pause();
stream.seek(0);
}
function copyVideo(_arg1:Event){
var _local2:Number;
var _local3:SoundTransform;
var _local4:Number;
if (bmp != null){
_local2 = stream.time;
if (lastTime != _local2){
lastTime = _local2;
bmp.draw(video);
pano.bmpVideo = bmp;
pano.update();
};
};
if (dirSound){
_local3 = stream.soundTransform;
_local4 = ((Math.cos(((pano.getPan() * Math.PI) / 180)) * 0.5) + 0.5);
_local3.leftToLeft = _local4;
_local3.rightToRight = _local4;
_local3.leftToRight = (1 - _local4);
_local3.rightToLeft = (1 - _local4);
stream.soundTransform = _local3;
};
}
public function backward(){
var _local1:Number;
_local1 = (stream.time - 5);
if (_local1 < 0){
_local1 = 0;
};
stream.seek(_local1);
}
public function onCuePoint(_arg1:Object):void{
}
function connectStream():void{
var _local1:int;
stream = new NetStream(connection);
stream.client = this;
stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
_local1 = 16;
stream.play(videoURL);
}
public function play(){
stream.resume();
}
public function xmlConfig(_arg1:XML):void{
if (_arg1.hasOwnProperty("@url")){
videoURL = _arg1.@url;
};
if (_arg1.hasOwnProperty("@dirsound")){
dirSound = (_arg1.@dirsound == 1);
};
if (videoURL != ""){
connectStream();
};
}
function netStatusHandler(_arg1:NetStatusEvent):void{
switch (_arg1.info.code){
case "NetConnection.Connect.Success":
connectStream();
break;
case "NetStream.Play.StreamNotFound":
break;
case "NetStream.Play.Complete":
stream.resume();
break;
case "NetStream.Play.Stop":
stream.seek(0);
stream.resume();
hasImage = false;
break;
case "NetStream.Buffer.Empty":
hasImage = false;
break;
case "NetStream.Buffer.Full":
hasImage = true;
break;
case "NetStream.Buffer.Flush":
break;
};
}
public function onMetaData(_arg1:Object):void{
bmp = new BitmapData(_arg1.width, _arg1.height);
video = new Video(_arg1.width, _arg1.height);
video.attachNetStream(stream);
}
function securityErrorHandler(_arg1:SecurityErrorEvent):void{
}
public function forward(){
stream.seek((stream.time + 5));
}
public function time():Number{
return (stream.time);
}
}
}//package