Ex:
+--------------------------+
| Particle.swf |
+--------------------------+
| |
| |
| Body |
| |
| |
+--------------------------+
Tentei de diversas maneiras mas infelizmente não consegui. Ele sempre é executado na Cena inteira e não apenas no topo. Tentei criar um MC vazio e carregar o swf dentro e não funfou
Link para baixar o Swf e Fla
Senha: 102030
O filme particle.swf possui 1 shape com a imagem da partícula e 2 mc, e sua cena principal é de 600x70px.
Segue o código:
MC - Sprite3
CODE
function init()
{
makeFloats(200);
} // End of the function
function makeFloats(num)
{
var _loc1 = num;
for (i = 0; i < _loc1; i++)
{
attachMovie("particle", "p" + i, i);
} // end of for
} // End of the function
init();
{
makeFloats(200);
} // End of the function
function makeFloats(num)
{
var _loc1 = num;
for (i = 0; i < _loc1; i++)
{
attachMovie("particle", "p" + i, i);
} // end of for
} // End of the function
init();
MC - Sprite2(particle)
CODE
function init()
{
setProperty("", _x, 1000 + Math.random() * 100);
setProperty("", _y, Math.random() * 600);
life = Math.random() * 400;
xt = Math.random() * 3.141593E+000;
yt = Math.random() * 3.141593E+000;
xdt = Math.random() / 10;
ydt = Math.random() / 10;
dx = -4;
size = Math.random() * 30;
divsize = life / size;
rotdiv = Math.random();
} // End of the function
function float()
{
setProperty("", _width, life / divsize);
setProperty("", _height, life / divsize);
xt = xt + xdt;
yt = yt + ydt;
setProperty("", _x, _x + dx + Math.sin(xt) * -3);
setProperty("", _y, _y + Math.sin(yt) * 2);
setProperty("", _rotation, _x * rotdiv);
--life;
if (life < 0)
{
init();
} // end if
} // End of the function
this.onEnterFrame = function ()
{
float();
};
init();
{
setProperty("", _x, 1000 + Math.random() * 100);
setProperty("", _y, Math.random() * 600);
life = Math.random() * 400;
xt = Math.random() * 3.141593E+000;
yt = Math.random() * 3.141593E+000;
xdt = Math.random() / 10;
ydt = Math.random() / 10;
dx = -4;
size = Math.random() * 30;
divsize = life / size;
rotdiv = Math.random();
} // End of the function
function float()
{
setProperty("", _width, life / divsize);
setProperty("", _height, life / divsize);
xt = xt + xdt;
yt = yt + ydt;
setProperty("", _x, _x + dx + Math.sin(xt) * -3);
setProperty("", _y, _y + Math.sin(yt) * 2);
setProperty("", _rotation, _x * rotdiv);
--life;
if (life < 0)
{
init();
} // end if
} // End of the function
this.onEnterFrame = function ()
{
float();
};
init();
Tentei carregar o filme basicamente de 2 maneiras:
1º
Criando um MC transparente do tamanho que escolhi e adicionando o código:
CODE
loadMovie("particle.swf", alvo);
2º
CODE
_root.createEmptyMovieClip("alvo", 1);
loadMovie("particle.swf", alvo);
alvo._x = 100;
alvo._y = 70;
loadMovie("particle.swf", alvo);
alvo._x = 100;
alvo._y = 70;
Em todas as tentativas o filme é carregado normalmente, mas ele ocupa a cena TODA! Preciso deixa apenas no topo!!!
Alguma idéia??
Obrigado!!!

Help














