Hello,
i've been trying to get this to work for 2 days now but i'm getting tired of it.
As far as loading the external swf into the holder. That's working fine. The tricky part is getting the holder to reposition when the browser is being resized. Right now it doesn't respond to the code. When i don't load the external swf into the movieclip with the instancename "holder" however, the movieclip does respond to the actionscript and repositions upon resizing the browser.
This is the code i'm using for it:
ActionScript Code:
Stage.align = "LT"; // base measurements on the top left corner of the movie
Stage.scaleMode = "noScale"; // prevent items being scaled by default when the movie is resized
// external swf loader //
var mcl = new MovieClipLoader();
var mclL = new Object();
mcl.addListener(mclL);
mcl.loadClip("ext.swf", holder);
// external swf loader //
holder.onResize = function() {
// set the point we want the clip to move to
this.targetX = 800;
this.targetY = -100;
this.onEnterFrame = reposition;
};
Stage.addListener(holder);
holder.onResize();
function reposition() {
// move towards the target position
this._x += (this.targetX - this._x) / 6;
this._y += (this.targetY - this._y) / 6;
// if we are very close to the target position - stop
if (Math.round(this._x) == Math.round(this.targetX) && Math.round(this._y) == Math.round(this.targetY)) {
this._x = this.targetX;
this._y = this.targetY;
delete this.onEnterFrame;
}
}
Help would be greatly appreciated, this is driving me nuts.