Es un mapa
paso la pagina para que veas de donde lo saque http://adn.blam.be/springfield/
paso el codigo
el error es que el mapa en el lado derecho y hacia abajo se psa de largo. no se queda en el limite de la mascara
La posiciones iniciales de x e y era de 0 porque el mapa esta hecho al tamaño de la medida del Stage pero yo cuando lo achica para adaptarlo a mi proyecto no me anduvo mas.
Basicmante quiero saber en donde tengo que modificar los valores de x y. he modificado alguno pero se que me faltan mas y no me ubico adonde.
Gracias espero que ayuden
Ha me olvidaba lo de las imagenes anda perfecto, tengo problema con la posicion del mapa
Código HTML:
function infoOn(line, copy, picture) { infoBulleActive = true; _root.infobulle.gotoAndStop(line); _root.infobulle.info.htmlText = ""; _root.infobulle.info.htmlText = copy; _root.infobulle.imageholder.loadMovie(picture, "imageholder"); } // End of the function function infoOff() { infoBulleActive = false; } // End of the function active = true; _root.infobar = "Hint: Click anywhere on the map to zoom/dezoom"; maskh.initHorizontal(2.000000E-001); maskv.initVertical(2.000000E-001); onEnterFrame = function () { if (active == true) { if (maskh.stateFlag) { bg._x = bg._x + -maskh.pct * 20; if (bg._x > 128.3) { bg._x = 128.3; } // end if if (bg._x < -(bg._width - maskh._width)) { bg._x = -(bg._width - maskh._width); } // end if } // end if if (maskv.stateFlag) { bg._y = bg._y + -maskv.pct * 24; if (bg._y > 134.9) { bg._y = 134.9; } // end if if (bg._y < -(bg._height - maskv._height)) { bg._y = -(bg._height - maskv._height); } // end if } // end if } // end if }; bg.bgImg.useHandCursor = false; bg.bgImg.onRelease = function () { if (active == true) { active = false; new mx.transitions.Tween(bg, "_xscale", mx.transitions.easing.Regular.easeOut, 100, 3.550000E+001, 3.000000E-001, true); new mx.transitions.Tween(bg, "_yscale", mx.transitions.easing.Regular.easeOut, 100, 3.550000E+001, 3.000000E-001, true); new mx.transitions.Tween(bg, "_x", mx.transitions.easing.Regular.easeOut, bg._x, 128.3, 3.000000E-001, true); new mx.transitions.Tween(bg, "_y", mx.transitions.easing.Regular.easeOut, bg._y,134.9, 3.000000E-001, true); } else { var _loc5 = _xmouse / Stage.width ; var _loc4 = _ymouse / Stage.height ; var _loc3 = this._width - Stage.width; var _loc2 = this._height - Stage.height; new mx.transitions.Tween(bg, "_xscale", mx.transitions.easing.Regular.easeOut, 3.550000E+001, 100, 3.000000E-001, true); new mx.transitions.Tween(bg, "_yscale", mx.transitions.easing.Regular.easeOut, 3.550000E+001, 100, 3.000000E-001, true); new mx.transitions.Tween(bg, "_x", mx.transitions.easing.Regular.easeOut, 128.3, -_loc3 * _loc5, 3.000000E-001, true); new mx.transitions.Tween(bg, "_y", mx.transitions.easing.Regular.easeOut, 134.9, -_loc2 * _loc4, 3.000000E-001, true); active = true; } // end else if }; _root.infobulle.swapDepths(1000); infoBulleActive = false; _root.infobulle._alpha = 0; _root.infobulle.onEnterFrame = function () { if (_root.infoBulleActive == true) { if (this._alpha <= 100) { this._alpha = this._alpha + 10; } // end if this._x = _root._xmouse - _root._xmouse / Stage.width * this._width; this._y = _root._ymouse < Stage.height / 2 ? (_root._ymouse + this._height) : (_root._ymouse - 20); } else { if (this._alpha >= 0) { this._alpha = this._alpha - 10; } // end if if (this._alpha < 10) { this._x = -200; this._y = 0; } // end if } // end else if }; stop ();
y aca el otro codigo que se llama "mousereader.as
Código HTML:
class Mousereader { var _width, _xscale, w, _height, _yscale, h, edge1, edge2, pct, stateFlag, onMouseMove, straal, nonedge, pcty, pctx, _xmouse, _ymouse, dispatchEvent; function Mousereader() { mx.events.EventDispatcher.initialize(this); } // End of the function function initHorizontal(pct) { if (pct < 0) { pct = 0; } // end if if (pct > 5.000000E-001) { pct = 5.000000E-001; } // end if w = Math.round(_width / (_xscale / 100)); h = Math.round(_height / (_yscale / 100)); edge1 = w * pct; edge2 = w - edge1; this.pct = 0; stateFlag = false; onMouseMove = executeHorizontal; } // End of the function function initVertical(pct) { if (pct < 0) { pct = 0; } // end if if (pct > 5.000000E-001) { pct = 5.000000E-001; } // end if w = Math.round(_width / (_xscale / 100)); h = Math.round(_height / (_yscale / 100)); edge1 = h * pct; edge2 = h - edge1; this.pct = 0; stateFlag = false; onMouseMove = executeVertical; } // End of the function function initCircular(pct) { if (pct < 0) { pct = 0; } // end if if (pct > 5.000000E-001) { pct = 5.000000E-001; } // end if straal = Math.round(_width / (_xscale / 100) / 2); nonedge = straal - straal * pct * 2; this.pct = pctx = pcty = 0; stateFlag = false; onMouseMove = executeCircular; } // End of the function function initRelative() { w = Math.round(_width / (_xscale / 100)); h = Math.round(_height / (_yscale / 100)); pctx = pcty = 0; stateFlag = false; onMouseMove = executeRelative; } // End of the function function executeHorizontal() { var _loc2 = _xmouse; var _loc4 = _ymouse; var _loc3 = false; if (_loc4 >= 0 && _loc4 <= h) { if (_loc2 >= 0 && _loc2 <= edge1) { pct = 1 - _loc2 / edge1; pct = pct * -1; _loc3 = true; this.dispatchEvent({target: this, type: "mousemove", pct: pct}); } else if (_loc2 >= edge2 && _loc2 <= w) { pct = (_loc2 - edge2) / edge1; _loc3 = true; this.dispatchEvent({target: this, type: "mousemove", pct: pct}); } // end if } // end else if this.switchState(_loc3); } // End of the function function executeVertical() { var _loc4 = _xmouse; var _loc2 = _ymouse; var _loc3 = false; if (_loc4 >= 0 && _loc4 <= w) { if (_loc2 >= 0 && _loc2 <= edge1) { pct = 1 - _loc2 / edge1; pct = pct * -1; _loc3 = true; this.dispatchEvent({target: this, type: "mousemove", pct: pct}); } else if (_loc2 >= edge2 && _loc2 <= h) { pct = (_loc2 - edge2) / edge1; _loc3 = true; this.dispatchEvent({target: this, type: "mousemove", pct: pct}); } // end if } // end else if this.switchState(_loc3); } // End of the function function executeCircular() { var _loc3 = _xmouse; var _loc2 = _ymouse; var _loc4 = Math.sqrt(_loc3 * _loc3 + _loc2 * _loc2); if (_loc4 >= nonedge && _loc4 <= straal) { pct = (_loc4 - nonedge) / (straal - nonedge); var _loc6 = Math.abs(_loc3 / straal); var _loc5 = Math.abs(_loc2 / straal); pctx = pct * _loc6; pcty = pct * _loc5; if (_loc3 < 0) { pctx = pctx * -1; } // end if if (_loc2 < 0) { pcty = pcty * -1; } // end if this.switchState(true); this.dispatchEvent({target: this, type: "mousemove", pct: pct, pctx: pctx, pcty: pcty}); } else { this.switchState(false); } // end else if } // End of the function function executeRelative() { var _loc3 = _xmouse; var _loc2 = _ymouse; if (_loc2 >= 0 && _loc2 <= h && _loc3 >= 0 && _loc3 <= w) { pctx = _loc3 * 2 / w - 1; pcty = _loc2 * 2 / h - 1; this.switchState(true); this.dispatchEvent({target: this, type: "mousemove", pctx: pctx, pcty: pcty}); } else { this.switchState(false); } // end else if } // End of the function function switchState(bol) { if (stateFlag != bol) { if (bol) { this.dispatchEvent({target: this, type: "mouseover", pctx: pctx, pcty: pcty}); } else { this.dispatchEvent({target: this, type: "mouseout", pctx: pctx, pcty: pcty}); } // end else if stateFlag = bol; } // end if } // End of the function } // End of Class