Groups | Blog | Home
all groups > flash (macromedia) > may 2007 >

flash (macromedia) : Re-size imported swfs?


David Stiller
5/3/2007 11:02:51 PM
ggaarde,

[quoted text, click to view]

Yes. You can resize loaded SWFs any way you like. :)

[quoted text, click to view]

The "trick" is to wait until the SWF has fully loaded, otherwise you'll
be trying to adjust the width and height of something that really isn't
there yet.

http://www.quip.net/blog/2006/flash/how-to-tell-when-external-swf-loaded/


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."

ggaarde
5/3/2007 11:52:13 PM
I have a html site that I want to change to Flash.
I like the fact that I can import live working mini versions of my web sites
in html pages.
Can I import a swf file into a main movie but change its dimensions to have
the swf that might be 780 x 450 pixels appear in say just 550 pixel width?

If so, how??

Sincerely,
ggaarde
David Stiller
5/14/2007 12:58:32 AM
ggaarde,

[quoted text, click to view]

You will have loaded that SWF into a movie clip container of some sort
(either a level, the main timeline, or a movie clip symbol). Reference that
movie clip object and adjust its _width/_height or _xscale/_yscale
properties.

[quoted text, click to view]

Well, let's imagine you loaded your SWF into a movie clip with the
instance name "container"; in that case, once you've determined that the
content has loaded, you would reference that clip's instance name and the
properties as desired:

container._xscale = 50;
container._yscale = 50;

That would set the "container" movie clip (and thus it's loaded SWF
content) to half its actual size. See the "MovieClip class" entry in the
ActionScript 2.0 Language Reference for the full set of properties available
to you.


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."

ggaarde
5/14/2007 3:36:58 AM
David Stiller

Thank you for your input.
But when I know the movie has loaded fully, how do I go about reducing the
size?
Do you have a fla that shows the code?

Thank you on beforehand.

gggaarde
05.13.07
ggaarde
5/14/2007 4:27:29 PM
Hi David

Thank you so much. I will give it my best try.

ggaarde
8/20/2007 4:37:03 AM
Hi David Stiller.
Are you still there? Sorry its been a while.

I have managed to import a swf into a swf and set its size and x and y
position.
But I wanted a whole site to show in mini format. And if the site lives in one
single swf, it works fine. But most of
my sites run from a master swf that imports other swf's. The master will
import in the specified size. But all following swf files will import in their
full size. Is there some universal code that will make all files that are
imported into the
container movie clip adjust to the new size?

Hope to hear from you soon.

Thanks on before hand.

Sincerely

ggaarde
08.19.07

stop();
var mcl:MovieClipLoader = new MovieClipLoader();
mcl.loadClip("http://www.soundoil.com/CombFlash/CombFlash3.swf", container);
trace("Loading started!");
trace("File width is: " + container._width);
var mclListener:Object = new Object();
mclListener.onLoadInit = function(mc:MovieClip) {
trace("Loading complete!");
trace("File width is: " + mc._width);
};
mcl.addListener(mclListener);
container._xscale = 56;
container._yscale = 56;
container._x = 305
container._y = 82
AddThis Social Bookmark Button