Hey all,
Iam trying to do the following for my website.
I have a swf that fades in images at the click of a button but i want to remove the buttons from the main swf and have them on their own in a new swf but still control the fading movie.
Any ideas?
Here is the code i am using
Button Code
bt1.onRelease = function() {
loadFade("img1.jpg", _root.destino);
};
bt2.onRelease = function() {
loadFade("img2.jpg", _root.destino);
};
bt3.onRelease = function() {
loadFade("img3.jpg", _root.destino);
};
Fader code
Stage.scaleMode = "noScale"
/****************************************************/
/* Criando o MovieClipLoader */
var meuMVL:MovieClipLoader = new MovieClipLoader();
var meuListener:Object = new Object();
meuListener.onLoadProgress = function(alvo:Object, bLoad:Number, bTotal:Number) {
_root.carrega.text = Math.round(bLoad/bTotal*100)+" %";
};
meuListener.onLoadComplete = function() {
_root.carrega.text = "";
onEnterFrame = function () {
_root.destino._alpha += 10;
if (_root.destino._alpha>=100) {
delete this.onEnterFrame;
}
};
};
meuMVL.addListener(meuListener);
/****************************************************/
/* Criando o um Protótipo para ficar + simples de usar o fade entre os swfs/imgs */
_global.MovieClip.prototype.loadFade = function(img_mc, dest_mc) {
dest_mc._alpha = 100;
onEnterFrame = function () {
dest_mc._alpha -= 10;
if (dest_mc._alpha<=0) {
delete this.onEnterFrame;
_root.meuMVL.loadClip(img_mc, dest_mc);
}
};
};