Frame 1
function zoomTo(perc) {
this.onEnterFrame = function () {
myPanViewer.zoom = myPanViewer.zoom + ((perc - myPanViewer.zoom) * 0.2);
if (Math.abs(myPanViewer.zoom - perc) < 0.1) {
myPanViewer.zoom = perc;
delete this.onEnterFrame;
}
};
}
zoomIn_btn.onRelease = function () {
zoomTo(myPanViewer.zoom + 10);
};
zoomOut_btn.onRelease = function () {
zoomTo(myPanViewer.zoom - 10);
};
Instance of Symbol 20 MovieClip [360PanViewerPro] "myPanViewer" in Frame 1
//component parameters
onClipEvent (construct) {
__source = "http://www.heraldleaderphoto.com/wp/wp-content/uploads/2008/09/sharpieguypano_400h.jpg";
engine = "flash player > 7";
__is360 = true;
__speedIndex = 20;
__slowdownIndex = 5;
mouseAction = "press";
autoPanOn = true;
horizontalSpeed = 4;
verticalSpeed = 0;
delay = 3;
useDisplacement = false;
angleIndex = 60;
distortionIndex = 150;
}
Symbol 19 MovieClip [360Pointer] Frame 1
stop();
Symbol 20 MovieClip [360PanViewerPro] Frame 1
#initclip 9
Object.registerClass("360PanViewerPro", gr.ground.pan360.ViewerPro);
#endinitclip
stop();
Symbol 1 MovieClip [__Packages.gr.ground.pan360.ViewerPro] Frame 0
class gr.ground.pan360.ViewerPro extends MovieClip
{
var pan, removeListener, xmlPan, addListener, __get__source, boundingBox_mc, __source, useDisplacement, distortionIndex, angleIndex, __slowdownIndex, __speedIndex, __is360, mouseAction, _height, _width, createEmptyMovieClip, hotSpots, engine, _xscale, _yscale, preloader, attachMovie, broadcastMessage, autoPanOn, delay, horizontalSpeed, verticalSpeed, overHotSpot, pointer, intID, xAuto, yAuto, onEnterFrame;
function ViewerPro () {
super();
init();
}
function set zoom(perc) {
pan.zoom = perc;
//return(zoom);
}
function get zoom() {
return(pan.zoom);
}
function set is360(b) {
pan.is360 = b;
//return(is360);
}
function get is360() {
return(pan.is360);
}
function set speedIndex(i) {
pan.speedIndex = 3000 / (i + 5);
//return(speedIndex);
}
function get speedIndex() {
return(pan.speedIndex);
}
function set slowDownIndex(i) {
pan.slowDownIndex = 1000 / i;
//return(slowDownIndex);
}
function get slowDownIndex() {
return(pan.slowDownIndex);
}
function set source(s) {
var _local2 = s.split(".");
var _local4 = _local2[_local2.length - 1];
if (_local4 == "xml") {
removeListener(xmlPan);
delete xmlPan;
xmlPan = new gr.ground.pan360.PanXML(s, this);
addListener(xmlPan);
} else {
setImage(s);
}
//return(__get__source());
}
function init() {
boundingBox_mc._visible = false;
AsBroadcaster.initialize(this);
source = (__source);
}
function getIniObj(uIni) {
var _local3 = {width:_width, height:_height, mouseAction:mouseAction, is360:__is360, speedIndex:__speedIndex, slowDownIndex:__slowdownIndex, angleIndex:angleIndex, distortionIndex:distortionIndex, useDisplacement:useDisplacement};
for (var _local4 in uIni) {
_local3[_local4] = uIni[_local4];
}
return(_local3);
}
function setImage(img, iniObj, hotSpotsArr) {
if (pan) {
pan.destroy();
}
pan = createEmptyMovieClip("pan", 1);
iniObj = getIniObj(iniObj);
hotSpots = hotSpotsArr;
if (engine == "flash player > 7") {
gr.ground.pan360.Displaced.create(pan, iniObj);
} else {
gr.ground.pan360.Flat.create(pan, iniObj);
}
pan.addListener(this);
var _local2 = Boolean(img.split(".").length == 1);
if (!_local2) {
setPreloader();
}
pan.setImage(img, _local2);
_xscale = (_yscale = 100);
boundingBox_mc._width = (boundingBox_mc._height = 0);
}
function setPreloader() {
preloader = attachMovie("360Display", "preloader", 1000);
preloader.rect._width = pan.width;
preloader.rect._height = pan.height;
preloader.gfx._x = (pan.width - preloader.gfx._width) / 2;
preloader.gfx._y = (pan.height - preloader.gfx._height) / 2;
}
function onPanLoading(p) {
preloader.gfx.pfield = p;
broadcastMessage("onProgress", p);
}
function onPanInit() {
if (autoPanOn) {
startAutoPan(delay, horizontalSpeed, verticalSpeed);
}
preloader.removeMovieClip();
if (hotSpots != undefined) {
for (var _local2 in hotSpots) {
createHotSpot(hotSpots[_local2]);
}
}
overHotSpot = false;
broadcastMessage("onLoad");
}
function onPanStart() {
pointer = attachMovie("360Pointer", "pointer", 999);
gr.ground.ui.MousePointer.create(pointer);
stopAutoPan();
broadcastMessage("onStart");
}
function onPanEnd() {
pointer.destroy();
if (autoPanOn) {
startAutoPan(delay, horizontalSpeed, verticalSpeed);
}
broadcastMessage("onEnd");
}
function onPanOver() {
broadcastMessage("onOver");
}
function onPanOut() {
pointer.destroy();
broadcastMessage("onOut");
}
function onPanMove(xv, yv, x, y, w) {
if (overHotSpot) {
pointer.gotoAndStop(overHotSpot.name);
} else {
pointer.gotoAndStop("_move");
var _local2 = (180 * Math.atan(yv / xv)) / Math.PI;
if (xv < 0) {
_local2 = _local2 + 180;
}
pointer._rotation = _local2 + 180;
}
var _local3 = (((x + (pan.width / 2)) * 100) / w) % 100;
broadcastMessage("onMove", x, y, _local3);
}
function onPanStop() {
pointer.gotoAndStop("_stop");
broadcastMessage("onStop");
}
function killInterval() {
clearInterval(intID);
delete intID;
}
function startAutoPan(d, vx, vy) {
horizontalSpeed = vx;
verticalSpeed = vy;
killInterval();
xAuto = (-horizontalSpeed) / 30;
yAuto = (-verticalSpeed) / 30;
intID = setInterval(this, "doPan", d * 1000);
}
function doPan() {
killInterval();
onEnterFrame = function () {
this.pan.velocity(this.xAuto, this.yAuto);
};
}
function stopAutoPan() {
killInterval();
delete onEnterFrame;
}
function onPanEdge(dir) {
if (onEnterFrame) {
if ((dir == "left") || (dir == "right")) {
xAuto = xAuto * -1;
} else {
yAuto = yAuto * -1;
}
doPan();
}
broadcastMessage("onEdge", dir);
}
function createHotSpot(obj) {
var _local2 = pan.createHotSpot(obj);
}
function onHotSpot(evName, hs) {
if (evName == "over") {
pointer = attachMovie("360HotSpotPointer", "pointer", 999);
gr.ground.ui.MousePointer.create(pointer);
overHotSpot = hs;
} else if (evName == "out") {
if (pan.onEnterFrame == pan.loop) {
pointer = attachMovie("360Pointer", "pointer", 999);
gr.ground.ui.MousePointer.create(pointer);
} else {
pointer.destroy();
}
overHotSpot = false;
}
broadcastMessage("onHotSpot", evName, hs);
}
function setPosition(x, y) {
pan.velocity(x, y, true);
}
}
Symbol 21 MovieClip [__Packages.gr.ground.pan360.PanXML] Frame 0
class gr.ground.pan360.PanXML
{
var panViewer, events, x;
function PanXML (s, m) {
panViewer = m;
init(s);
}
function init(path) {
events = {};
x = new XML();
x.ignoreWhite = true;
var tl = this;
x.onLoad = function (s) {
if (!s) {
trace("Error loading XML file.");
} else {
tl.onLoadXML();
}
};
x.load(path);
}
function onLoadXML() {
var _local5 = {};
var _local4 = x.childNodes[0].childNodes[0].childNodes;
for (var _local10 in _local4) {
var _local3 = _local4[_local10].nodeName;
switch (_local3) {
case "hotspots" :
var _local7 = parseHotSpots(_local4[_local10].childNodes);
break;
case "path" :
var _local8 = _local4[_local10].childNodes[0].nodeValue;
break;
case "autopan" :
parseAutoPan(_local4[_local10].childNodes);
break;
case "displacement" :
_local5.useDisplacement = true;
var _local2 = _local4[_local10].childNodes;
for (var _local9 in _local2) {
_local5[_local2[_local9].nodeName] = _local2[_local9].childNodes[0].nodeValue;
}
break;
default :
var _local6 = _local4[_local10].childNodes[0].nodeValue;
if (_local3 == "mouseAction") {
_local5[_local3] = _local6;
} else if (_local3 == "is360") {
_local5[_local3] = ((_local6 == "true") ? true : false);
} else {
_local5[_local3] = parseInt(_local6);
}
}
}
panViewer.setImage(_local8, _local5, _local7);
}
function parseHotSpots(a) {
var _local7 = [];
var _local4;
var _local2;
var _local3;
for (var _local8 in a) {
_local4 = a[_local8].attributes;
_local2 = a[_local8].childNodes;
for (var _local6 in _local2) {
_local3 = _local2[_local6].nodeName;
if (_local3 == "events") {
parseEvents(_local4.name, _local2[_local6].childNodes);
} else {
_local4[_local3] = parseInt(_local2[_local6].childNodes[0].nodeValue);
}
}
_local7.push(_local4);
}
return(_local7);
}
function parseAutoPan(a) {
var _local5 = {};
var _local3;
for (var _local4 in a) {
_local3 = a[_local4].nodeName;
panViewer[_local3] = parseInt(a[_local4].childNodes[0].nodeValue);
}
}
function parseEvents(hsName, evs) {
var _local6 = (events[hsName] = {});
var _local3;
for (var _local7 in evs) {
_local3 = evs[_local7].attributes.action;
if (_local3) {
_local6[evs[_local7].nodeName] = {f:_local3, p:evs[_local7].childNodes[0].nodeValue};
}
}
}
function onHotSpot(ev, mc) {
var c = events[mc.name][ev];
if (c != undefined) {
if (c.f == "load") {
panViewer.__set__source(c.p);
} else {
eval (c.f)(c.p);
}
}
}
}
Symbol 22 MovieClip [__Packages.gr.ground.pan360.Panner] Frame 0
class gr.ground.pan360.Panner extends MovieClip
{
var overMC, mcLoader, speedIndex, slowDownIndex, _parent, _name, _x, _y, width, height, mouseAction, onEnterFrame, checkHotSpot, broadcastMessage, xMove, begX, yMove, begY, velocity, lastEvent;
function Panner () {
super();
}
function get mouseIsOver() {
return(overMC.hitTest(_root._xmouse, _root._ymouse, false));
}
function init(iniObj) {
mcLoader = new MovieClipLoader();
mcLoader.addListener(this);
AsBroadcaster.initialize(this);
if (iniObj) {
for (var _local3 in iniObj) {
this[_local3] = iniObj[_local3];
}
}
speedIndex = 3000 / (speedIndex + 5);
slowDownIndex = 1000 / slowDownIndex;
}
function enableControl() {
overMC = _parent.createEmptyMovieClip(_name + "Over", 2);
overMC._x = _x;
overMC._y = _y;
overMC.beginFill(16711680, 0);
overMC.lineTo(width, 0);
overMC.lineTo(width, height);
overMC.lineTo(0, height);
overMC.lineTo(0, 0);
overMC.endFill();
var tl = this;
if (mouseAction == "press") {
overMC.onPress = function () {
tl.panSwitch(true);
tl.begX = this._xmouse;
tl.begY = this._ymouse;
tl.checkHotSpot("press");
};
overMC.onRelease = (overMC.onReleaseOutside = function () {
tl.panSwitch(false);
tl.checkHotSpot("release");
});
} else if (mouseAction == "over") {
overMC.onPress = function () {
tl.checkHotSpot("press");
};
overMC.onRelease = function () {
tl.checkHotSpot("release");
};
overMC.onRollOver = function () {
tl.panSwitch(true);
tl.begX = this._width / 2;
tl.begY = this._height / 2;
};
} else {
overMC.onPress = function () {
tl.checkHotSpot("press");
};
overMC.onRelease = function () {
tl.checkHotSpot("release");
};
}
overMC.useHandCursor = false;
onEnterFrame = checkHotSpot;
}
function panSwitch(b, begX, begY) {
if (b) {
panSwitch(false);
onEnterFrame = loop;
broadcastMessage("onPanStart");
} else {
broadcastMessage("onPanEnd");
onEnterFrame = checkHotSpot;
}
}
function loop() {
if (mouseIsOver) {
xMove = overMC._xmouse - begX;
xMove = (-xMove) / speedIndex;
yMove = overMC._ymouse - begY;
yMove = (-yMove) / speedIndex;
velocity(xMove, yMove);
checkHotSpot();
if (lastEvent != "over") {
broadcastMessage("onPanOver");
lastEvent = "over";
}
} else {
var _local2 = (1 + (slowDownIndex / 1000)) * 1.02;
xMove = xMove / _local2;
yMove = yMove / _local2;
if (Math.abs(xMove) < 0.01) {
xMove = 0;
}
if (Math.abs(yMove) < 0.01) {
yMove = 0;
}
if (((mouseAction == "over") && (xMove == 0)) && (yMove == 0)) {
panSwitch(false);
}
velocity(xMove, yMove);
if (lastEvent != "out") {
broadcastMessage("onPanOut");
lastEvent = "out";
}
}
}
}
Symbol 23 MovieClip [__Packages.gr.ground.pan360.HotSpot] Frame 0
class gr.ground.pan360.HotSpot
{
var mcLoader, id, mc, borderColor, height, width, x, y;
function HotSpot (pan, obj) {
init(pan, obj);
}
function init(pan, obj) {
mcLoader = new MovieClipLoader();
mcLoader.addListener(this);
if (!obj.name) {
obj.name = "hotSpot_" + ncounter;
ncounter++;
}
for (var _local3 in obj) {
this[_local3] = obj[_local3];
}
if (id) {
var _local4 = Boolean(id.split(".").length == 1);
if (_local4) {
mc = pan.attachMovie(id, "hotSpot_" + counter, 100 + counter);
initMC();
} else {
mc = pan.createEmptyMovieClip("hotSpot_" + counter, 100 + counter);
mcLoader.loadClip(id, mc);
}
} else {
mc = pan.createEmptyMovieClip("hotSpot_" + counter, 100 + counter);
mc.beginFill(color, alpha);
if (borderColor) {
mc.lineStyle(1, borderColor, alpha);
}
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
mc.endFill();
initMC();
}
counter++;
}
static function duplicate(pan, c, xplus) {
var _local2 = {};
for (var _local3 in c) {
_local2[_local3] = c[_local3];
}
_local2.x = c.x + xplus;
_local2.duplicate = true;
return(new gr.ground.pan360.HotSpot(pan, _local2));
}
function onLoadInit(target) {
initMC();
}
function initMC() {
if (width) {
mc._width = width;
}
if (height) {
mc._height = height;
}
mc._x = x;
mc._y = y;
}
static var counter = 0;
static var ncounter = 0;
var color = 16776960;
var alpha = 10;
}
Symbol 24 MovieClip [__Packages.gr.ground.pan360.DMap] Frame 0
class gr.ground.pan360.DMap
{
function DMap (mc, w, h, perc) {
init(mc, w, h, perc);
}
function init(mc, w, h, perc) {
var _local2 = mc.createEmptyMovieClip("rb", 1);
var _local9 = new flash.geom.Matrix();
_local9.createGradientBox(w, h, (Math.PI/2), 0, 0);
var _local6 = {colors:[16711680, 255], alphas:[100, 100], ratios:[0, 255], spread:"pad", matrix:_local9};
drawGradient(_local2, w, h, _local6);
_local2 = mc.createEmptyMovieClip("gray", 2);
_local9.createGradientBox(w / 2, h, 0, 0, 0);
var _local3 = 255 - (255 * (perc / 100));
_local6 = {colors:[8421504, 8421504, 8421504], alphas:[0, 50, 100], ratios:[0, _local3 / 2, _local3], spread:"reflect", matrix:_local9};
drawGradient(_local2, w, h, _local6);
}
function drawGradient(mc, w, h, gObj) {
with (mc) {
beginGradientFill("linear", gObj.colors, gObj.alphas, gObj.ratios, gObj.matrix, gObj.spread);
lineTo(0, h);
lineTo(w, h);
lineTo(w, 0);
lineTo(0, 0);
endFill();
}
}
}
Symbol 25 MovieClip [__Packages.gr.ground.pan360.Displaced] Frame 0
class gr.ground.pan360.Displaced extends gr.ground.pan360.Panner
{
var __proto__, init, realW, realH, width, height, zoomMap, realMap, prevX, prevY, hotspots, _visible, mc1, attachMovie, createEmptyMovieClip, mcLoader, broadcastMessage, newX0, newY0, visMap, attachBitmap, useDisplacement, angleIndex, dMap, filter, distortionIndex, enableControl, onEnterFrame, speedIndex, is360, filters, __get__mouseIsOver, _xmouse, _ymouse, curHotSpot;
function Displaced (mc, iniObj) {
super();
mc.__proto__ = __proto__;
mc.__constructor__ = gr.ground.pan360.Displaced;
this=mc;//parameter overwritten
init(iniObj);
}
function set zoom(perc) {
var _local2 = perc / 100;
var _local3 = zoom / 100;
if ((realW == 2880) && (_local2 > _local3)) {
return;
}
var _local4 = (realW / _local3) * _local2;
var _local5 = (realH / _local3) * _local2;
if (_local4 < width) {
_local2 = (width * _local3) / realW;
_local4 = width;
_local5 = (realH / _local3) * _local2;
}
if (_local5 < height) {
_local2 = (height * _local3) / realH;
_local4 = (realW / _local3) * _local2;
_local5 = height;
}
if (_local4 > 2880) {
_local2 = (2880 * _local3) / realW;
_local4 = 2880;
_local5 = (realH / _local3) * _local2;
}
if (_local5 > 2880) {
_local2 = (2880 * _local3) / realH;
_local4 = (realW / _local3) * _local2;
_local5 = 2880;
}
realW = _local4;
realH = _local5;
__zoom = _local2 * 100;
applyZoom(_local2, _local3);
//return(zoom);
}
function applyZoom(p, z) {
zoomMap = new flash.display.BitmapData(realW, realH, true, 0);
zoomMap.draw(realMap, new flash.geom.Matrix(p, 0, 0, p, 0, 0));
var _local2 = p / z;
var _local5 = ((width * _local2) - width) / 2;
var _local4 = ((height * _local2) - height) / 2;
velocity((prevX * _local2) + _local5, (prevY * _local2) + _local4, true);
}
function get zoom() {
return(__zoom);
}
static function create(mc, iniObj) {
var _local1 = new gr.ground.pan360.Displaced(mc, iniObj);
}
function setImage(s, toAttach) {
hotspots = [];
_visible = false;
if (toAttach) {
mc1 = attachMovie(s, "mc1", 1);
onLoadInit();
} else {
mc1 = createEmptyMovieClip("mc1", 1);
mcLoader.loadClip(s, mc1);
}
}
function onLoadInit(target) {
realW = mc1._width;
realH = mc1._height;
initPan();
}
function onLoadProgress(target, l, t) {
var _local2 = Math.round((l / t) * 100);
broadcastMessage("onPanLoading", _local2);
}
function initPan() {
newX0 = (newY0 = 0);
realMap = new flash.display.BitmapData(realW, realH, true, 0);
realMap.draw(mc1);
zoomMap = realMap;
visMap = new flash.display.BitmapData(width, height, true, 0);
visMap.draw(mc1);
attachBitmap(visMap, 1);
mc1.removeMovieClip();
if (useDisplacement) {
var _local2 = createEmptyMovieClip("dmap", 3);
var _local3 = new gr.ground.pan360.DMap(_local2, width, height, angleIndex);
dMap = new flash.display.BitmapData(width, height, false, 16711680);
dMap.draw(_local2);
_local2.removeMovieClip();
filter = new flash.filters.DisplacementMapFilter(dMap, new flash.geom.Point(0, 0), 1, 1, 0, distortionIndex, "wrap");
}
velocity(0, 0);
enableControl();
_visible = true;
broadcastMessage("onPanInit");
}
function destroy() {
realMap.dispose();
visMap.dispose();
zoomMap.dispose();
delete onEnterFrame;
}
function velocity(x, y, doit) {
if (!doit) {
newX0 = newX0 - Math.round((x * 1000) / speedIndex);
newY0 = newY0 - Math.round((y * 1000) / speedIndex);
} else {
newX0 = x;
newY0 = y;
}
if (newX0 > realW) {
newX0 = newX0 - realW;
} else if (newX0 < 0) {
if (!is360) {
newX0 = 0;
broadcastMessage("onPanEdge", "left");
} else {
newX0 = realW + newX0;
}
}
if (newY0 > (realH - height)) {
newY0 = realH - height;
broadcastMessage("onPanEdge", "bottom");
} else if (newY0 < 0) {
newY0 = 0;
broadcastMessage("onPanEdge", "top");
}
var _local2;
var _local3 = realW - newX0;
if (width > _local3) {
if (!is360) {
newX0 = realW - width;
_local3 = width;
broadcastMessage("onPanEdge", "right");
}
_local2 = new flash.geom.Rectangle(newX0, newY0, _local3, height);
visMap.copyPixels(zoomMap, _local2, new flash.geom.Point(0, 0));
_local2 = new flash.geom.Rectangle(0, newY0, width - _local3, height);
visMap.copyPixels(zoomMap, _local2, new flash.geom.Point(_local3, 0));
} else {
_local2 = new flash.geom.Rectangle(newX0, newY0, width, height);
visMap.copyPixels(zoomMap, _local2, new flash.geom.Point(0, 0));
}
if (useDisplacement) {
filters = [filter];
}
if ((newX0 != prevX) || (newY0 != prevY)) {
broadcastMessage("onPanMove", prevX - newX0, prevY - newY0, newX0, newY0, realW);
} else {
broadcastMessage("onPanStop");
}
prevX = newX0;
prevY = newY0;
}
function createHotSpot(obj) {
mc1 = createEmptyMovieClip("mc1", 11);
mc1.attachBitmap(realMap, 1);
var _local2 = new gr.ground.pan360.HotSpot(mc1, obj);
_local2.bounds = new flash.geom.Rectangle(_local2.x, _local2.y, _local2.mc._width, _local2.mc._height);
hotspots.push(_local2);
realMap = new flash.display.BitmapData(mc1._width, mc1._height, false, 16711680);
realMap.draw(mc1);
mc1.removeMovieClip();
applyZoom(1, 1);
}
function checkHotSpot(evName) {
if (!__get__mouseIsOver()) {
return(undefined);
}
if (useDisplacement && (hotspots.length > 0)) {
var _local8 = (dMap.getPixel(_xmouse, _ymouse) >> 16) & 255;
var _local10 = (_local8 - 128) / 128;
var _local11 = _ymouse + ((distortionIndex * _local10) / 2);
} else {
var _local11 = _ymouse;
}
var _local7 = zoom / 100;
var _local6 = prevX + _xmouse;
if (_local6 > realW) {
_local6 = _local6 - realW;
}
var _local9 = prevY + _local11;
var _local4 = new flash.geom.Point(_local6 / _local7, _local9 / _local7);
for (var _local5 in hotspots) {
var _local2 = hotspots[_local5];
if (_local2.bounds.containsPoint(_local4)) {
if (evName == undefined) {
if (curHotSpot != _local2) {
evName = "over";
broadcastMessage("onHotSpot", evName, _local2);
curHotSpot = _local2;
}
} else {
broadcastMessage("onHotSpot", evName, _local2);
}
} else if (curHotSpot == _local2) {
broadcastMessage("onHotSpot", "out", _local2);
delete curHotSpot;
}
}
}
var __zoom = 100;
}
Symbol 26 MovieClip [__Packages.gr.ground.pan360.Flat] Frame 0
class gr.ground.pan360.Flat extends gr.ground.pan360.Panner
{
var __proto__, init, width, _width, height, _height, overMC, _x, _y, _xscale, _yscale, hotspots, _visible, mc1, attachMovie, is360, mc2, createEmptyMovieClip, mcLoader, broadcastMessage, enableControl, setMask, maskRight, maskBottom, onEnterFrame, prevX, prevY, curHotSpot;
function Flat (mc, iniObj) {
super();
mc.__proto__ = __proto__;
mc.__constructor__ = gr.ground.pan360.Flat;
this=mc;//parameter overwritten
init(iniObj);
}
function set zoom(perc) {
var _local2 = perc / 100;
var _local3 = zoom / 100;
if ((_local2 * _width) < width) {
return;
}
if ((_local2 * _height) < height) {
return;
}
__zoom = _local2 * 100;
var _local4 = (Math.abs(_x) + overMC._x) + (width / 2);
var _local5 = (Math.abs(_y) + overMC._y) + (height / 2);
_xscale = (_yscale = _local2 * 100);
_x = _x - (_local4 * ((_local2 / _local3) - 1));
_y = _y - (_local5 * ((_local2 / _local3) - 1));
keepInMask();
//return(zoom);
}
function get zoom() {
return(__zoom);
}
static function create(mc, iniObj) {
var _local1 = new gr.ground.pan360.Flat(mc, iniObj);
}
function setImage(s, toAttach) {
hotspots = [];
removeHotSpot("all");
_visible = false;
if (toAttach) {
mc1 = attachMovie(s, "mc1", 1);
if (is360) {
mc2 = attachMovie(s, "mc2", 2);
}
initPan();
} else {
mc1 = createEmptyMovieClip("mc1", 1);
mcLoader.loadClip(s, mc1);
}
}
function onLoadInit(target) {
if ((target == mc1) && (is360)) {
mc2 = createEmptyMovieClip("mc2", 2);
mcLoader.loadClip(target._url, mc2);
} else {
initPan();
}
}
function onLoadProgress(target, l, t) {
var _local2 = Math.round((l / t) * 100);
broadcastMessage("onPanLoading", _local2);
}
function initPan() {
enableControl();
setMask(overMC);
maskRight = _x + width;
maskBottom = _y + height;
if (is360) {
mc2._x = mc1._width;
for (var _local3 in hotspots) {
var _local2 = gr.ground.pan360.HotSpot.duplicate(this, hotspots[_local3], mc1._width);
hotspots.push(_local2);
}
}
_visible = true;
broadcastMessage("onPanInit");
}
function destroy() {
mc1.removeMovieClip();
mc2.removeMovieClip();
delete onEnterFrame;
}
function velocity(x, y, doit) {
if (!doit) {
_x = _x + (x * 8);
_y = _y + (y * 8);
} else {
_x = -x;
_y = -y;
}
keepInMask(x, y);
}
function keepInMask(x, y) {
if (_x > overMC._x) {
if (is360) {
_x = _x - ((mc1._width * zoom) / 100);
} else {
_x = overMC._x;
broadcastMessage("onPanEdge", "left");
}
}
if ((_x + _width) < maskRight) {
if (is360) {
_x = _x + ((mc1._width * zoom) / 100);
} else {
_x = maskRight - _width;
broadcastMessage("onPanEdge", "right");
}
}
if (_y > overMC._y) {
_y = overMC._y;
broadcastMessage("onPanEdge", "top");
}
if ((_y + _height) < maskBottom) {
_y = maskBottom - _height;
broadcastMessage("onPanEdge", "bottom");
}
var _local2 = -_x;
if (_local2 > mc1._width) {
_local2 = _local2 - mc1._width;
}
var _local3 = -_y;
if ((prevX != _local2) || (prevY != _local3)) {
broadcastMessage("onPanMove", x, y, _local2, _local3, mc1._width);
} else {
broadcastMessage("onPanStop");
}
prevX = _local2;
prevY = _local3;
}
function createHotSpot(obj) {
var _local2 = new gr.ground.pan360.HotSpot(this, obj);
hotspots.push(_local2);
if (is360 && (mc2)) {
hotspots.push(gr.ground.pan360.HotSpot.duplicate(this, _local2, mc1._width));
}
}
function removeHotSpot(hs) {
for (var _local4 in hotspots) {
var _local2 = hotspots[_local4].mc;
trace(_local2);
hs = "all";
if (hs) {
removeHotSpot(_local2);
} else {
_local2.removeMovieClip();
hotspots.splice(_local4, 1);
}
}
}
function checkHotSpot(evName) {
for (var _local5 in hotspots) {
var _local3 = hotspots[_local5];
if (_local3.mc.hitTest(_root._xmouse, _root._ymouse, false)) {
if (evName == undefined) {
if (curHotSpot != _local3.mc) {
evName = "over";
broadcastMessage("onHotSpot", evName, _local3);
curHotSpot = _local3.mc;
}
} else {
broadcastMessage("onHotSpot", evName, _local3);
}
} else if (curHotSpot == _local3.mc) {
broadcastMessage("onHotSpot", "out", _local3);
delete curHotSpot;
}
}
}
var __zoom = 100;
}
Symbol 27 MovieClip [__Packages.gr.ground.ui.MousePointer] Frame 0
class gr.ground.ui.MousePointer extends MovieClip
{
var __proto__, _x, _parent, _y, removeMovieClip;
function MousePointer (mc) {
super();
mc.__proto__ = __proto__;
mc.__constructor__ = gr.ground.ui.MousePointer;
this=mc;//parameter overwritten
init();
}
static function create(mc) {
var _local1 = new gr.ground.ui.MousePointer(mc);
}
function init() {
Mouse.hide();
onMouseMove();
}
function onMouseMove() {
_x = Math.round(_parent._xmouse);
_y = Math.round(_parent._ymouse);
updateAfterEvent();
}
function destroy() {
Mouse.show();
removeMovieClip();
}
}