Load external SWF into Flash and resize it

Hi

I have external file , that I need to load into my FLASH project.

Problem is that when I'm loading it , it changes the size to all the screen , but I want it to be smaller.

Please advice.

Attached current code.
on (press) {
	_root.createEmptyMovieClip("container", 1);
	loadMovie("http://localhost/skyhighband/flashgallery.swf?content_path=images&color_path=default.xml&allowFullScreen=false&script_path=flashgallery.php", "container");
	container._x = 0 ;
	container._y = 0 ;
	container.height = 300 ;
	container.width = 400 ;
	
}

Open in new window

jekamanAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Aneesh ChopraCommented:
replace your code with following updated code:


on (press) {
	var mc = _root.createEmptyMovieClip("container", 1);
	mc.holder = mc.createEmptyMovieClip("holder", 1);
	mc.holder.loadMovie("http://localhost/skyhighband/flashgallery.swf?content_path=images&color_path=default.xml&allowFullScreen=false&script_path=flashgallery.php");
	mc._x = 0;
	mc._y = 0;
	mc.onEnterFrame = function() {
		if (this.holder.getBytesLoaded() == this.holder.getBytesTotal() && this.holder._width>0) {
			this.holder.height = 300;
			this.holder.width = 400;
			delete this.onEnterFrame;
 
		}
	};
}

Open in new window

0
jekamanAuthor Commented:
Nop, did not help.

Attached screen shoots.
before.jpg
after.jpg
0
Aneesh ChopraCommented:
Code should work,
I suggest to attach your source file for review
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

jekamanAuthor Commented:
experts-exchange blocks the .fla.

I can mail it to you.
0
Aneesh ChopraCommented:
rename extension to .txt and attach it
0
jekamanAuthor Commented:
0
Aneesh ChopraCommented:
make sure that loading SWF should have graphics on first frame
I also found issue in previous code:

"height" should have been "_height"
"width" should have been "_width

try following updated code  :
on (press) {
	var mc = _root.createEmptyMovieClip("container", 1);
	mc.holder = mc.createEmptyMovieClip("holder", 1);
	mc.holder.loadMovie("http://localhost/skyhighband/flashgallery.swf?content_path=images&color_path=default.xml&allowFullScreen=false&script_path=flashgallery.php");
	mc._x = 0;
	mc._y = 0;
	mc.onEnterFrame = function() {
		if (this.holder.getBytesLoaded() == this.holder.getBytesTotal() && this.holder._width>0) {
			this.holder._height = 300;
			this.holder._width = 400;
			delete this.onEnterFrame; 
		}
	};
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jekamanAuthor Commented:
What do you mean "make sure that loading SWF should have graphics on first frame" , I have a button there , and clip object.

When you click on the button it is loaded into the clip....
0
Aneesh ChopraCommented:
thats mean, every FLA has a stage size,
lets assume 550x400.
So you need to make sure that first frame should have a rectangle box of exact stage size, it is required to get the SWF size
because when an SWF gets loaded in another SWF it actually does not have any stage so content on the stage is must to get the stage size..
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.