Macromedia Flash 8问题:
我有一张爱尔兰地图,只是一张gif,有几个小按钮代表了爱尔兰周围的各种兴趣点,它们散布在地图上。这部分运行得很好。
问题是:都柏林太小了,无法容纳所有的兴趣点(大约20个)。
解决方案是OnMouseOver都柏林,我希望都柏林能够扩展到原来的5到6倍,我希望现在能够在位于爱尔兰地图顶部的更大的都柏林区域内显示都柏林的兴趣点。
OnMouseOut都柏林,这个扩大的都柏林区域现在缩小到原来的大小。
我的问题是:如何实现都柏林??
要求: 1)扩展的都柏林区域不应该是可点击的,它应该是黑色背景上的都柏林图像。
2)必须能够在这个扩展的都柏林区域中添加额外的按钮。
任何帮助或帮助都非常感谢...
发布于 2010-03-23 17:01:21
假设您放大的都柏林地图是一个包含所有按钮等的movieClip,您可以捕获剪辑的onRollOver事件来开始缩放,如下所示:
// d is an object containing all the variables we need for where to start & finish
var d:Object = {
start_x:dublin._x,
start_y:dublin._y,
start_xscale:dublin._xscale,
start_yscale:dublin._yscale,
end_x:0.5*Stage.width,// change end_x and end_y...
end_y:0.5*Stage.height,//... to suit your layout
end_xscale:100,
end_yscale:100,
totalSteps:10,// zoom in 10 steps (more steps = slower)
currentStep:0
};
//dublin is set to be invisible (but rollOver-able) to start with
dublin._alpha = 0;
//the doStep function does a single stage of the zoom (once per frame)
function doStep(clip):Void {
var fraction=d.currentStep/d.totalSteps;
clip._x = d.start_x+(d.end_x-d.start_x)*fraction;
clip._y = d.start_y+(d.end_y-d.start_y)*fraction;
clip._xscale = d.start_xscale+(d.end_xscale-d.start_xscale)*fraction;
clip._yscale = d.start_yscale+(d.end_yscale-d.start_yscale)*fraction;
};
//catch rollOver and rollOut events for the dublin clip:
dublin.onRollOver = function() {
if (d.currentStep<d.totalSteps) {
//start growing
this._alpha=100;
this.onEnterFrame = function() {
d.currentStep++;
doStep(this);
if (d.currentStep>=d.totalSteps) {
delete this.onEnterFrame;
}
};
}
};
dublin.onRollOut = function() {
if (d.currentStep>0) {
//start shrinking
this.onEnterFrame = function() {
d.currentStep--;
doStep(this);
if (d.currentStep<=0) {
delete this.onEnterFrame;
this._alpha=0;
}
};
}
};要实现这一点,请执行以下操作:
希望这能有所帮助。
发布于 2010-03-22 02:53:54
您可以使用该地图进行缩放:http://www.graphic-flash-sources.com/interactive-flash-map-with-zoom-united-kingdom-ireland/
https://stackoverflow.com/questions/2484187
复制相似问题