stop();
var DefaultX = 0;
var DefaultY = 0;
var DefaultValue = true;
var _C = mapMC.Content;
_C._alpha = 0;
_RW = Stage.width;
_RH = Stage.height;
_MW = mapMC._width;
_MH = mapMC._height;
var coordinate:XML = new XML();
coordinate.ignoreWhite = true;
coordinate.load("coordinate.xml");
coordinate.onLoad = function(success)
{
list = coordinate.childNodes[0].childNodes;
for (g = 0; g < list.length; g++)
{
var t = mapMC.attachMovie("arrow", "a" + g, g + 1);
t.angle = g * ((Math.PI * 2) / numOfBalls);
t._x = (list[g].attributes.x - (t._width - 30)) * 4;
t._y = (list[g].attributes.y - (t._height - 7)) * 4;
t.swapDepths(-g);
ContentShow(g);
}
};
function ContentShow(num)
{
var Vlist = coordinate.childNodes[0].childNodes[num];
mapMC["a" + num].onRollOver = function()
{
this.gotoAndPlay(2);
this.swapDepths(1);
this._y = this._y - 4;
new mx.transitions.Tween(_C, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, .5, true);
_C._x = this._x;
_C._y = this._y - 120;
_C._Info.text = Vlist.attributes.alt;
};
mapMC["a" + num].onRollOut = function()
{
this.gotoAndPlay(1);
this.swapDepths(-g);
this._y = this._y + 4;
new mx.transitions.Tween(_C, "_alpha", mx.transitions.easing.Regular.easeOut, 100, 0, .5, true);
};
}
mapMC.onMouseDown = function()
{
this.startDrag(false,0,_RH - _MW,-_MW + _RW,0,_RW);
//计算当前MC在画布的中心点位置。
DefaultX = this._x + (_RW / 2);
DefaultY = this._y + (_RH / 2);
};
mapMC.onMouseUp = function()
{
stopDrag();
};
var myListener:Object = new Object();
myListener.onMouseWheel = function(delta)
{
with (mapMC){
var omx = _xmouse, omy = _ymouse;
_xscale += delta;
_yscale += delta;
_x -= omx * delta / 100;
_y -= omy * delta / 100;
}
_MW = mapMC._width;
_MH = mapMC._height;
};
Mouse.addListener(myListener);
|