# Code problem

**URL:** https://forum.kirupa.com/t/code-problem/1996
**Category:** Uncategorized
**Created:** [April 2, 2002, 3:13am UTC](https://forum.kirupa.com/t/code-problem/1996 "2002-04-02T03:13:12Z")
**Posts on this page:** 3
**Page:** 1

<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: [April 2, 2002, 3:13am UTC](https://forum.kirupa.com/t/code-problem/1996/1 "2002-04-02T03:13:12Z")

</div>

Hey everyone,

I’m having a code problem for an external swf that I’m loading into my main site. I have a button which has this code attached to it.  
on (release) {  
loadMovieNum(“worktv.swf”, 5);  
\_level5.\_x = -325;  
\_level5.\_y = -300;  
\_level5.\_alpha = 60;  
}  
and then I have an empty movieclip which has another set of code attached to it which is  
onClipEvent (enterFrame) {  
if (loaded\>0 && loaded == \_level5.\_totalframes) {  
\_root.percent = 100;  
} else if (loaded\<=0 && loaded\<\_level5.\_totalframes) {  
\_root.meback.attachMovie(\_root.doormc);  
\_root.percent = Math.floor((\_level5.getBytesLoaded/\_level5.getBytesTotal)\*100);  
}  
}  
can someone please tell me why this isn’t working I’ve tried everything and nothing seems to work. I would appreciate the help!!!

Thanks,

Kyle

---

<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: [April 2, 2002, 3:31am UTC](https://forum.kirupa.com/t/code-problem/1996/2 "2002-04-02T03:31:07Z")

</div>

I’m not sure what it is you’re trying to do here, but I can tell you that you cannot set the \_x and \_y possitions of a movie in a level. The upper left corner of the loaded movie will sync with the upper left corner of the movie in level0 no matter what you try to set it for.

To do that you’ll need to create a movie clip on the level0 stage, give it an instance name, and then use  
loadMovie(“theLoadedswf.swf”,“theHolderMovieClip”);

then if you address theHolderMovieClip by name, you can reposition it’s \_y and \_x.

---

<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: [April 2, 2002, 3:50am UTC](https://forum.kirupa.com/t/code-problem/1996/3 "2002-04-02T03:50:37Z")

</div>

you placed the movie on level 5. calling levels start from 0 (eg. \_level0) so you should change all “\_level5” to “\_level4”. it’s the programmers counting system…we start from 0 🙂
