页面出现星星

来源:互联网 发布:淘宝pid获取 编辑:程序博客网 时间:2024/04/30 23:07

 主场景代码

parcela = 0.2;
inercia = 0.45;
cont = 2;
while (cont <= 10) {
 duplicateMovieClip ("estr1", "estr" + cont, cont);
 this["estr" + cont]._x = estr1._x;
 this["estr" + cont]._y = estr1._y;
 cont++;
}


onClipEvent (enterFrame) {
    if (_name == "estr1") {
        alvoX = _root._xmouse;
        alvoY = _root._ymouse;
    } else {
        num = Number(_name.substr(4, _name.length - 4)) - 1;
        alvoX = _root["estr" + num]._x;
        alvoY = _root["estr" + num]._y;
     }
    contX = (alvoX - _x) * _root.parcela + contX * _root.inercia;
    contY = (alvoY - _y) * _root.parcela + contY * _root.inercia;
    _x  += contX;
    _y  += contY;
}

属性:estr1


影片1

if (inipointer != 1) {
 inipointer = 1;
 numchamas = 4;
 cont = 2;
 while (numchamas >= cont) {
  duplicateMovieClip ("fogo1", "fogo" + cont, cont);
  posX = Math.random() * 15;
  posY = Math.random() * 15;
  alternaX = Math.random() * 10;
  alternaY = Math.random() * 10;
  if (alternaX <= 5) {
   alternaX = 1;
  } else {
   alternaX = -1;
   }
  if (alternaY <= 5) {
   alternaY = 1;
  } else {
   alternaY = -1;
   }
  this["fogo" + cont]._x += posX * alternaX;
  this["fogo" + cont]._y += posY * alternaY;
  cont++;
 }
}
playmc = Math.floor(math.random() * numchamas) + 1;
this["fogo" + playmc].play();


onClipEvent (enterFrame) {
    rot = rot + 2;
    if (rot >= 360) {
        rot = 0;
    }
    _rotation  = rot;
}

属性
fogo1