# Loading movie

**URL:** <https://forum.kirupa.com/t/loading-movie/23720>\
**Category:** Uncategorized\
**Created:** [June 21, 2003, 2:04pm UTC](https://forum.kirupa.com/t/loading-movie/23720 "2003-06-21T14:04:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pspecial](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pspecial](https://forum.kirupa.com/u/pspecial)\
**Post date:** [June 21, 2003, 2:04pm UTC](https://forum.kirupa.com/t/loading-movie/23720/1 "2003-06-21T14:04:22Z")

</div>

I have a button that I want to have load a movie when pressed. It works, howerver, the movie loads in a separate window instead of the the main timeline where I would like it to. How can I correct this?

Here’s how I have it scripted now:

on(release) {  
\_root.loadMovie(“microphones.swf”, “placeholder”);  
}

---

<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:** [June 21, 2003, 2:10pm UTC](https://forum.kirupa.com/t/loading-movie/23720/2 "2003-06-21T14:10:11Z")

</div>

on(release) {  
\_root.placeholder.loadMovie(“microphones.swf”);  
}

Might work 😉

---

<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:** [June 21, 2003, 3:32pm UTC](https://forum.kirupa.com/t/loading-movie/23720/3 "2003-06-21T15:32:25Z")

</div>

THANKS!

You replied to my other thread about preloading an external file.  
I still havent gotten it to work yet. I think my problem with it logically is that the loadMovie command comes after the if - then condition. How can I get the preloader to calculate bytesLoaded from a movie that hasnt loaded onto the timeline yet?

Schematically, this is how my path looks like:

\_root.

```
    _movieclip

            _placeholderMC

                   _external movie .swf                    

```

I have a movieclip on the main timeline that contains a placeholder into which the external .swf movie loads.

Where in the world would I put the preloader??

---

<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:** [June 21, 2003, 4:38pm UTC](https://forum.kirupa.com/t/loading-movie/23720/4 "2003-06-21T16:38:48Z")

</div>

I just reviewed my other post and forgot this : you should have this right ?

[AS]  
\_root.bytes\_loaded = Math.round(this.getBytesLoaded());  
\_root.bytes\_total = Math.round(this.getBytesTotal());  
\_root.getPercent = \_root.bytes\_loaded/\_root.bytes\_total;  
[/AS]

Should be

[AS]  
\_root.bytes\_loaded = Math.round(\_parent.getBytesLoaded());  
\_root.bytes\_total = Math.round(\_parent.getBytesTotal());  
\_root.getPercent = \_root.bytes\_loaded/\_root.bytes\_total;  
[/AS]

And the loadMovie command should indeed before this code. If that doesn’t work, post again 🙂
