Resize external swf movie to stage size

Hello to everyone - this is my first post in here :wink:

What i try to do, is to make a “wrapper” in Flash, in which other swfs could be embedded. (passing the URL of the external SWF by URL) to attach a link to the swfs. (ClickTag - Issue, maybe someone knows this)

In the HTML - Code this would look like this:


<embed src="wrapper.swf" ...>
<param name="filename" value="path-to-external-swf.swf"/>
<param name="clickTag" value="http://www.example.com"/>

The SWF “wrapper.swf” should load the “path-to-external-swf.swf” an puts a onClick - Event on the whole area.

That works just fine, BUT :wink:

The loaded external SWF should always fit to the stage size (like 100% width and 100% height)

My code looks like this:


// Variables should be passed by URL
_root.filename = "http://example.com/animation.swf";
_root.clickTag = "http://www.example2.com";

Stage.scaleMode = 'exactFit';

var mClip:MovieClip = new MovieClip();

// Create new listener for setting the clip size to stage size
var mcListener:Object = new Object();
mcListener.onLoadInit = function(targetMovieClip:MovieClip) {
    
    targetMovieClip._width = Stage.width;
    targetMovieClip._height = Stage.height;
    
    mClip = targetMovieClip;
    
}

// Create MovieClip 'mcContainer'
createEmptyMovieClip("mcContainer", getNextHighestDepth());
mcContainer.createEmptyMovieClip("mcContent", getNextHighestDepth());

// Create mcLoader 'mcLoader'
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(mcListener);

// Load clip
mcLoader.loadClip(_root.filename, mcContainer.mcContent);

// Attach onclick event and link to the url
mcContainer.onRelease = function () {
    
    _root.getURL("http://www.google.at", "_blank");  
    
    //### CODE SNIPPET 1 ###
    mClip._width = Stage.width;
    
}


When i try to embed this file, it always fits the height, but not the width. But now look at CODE SNIPPET 1 in the onClick - Section:

mClip._width = Stage.width;

When i click on the swf, the movie fits exactly to the stage width…

Can you tell me what is going wrong here? I would be very appreciated if someone of you could give me a hint…

Greets,
Rene