Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Oi Galera, tudo bom?!
Estou tendo um probleminha... pois tenho um background q está com o ActionScript 2.0 mas no site em flash q tento carregar ele não consigo, na documentação do site diz que o site só aceita em AS3.
Alguém poderia me ajudar na conversão do código, porque de ActionScript não manjo nada =/
Segue o código abaixo:
Stage.scaleMode = "noScale";
Stage.align = "TL";
//
grad._x = 0;
grad._y = 0;
grad._width = Stage.width;
grad._height = Stage.height;
textureGrad_mc._width = Stage.width;
textureGrad_mc._height = Stage.height;
//
var stageListener:Object = new Object ();
stageListener.onResize = function () {
grad._x = 0;
grad._y = 0;
grad._width = Stage.width;
grad._height = Stage.height;
textureGrad_mc._width = Stage.width;
textureGrad_mc._height = Stage.height;
};
Stage.addListener (stageListener);//-------------------------------------------------------------------------------------------------------
//define number of layer.
var layer = 10;
//number of items in a layer
var items = 50;
//create the bg that holds the layers
this.createEmptyMovieClip ("bgHolder",this.getNextHighestDepth ());
//this function will update the layers current position
function updateMovies () {
//easingStrenth
easing = 30;
this.x = _root._xmouse;
this.y = _root._ymouse;
//get the linear relation fo x.
var linearRelation = (Stage.width - this._width) / Stage.width;
//update x with easing.
this._x -= (this._x - linearRelation * this.x) / easing;
//get the linear relation fo y.
linearRelation = (Stage.height - this._height) / Stage.height;
//update y with easing.
this._y -= (this._y - linearRelation * this.y) / easing;
}
//init function for the layers
function init () {
for (i = 0; i < layer; i++) {
//create a layer
temp = this.bgHolder.createEmptyMovieClip ("bg" + i, this.bgHolder.getNextHighestDepth ());
depth = temp.getNextHighestDepth ();
//put the items into the layer
for (j = 0; j < items; j++) {
depth = temp.getNextHighestDepth ();
//attach an item
tempN = temp.attachMovie ("icon", "icon" + depth, depth);
//
if (i < 5) {
if (i == 0) {
ZigoEngine.doTween (tempN,'Blur_blurX, Blur_blurY',[10, 10],2,"easeOutExpo");
}
else {
ZigoEngine.doTween (tempN,'Blur_blurX, Blur_blurY',[5 / i, 5 / i],2,"easeOutExpo");
}
}
//position it randomly in the current layer
tempN._x = Math.random () * (i + 2) * Stage.width;
tempN._y = Math.random () * (i + 2) * Stage.height;
//scale it randomly
rand = Math.random ();
tempN._xscale *= .2 + rand;
tempN._yscale *= .2 + rand;
//put is opacity randomly
tempN._alpha = random (80) + 20;
}
//each layer share the same updating function.
temp.onEnterFrame = this.updateMovies;
}
}
init ();
Ficaria muito agradecido se aalguém pudesse me ajudar =D
Desde já agradeço pessoal.
Fiquem com Deus! =)
Carregando comentários...