# Loading a swf to container

**URL:** https://forum.kirupa.com/t/loading-a-swf-to-container/204753
**Category:** flash
**Created:** [October 23, 2006, 7:31am UTC](https://forum.kirupa.com/t/loading-a-swf-to-container/204753 "2006-10-23T07:31:30Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![geedogg](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@geedogg](https://forum.kirupa.com/u/geedogg)
#### Post date: [October 23, 2006, 7:31am UTC](https://forum.kirupa.com/t/loading-a-swf-to-container/204753/1 "2006-10-23T07:31:30Z")

</div>

Hi.

I have a button on stage. And when you push it i want it to load a swf in a container that is also on the stage. (root)

This is the script im using but i cat get it to work:

ani.onPress = function() {  
\_root.container.loadMovie(“stefan\_o\_video.swf”);  
};

There is also some other script in the button but i dont think that it will affect it.

But the whole script is:

stop();  
var keepGoing = false;  
ani.onRollOver = function() {  
keepGoing = false;  
play();  
};  
ani.onRollOut = function() {  
keepGoing = true;  
};  
ani.onPress = function() {  
\_root.container.loadMovie(“stefan\_o\_video.swf”);  
};

Anyone know what the problem is here?

Thanks 🙂

---

<div class="post-metadata">

### Author: ![junkerjorg](https://avatars.discourse-cdn.com/v4/letter/j/9d8465/32.png) [@junkerjorg](https://forum.kirupa.com/u/junkerjorg)
#### Post date: [October 23, 2006, 8:20am UTC](https://forum.kirupa.com/t/loading-a-swf-to-container/204753/2 "2006-10-23T08:20:48Z")

</div>

Are you sure you have a blank movie clip with the instance name “container”?

---

<div class="post-metadata">

### Author: ![geedogg](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@geedogg](https://forum.kirupa.com/u/geedogg)
#### Post date: [October 23, 2006, 8:36am UTC](https://forum.kirupa.com/t/loading-a-swf-to-container/204753/3 "2006-10-23T08:36:27Z")

</div>

Just check it and its there 🙂

---

<div class="post-metadata">

### Author: ![junkerjorg](https://avatars.discourse-cdn.com/v4/letter/j/9d8465/32.png) [@junkerjorg](https://forum.kirupa.com/u/junkerjorg)
#### Post date: [October 23, 2006, 8:42am UTC](https://forum.kirupa.com/t/loading-a-swf-to-container/204753/4 "2006-10-23T08:42:34Z")

</div>

try tracing out the onPress to make sure that is working

```auto
ani.onPress = function() {
_root.container.loadMovie("stefan_o_video.swf");
trace("Loading");
};

```

---

<div class="post-metadata">

### Author: ![junkerjorg](https://avatars.discourse-cdn.com/v4/letter/j/9d8465/32.png) [@junkerjorg](https://forum.kirupa.com/u/junkerjorg)
#### Post date: [October 23, 2006, 8:51am UTC](https://forum.kirupa.com/t/loading-a-swf-to-container/204753/5 "2006-10-23T08:51:29Z")

</div>

I just tested it with a quickie fla I made and it worked fine for me

---

<div class="post-metadata">

### Author: ![geedogg](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@geedogg](https://forum.kirupa.com/u/geedogg)
#### Post date: [October 23, 2006, 9:11am UTC](https://forum.kirupa.com/t/loading-a-swf-to-container/204753/6 "2006-10-23T09:11:30Z")

</div>

Strange.  
I got the trace.  
But it reefuses to load the swf ☹

---

<div class="post-metadata">

### Author: ![Gupps](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@Gupps](https://forum.kirupa.com/u/Gupps)
#### Post date: [October 23, 2006, 2:13pm UTC](https://forum.kirupa.com/t/loading-a-swf-to-container/204753/7 "2006-10-23T14:13:09Z")

</div>

do you have the swf in the fame folder?

---

<div class="post-metadata">

### Author: ![Gupps](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@Gupps](https://forum.kirupa.com/u/Gupps)
#### Post date: [October 23, 2006, 2:13pm UTC](https://forum.kirupa.com/t/loading-a-swf-to-container/204753/8 "2006-10-23T14:13:51Z")

</div>

opps i meant same folder.
