# Loading an external mc/swf file

**URL:** https://forum.kirupa.com/t/loading-an-external-mc-swf-file/96764
**Category:** Uncategorized
**Created:** [December 13, 2003, 5:39am UTC](https://forum.kirupa.com/t/loading-an-external-mc-swf-file/96764 "2003-12-13T05:39:31Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![minimalistik](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@minimalistik](https://forum.kirupa.com/u/minimalistik)
#### Post date: [December 13, 2003, 5:39am UTC](https://forum.kirupa.com/t/loading-an-external-mc-swf-file/96764/1 "2003-12-13T05:39:31Z")

</div>

i have made this mc and when you click on it, it loads an external mc (\_root.blank3.loadMovie(“mc.swf”)

Here is the actionscript when clicked on:

[AS]  
onClipEvent (enterFrame)  
{  
var speed = 4;  
var viscosity = 1.300000;  
difference = whld3 - this.\_width;  
xvelocity = (xvelocity + difference / speed) / viscosity;  
this.\_width = this.\_width + xvelocity;  
difference = hhld3 - this.\_height;  
yvelocity = (yvelocity + difference / speed) / viscosity;  
this.\_height = this.\_height + yvelocity;  
}

on (rollOver)  
{  
if (oneup == “no”)  
{  
\_global.whld1 = 143.200000;  
\_global.hhld1 = 87.500000;  
\_root.b1.\_x = xhld1;  
\_global.whld2 = 143.200000;  
\_global.hhld2 = 87.500000;  
\_root.b2.\_x = xhld2;  
\_global.whld3 = 143.200000;  
\_global.hhld3 = 87.500000;  
\_root.b3.\_x = xhld3;  
\_global.whld4 = 143.200000;  
\_global.hhld4 = 87.500000;  
\_root.b4.\_x = xhld4;  
\_global.whld5 = 143.200000;  
\_global.hhld5 = 87.500000;  
\_root.b5.\_x = xhld5;  
\_global.xhld = xhldog;  
if (last == “b1”)  
{  
\_root.nav1.gotoAndPlay(16);  
}  
else if (last == “b2”)  
{  
\_root.nav2.gotoAndPlay(16);  
}  
else if (last == “b4”)  
{  
\_root.nav4.gotoAndPlay(16);  
}  
else if (last == “b5”)  
{  
\_root.nav5.gotoAndPlay(16);  
} // end if  
\_global.last = “b3”;  
\_root.nav3.gotoAndPlay(2);  
\_global.whld3 = 163.200000;  
\_global.hhld3 = 107.500000;  
\_global.whld2 = 123.200000;  
\_root.b2.\_x = 239.600000;  
\_global.whld4 = 123.200000;  
\_root.b4.\_x = 528.100000;  
} // end if  
}

on (release)  
{  
if (oneup == “no”)  
{  
\_global.whld3 = 183.200000;  
\_global.hhld3 = 307.500000;  
\_global.whld2 = 103.200000;  
\_global.whld4 = 103.200000;  
\_root.nav3.gotoAndPlay(16);  
\*\* \_root.blank3.loadMovie(“mc.swf”);\*\*  
\_root.blank3.\_alpha = 100;  
\_global.oneup = “yes3”;  
} // end if  
}  
[/AS]

But when you click, nothing happens. The external mc doesn’t appear or seem to load. Whats wrong? Do I need to specify more specifically like a url? (eg. [http://www.sgroove.com/mc.swf](http://www.sgroove.com/mc.swf))

---

<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: [December 13, 2003, 6:51am UTC](https://forum.kirupa.com/t/loading-an-external-mc-swf-file/96764/2 "2003-12-13T06:51:10Z")

</div>

As soona s I figure out this jargon of code… I’ll tell you…

But now… What is blank3… Where is it… How was it created and have you given it ample amount of time to load?

---

<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: [December 13, 2003, 6:52am UTC](https://forum.kirupa.com/t/loading-an-external-mc-swf-file/96764/3 "2003-12-13T06:52:40Z")

</div>

I’m no guru, but it looks ok to me. Put a trace after  
[AS]  
your \_root.blank3.loadMovie(“mc.swf”);  
[/AS]  
to see if the code is even getting to that

---

<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: [December 13, 2003, 6:54am UTC](https://forum.kirupa.com/t/loading-an-external-mc-swf-file/96764/4 "2003-12-13T06:54:17Z")

</div>

a trace? sorry but whats that?

---

<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: [December 13, 2003, 7:03am UTC](https://forum.kirupa.com/t/loading-an-external-mc-swf-file/96764/5 "2003-12-13T07:03:57Z")

</div>

right after:  
[AS]  
\_root.blank3.loadMovie(“mc.swf”);  
[/AS]  
put  
[AS]  
trace(“success”)  
[/AS]  
then test your movie in flash (control+enter) when the code gets to that line, if it gets there, an output window will open saying:  
success

trace is your friend, if code is not working the way it should drop a few traces in there to see whats working and whats not

---

<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: [December 14, 2003, 7:54pm UTC](https://forum.kirupa.com/t/loading-an-external-mc-swf-file/96764/6 "2003-12-14T19:54:21Z")

</div>

the success just means that it got that far down in the script. How are you making the blank3 object? Where are you placing it? You may have placed it off screen somewhere without knowing that you did.

---

<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: [December 14, 2003, 11:19pm UTC](https://forum.kirupa.com/t/loading-an-external-mc-swf-file/96764/7 "2003-12-14T23:19:17Z")

</div>

the blank 3 object is a simple mc which is a rectangle.  
With the actionscript above attached to the rectangle, I wanted an external swf to load inside the area of the rectangle. (when you click on the rectangle, it increases in length and width)

the mc is right in the middle and not anywhere i cannot see it.

---

<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: [December 15, 2003, 12:18am UTC](https://forum.kirupa.com/t/loading-an-external-mc-swf-file/96764/8 "2003-12-15T00:18:55Z")

</div>

Do you have blank3 on the stage, or is just in the library? If all else fails try…

change this:  
[AS]  
\_root.nav3.gotoAndPlay(16);  
\_root.blank3.loadMovie(“mc.swf”);  
\_root.blank3.\_alpha = 100;

[/AS]  
to:  
[AS]  
\_root.nav3.gotoAndPlay(16);  
\_root.createEmptyMovieClip(“blank3test”, 5);  
\_root.blank3test.\_x = \_root.blank3test.\_y = 50;  
\_root.blank3test.loadMovie(“mc.swf”);  
\_root.blank3.\_alpha = 100;

[/AS]

So basically your creating the movie holding rectangle on the fly and placing it at 50,50, then loading a movie into it. If this works, then your problem lies with the blank3 object.

---

<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: [December 15, 2003, 1:27am UTC](https://forum.kirupa.com/t/loading-an-external-mc-swf-file/96764/9 "2003-12-15T01:27:13Z")

</div>

maizoon,

I have edited the

```auto
 to what you have said previously.

Please view what i have done: http://www.angelfire.com/ut2/sgroove/mainpage.htm

There is still a problem because when you click on the mc, the external swf file does not load into the "dark grey" area (which is the "blank3 mc)

**i want the external mc loaded into the grey area. Please help me out.**

The following as has been attached to the "blank3" mc:

[AS]
onClipEvent (enterFrame)
{
    var speed = 4;
    var viscosity = 1.300000;
    difference = whld3 - this._width;
    xvelocity = (xvelocity + difference / speed) / viscosity;
    this._width = this._width + xvelocity;
    difference = hhld3 - this._height;
    yvelocity = (yvelocity + difference / speed) / viscosity;
    this._height = this._height + yvelocity;
}

on (rollOver)
{
    if (oneup == "no")
    {
        _global.whld1 = 143.200000;
        _global.hhld1 = 87.500000;
        _root.b1._x = xhld1;
        _global.whld2 = 143.200000;
        _global.hhld2 = 87.500000;
        _root.b2._x = xhld2;
        _global.whld3 = 143.200000;
        _global.hhld3 = 87.500000;
        _root.b3._x = xhld3;
        _global.whld4 = 143.200000;
        _global.hhld4 = 87.500000;
        _root.b4._x = xhld4;
        _global.whld5 = 143.200000;
        _global.hhld5 = 87.500000;
        _root.b5._x = xhld5;
        _global.xhld = xhldog;
        if (last == "b1")
        {
            _root.nav1.gotoAndPlay(16);
        }
        else if (last == "b2")
        {
            _root.nav2.gotoAndPlay(16);
        }
        else if (last == "b4")
        {
            _root.nav4.gotoAndPlay(16);
        }
        else if (last == "b5")
        {
            _root.nav5.gotoAndPlay(16);
        } // end if
        _global.last = "blank3";
        _root.nav3.gotoAndPlay(2);
        _global.whld3 = 163.200000;
        _global.hhld3 = 107.500000;
        _global.whld2 = 123.200000;
        _root.b2._x = 239.600000;
        _global.whld4 = 123.200000;
        _root.b4._x = 528.100000;
    } // end if
}

on (release)
{
    if (oneup == "no")
    {
        _global.whld3 = 183.200000;
        _global.hhld3 = 307.500000;
        _global.whld2 = 103.200000;
        _global.whld4 = 103.200000;
        _root.nav3.gotoAndPlay(16);
_root.createEmptyMovieClip("blank3test", 1);
_root.blank3test._x = _root.blank3test._y = 100;
_root.blank3test.loadMovie("http://www.angelfire.com/ut2/sgroove/sgbox.swf");
_root.blank3._alpha = 100;

        _global.oneup = "yes3";
    } // end if
}
[/AS]
```

---

<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: [December 15, 2003, 2:19am UTC](https://forum.kirupa.com/t/loading-an-external-mc-swf-file/96764/10 "2003-12-15T02:19:37Z")

</div>

wait…all of that code is on the blank3 object and not the main timeline? Put it back like you had it before and change the:  
[AS]  
\_root.blank3.loadMovie(“mc.swf”);  
[/AS]  
to  
[AS]  
this.loadMovie(“mc.swf”);  
[/AS]  
if that doesnt fix it, post your .fla(s) and I’ll see what I can do…but I’m no guru so I make no promises

---

<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: [December 15, 2003, 10:58pm UTC](https://forum.kirupa.com/t/loading-an-external-mc-swf-file/96764/11 "2003-12-15T22:58:50Z")

</div>

here is the fla file maizoon,

soz about the uploading problem.

---

<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: [December 15, 2003, 11:49pm UTC](https://forum.kirupa.com/t/loading-an-external-mc-swf-file/96764/12 "2003-12-15T23:49:24Z")

</div>

here is the spillarmenu.fla file
