ciao a tutti, in un documento flash nuovo nuovo, ho creato due livelli. Nel primo c'è solo l'as per l'attachsound, nell'altro 8 pulsanti e due riquadri, il primo col fondo colororato è un mc dal nome "clip", l'altro è un'altro mc dal nome "host" ma è vuoto. Ho dato a quest'unico frame con questi oggetti l'as:
loading._visible=0
MovieClip.prototype.size = function(wdth, hght, movie) {
host.unloadMovie()
this.wdth = wdth;
this.hght = hght;
this.onEnterFrame = function() {
w = (this.wdth-this._width)/4;
h = (this.hght-this._height)/4;
if (Math.abs(w)<.1 && Math.abs(h)<.1) {
loading._visible=1
host.loadMovie(movie);
delete this.onEnterFrame;
} else {
this._width += w;
this._height += h;
}
};
};
this.onEnterFrame = function() {
point = new Object();
point.x = clip.mcHost._x;
point.y = clip.mcHost._y;
clip.localToGlobal(point);
this.mc._x = point.x;
this.mc._y = point.y;
this.host._x=point.x
this.host._y=point.y
};
mc.btn1.onRelease = function() {
_root.clip.size(500, 300);
};
mc.btn1.onRollOver = function() {
this.suoni.start();
this.suoni=suono1;
};
mc.btn2.onRelease = function() {
_root.clip.size(450, 280);
};
mc.btn2.onRollOver = function() {
this.suoni.start();
this.suoni=suono1;
};
mc.btn3.onRelease = function() {
_root.clip.size(470, 230, "works.swf");
};
mc.btn3.onRollOver = function() {
this.suoni.start();
this.suoni=suono1;
};
mc.btn4.onRelease = function() {
_root.clip.size(215, 310, "news.swf");
};
mc.btn4.onRollOver = function() {
this.suoni.start();
this.suoni=suono1;
};
mc.btn5.onRelease = function() {
_root.clip.size(240, 330, "contact.swf");
};
mc.btn5.onRollOver = function() {
this.suoni.start();
this.suoni=suono1;
};
mc.btn6.onRelease = function() {
_root.clip.size(320, 200, "partners.swf");
};
mc.btn6.onRollOver = function() {
this.suoni.start();
this.suoni=suono1;
};
mc.btn7.onRelease = function() {
_root.clip.size(500, 250);
};
mc.btn7.onRollOver = function() {
this.suoni.start();
this.suoni=suono1;
};
mc.btn8.onRelease = function() {
_root.clip.size(150, 70);
};
mc.btn8.onRollOver = function() {
this.suoni.start();
this.suoni=suono1;
};
mc.btn9.onRelease = function() {
_root.clip.size(300, 180);
};
mc.btn9.onRollOver = function() {
this.suoni.start();
this.suoni=suono1;
};
mc.btn10.onRelease = function() {
_root.clip.size(150, 200);
};
mc.btn10.onRollOver = function() {
this.suoni.start();
this.suoni=suono1;
};
MovieClip.prototype.fadeColor = function(finalColor, finalAlpha, speed) {
this.percentage = 0;
clearInterval(this.fadeInt);
this.tmpColor = new Color(this);
this.deltaAlpha = finalAlpha-this._alpha;
this.startAlpha = this._alpha;
this.fade = function(target_MC) {
if (target_MC.percentage>=1) {
target_MC.startColor = finalColor;
target_MC._alpha = finalAlpha;
clearInterval(target_MC.fadeInt);
} else {
target_MC.percentage += speed;
target_MC.tmpColor.blendRGB(target_MC.startColor, finalColor, target_MC.percentage);
if (target_MC.deltaAlpha != 0) {
target_MC._alpha = target_MC.startAlpha+(target_MC.deltaAlpha*target_ MC.percentage);
}
}
};
this.fadeInt = setInterval(this.fade, 40, this);
};
ASSetPropFlags(MovieClip.prototype, "fadeColor", 1, 0);
Color.prototype.blendRGB = function(c1, c2, t) {
if (arguments.length == 2) {
t = c2;
c2 = this.getRGB();
}
if (t<-1) {
t = -1;
} else if (t>1) {
t = 1;
}
if (t<0) {
t = 1+t;
}
c1 = c1.HEXtoRGB();
c2 = c2.HEXtoRGB();
var ct = (c1.rb+(c2.rb-c1.rb)*t) << 16 | (c1.gb+(c2.gb-c1.gb)*t) << 8 | (c1.bb+(c2.bb-c1.bb)*t);
this.setRGB(ct);
return ct;
};
Number.prototype.HEXtoRGB = function() {
return {rb:this >> 16, gbthis >> 8) & 0xff, bb:this & 0xff};
};
_root.clip.startColor = 0xFC763D;
_root.xnew = 25;
stop();
in modo che premendo su un pulsante questo ridimensioni il mc "clip" nella misura indicata per ognuno e ne cambi il colore di fondo.
fino qui tutto funge...
ma ad esempio per il bottone "news" c'è l'inghippo!
Praticamente questo carica in "host" l'swf esterno (news.swf) che però non cariva le news prese da un file .txt... cosa che invece il file news.swf fa benissimo se aperto da solo, cioè non dallo stage completo!
Spero di essere stato chiaro.
Mi aiutereste a capire dove sbaglio?!
Grazie 10000