I have a site where I want an swf to load into a panel MC that scales to accomodate it. It works to the extent that the panel MC scales and the swf loads, but when it does load the swf has also incresed in size. For example; the swf is 400x300. The panel MC grows to 400x300 but the loaded swf is much larger, say 700x500. I think the reason is that the placeholder MC that the swf loads into is contained within the panel MC and so it grows to. Does anyone know a way round this? I’ve tried using some code to resize the placeholder MC once the swf has loaded but it doesn’t seem to work. What am I doing wrong?
Here’s the code on the buttons;
on(release){
// reset swf load var
_root.textLoad = false;
// clear movies from other buttons
_root.panel.placeholder.unloadMovie("services.swf");
_root.panel.placeholder.unloadMovie("contact.swf");
// stretch panel
panel.onEnterFrame = function(){
if(_root.textLoad != true ){
_root.widthStretch(400, this._name, 3);
_root.heightStretch(300, this._name,3);
}
};
// set delay and load
var delay = setInterval(aboutReveal, 3000);
function aboutReveal(){
_root.textLoad=true; // set swf load var
_root.panel.placeholder.onEnterFrame = function(){
_root.panel.placeholder.loadMovie("about.swf");
};
clearInterval (delay);
}
}
I’ve used setInterval to allow time for the resize to work nad widthStretch and heightStretch are functions set in the first frame of the main timeline.
Thanks in advance for any help and I apologise if i haven’t explained myself very well.
Cheers.