我有一个flash 文件
内容如下,实现的功能就是 拖拽鼠标画圆,功能以实现。
代码如下:
function circleforbase() {
_root.createEmptyMovieClip("circle", 0);
circle.lineStyle(1, 0x000000, 100);
var th = 0;
var step = 0.01;
with (circle) {
moveTo(100, 0);
do {
th += step;
lineTo(Math.cos(th)*100, Math.sin(th)*100);
} while (th<=Math.PI*2);
_visible = 0;
}
}
circleforbase();
n = 0;
f = 0;
stx = 0;
sty = 0;
enx = 0;
eny = 0;
function drawoval(sx,sy,ex,ey,n){
_root.circle.duplicateMovieClip("cir"+n,n);
with(_root["cir"+n]){
_xscale = Math.abs(ex-sx)/2;
_yscale = Math.abs(ey-sy)/2;
_x = 0.5*(sx+ex);
_y = 0.5*(sy+ey);
}
}
var flag:Boolean=true;
_root.onMouseDown = function(){
f = 1;
stx = _root._xmouse;
sty = _root._ymouse;
n++;
}
_root.onMouseUp = function(){
f=0;
}
_root.onMouseMove = function(){
if (f){
enx = _root._xmouse;
eny = _root._ymouse;
drawoval(stx,sty,enx,eny,n);
}
}
我有两个图层,最底层为 命名为out 第二层 为out1 上段代码 是写在out1 :帧 1 动作上。
现在问题来了,我想给flash动态的换背景,为什么 我每次loadMovie的时候 背景显示出来了 而不能用鼠标画圈了。
由于没弄flash 不明白 是怎么回事儿, 朋友说是设置层叠次序问题,可我不会,还望高人没给点儿详细的方法 我怎么每次换背景的时候 还能有那个画圈的功能