Hallo Elli,
ein Prototype ist in dem Sinne schon global.
Das hier löst schonmal dein Problem, wenn ein anderes Object aktiv ist.
PHP-Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var aktivMC:MovieClip;
MovieClip.prototype.alphaTween = function (al) {
var tween_handler:Tween = new Tween (this, "_alpha", Strong.easeIn, this._alpha, al, 3, true);
tween_handler.onMotionFinished = function () {
(this.obj._alpha<=0) ? this.obj.removeMovieClip () : "";
trace (this.obj);
};
};
test.onRelease = function () {
var obj = attachMovie ("testbox", "bla", _root.getNextHighestDepth (), {_x:100, _y:100});
aktivMC.alphaTween (0);
aktivMC = obj;
this.target = obj;
obj._alpha = 0;
obj.alphaTween (100);
};
test2.onRollOver = function () {
var obj = attachMovie ("testbox", "blubb", _root.getNextHighestDepth (), {_x:300, _y:100});
aktivMC.alphaTween (0);
aktivMC = obj;
this.target = obj;
obj._alpha = 0;
obj.alphaTween (100);
};
dein Closebutton erstellst du dann so
PHP-Code:
on(release)
{
this._parent.alphaTween (0);
}