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?
 
Aneesh ChopraConnect With a Mentor Commented:
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
 
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
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
Aneesh ChopraCommented:
Code should work,
I suggest to attach your source file for review
0
 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.