# Resize containerMC for external loaded swf

**URL:** <https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372>\
**Category:** Uncategorized\
**Created:** [June 23, 2004, 11:29am UTC](https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372 "2004-06-23T11:29:56Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixeldude](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@pixeldude](https://forum.kirupa.com/u/pixeldude)\
**Post date:** [June 23, 2004, 11:29am UTC](https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372/1 "2004-06-23T11:29:56Z")

</div>

i just using resize loaded external pic which is i got from this forum…for my external swf…but it won’t work…so my question is…is there any thread for this or tutorial…

thanks u in advanced

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 5, 2004, 7:56am UTC](https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372/2 "2004-07-05T07:56:07Z")

</div>

aii scotty again…hah…sorry coz always bugging u…but i really got minor problem…  
in my external swf i place preloader itself…so when i load into container it seems not working.at first place…or maybe it can’t use alpha property setting…i attached the fla for ur view…anyone can help too… =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 5, 2004, 9:34am UTC](https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372/3 "2004-07-05T09:34:19Z")

</div>

It works, more or less…  
But why don’t you put the preloader in your mainfile, so have you have one for all your external movies?

scotty(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 6, 2004, 2:11am UTC](https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372/4 "2004-07-06T02:11:17Z")

</div>

u mean put the preloader in the main and just using it for the whole my external swf…emm…i’ll try it…tq anyway sir…🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 6, 2004, 7:42am UTC](https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372/5 "2004-07-06T07:42:57Z")

</div>

In your main movie, make a mc with the instancename “loadbar” and a textfield instancename “loadinfotxt”.

```auto
MovieClip.prototype.loadPic = function(pic) {
	this._alpha = 0;
	this.loadMovie(pic);
	loadbar._visible = 1;
	this._parent.onEnterFrame = function() {
		var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
		var per = Math.round((l/t)*100);
		loadbar._xscale = per;
		loadinfotxt.text = per+" % loaded";
		if (t != 0 && t==l && containerMC._width != 0 && containerMC._height != 0) {
			var w = containerMC._width+spacing, h = containerMC._height+spacing;
			border.resizeMe(w, h);
			loadbar._visible = 0;
			loadinfotxt.text = " ";
			delete this.onEnterFrame;
		}
	};
};

```

scotty(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 6, 2004, 9:54am UTC](https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372/6 "2004-07-06T09:54:25Z")

</div>

tq for ur reply sir… but it seems not working though…because when i press the button it just load the swf without display the load bar or the status in loadinfotxt.text…i don’t know why…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 6, 2004, 12:30pm UTC](https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372/7 "2004-07-06T12:30:53Z")

</div>

Did you, when testing your movie, hit CTRL+Enter again or tested it on line?

scotty(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 7, 2004, 3:04am UTC](https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372/8 "2004-07-07T03:04:11Z")

</div>

I just hit CTRL+ Enter once only and just press the button to see either the preloader is working or not…  
i just do it as u told sir… u can see the fla…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 7, 2004, 11:38am UTC](https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372/9 "2004-07-07T11:38:51Z")

</div>

It’s working as it should:  
[Look here](http://ut-ovv-9acf.adsl.wanadoo.nl/~gertvink/preloader.html)

scotty(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 8, 2004, 9:50am UTC](https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372/10 "2004-07-08T09:50:22Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 8, 2004, 9:56am UTC](https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372/11 "2004-07-08T09:56:01Z")

</div>

ok…when i test again it not view the load bar progress i mean it just load the swf…u can see [here](http://www.geocities.com/mrpixel04/test.htm) :bounce: and the textbox didn’t show the status…comparison ur link it working very well…maybe i place the loadbar and the txtbox at wrong place…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 8, 2004, 10:22am UTC](https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372/12 "2004-07-08T10:22:37Z")

</div>

Hmm, in my link I used your files, the only thing I’ve changed is adding a (big) picture (500kb) to the swf to be loaded, to see if it worked…

scotty(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 8, 2004, 11:35am UTC](https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372/13 "2004-07-08T11:35:27Z")

</div>

yes…eventually…it working when i tested with a big file…really…really…thanks to u sir…

salute to u…!!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 8, 2004, 12:15pm UTC](https://forum.kirupa.com/t/resize-containermc-for-external-loaded-swf/55372/14 "2004-07-08T12:15:07Z")

</div>

no problem=)
