# What is wrong with this code please?

**URL:** <https://forum.kirupa.com/t/what-is-wrong-with-this-code-please/260925>\
**Category:** flash\
**Created:** [May 21, 2008, 3:16am UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-code-please/260925 "2008-05-21T03:16:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![glow](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@glow](https://forum.kirupa.com/u/glow)\
**Post date:** [May 21, 2008, 3:16am UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-code-please/260925/1 "2008-05-21T03:16:59Z")

</div>

Please I need help I don’t know what else to try.

before converting to As 2.0 from as 1.0 and fp 6 this code laoded an image just fine

see code:

```auto

if (_root.templatedir ne "") {
    loadMovie(_root.templatedir add "/" add _root.category add "/" add _root.theme add ".swf", "loadmoviebottom");
} else {
    if (_root.templatedir1 ne "") {
        loadMovie(_root.templatedir1 add "/" add _root.category add "/" add _root.theme add ".swf", "loadmoviebottom");
    } else {
        loadMovie(theme add ".swf", "loadmoviebottom");
    }
}

```

after converting to as 2.0 and fp 8 and 9 the code wont load anymore

see code:

```auto

if (_root.templatedir != "") {
    loadMovie(_root.templatedir + "/" + _root.category + "/" + _root.theme + ".swf", "loadmoviebottom");
} else {
    if (_root.templatedir1 != "") {
        loadMovie(_root.templatedir1 + "/" + _root.category + "/" + _root.theme + ".swf", "loadmoviebottom");
    } else {
        loadMovie(theme + ".swf", "loadmoviebottom");
    }
}

```

I’ve experimrnted with both “==” operator and 'ne" and nothing happens.

the only way that I can get the images to load i if I publish in flash player 6.

please what is wrong with this code

thanks in advance

---

<div class="post-metadata">

**Author:** ![Michael\_Chen](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@Michael\_Chen](https://forum.kirupa.com/u/Michael_Chen)\
**Post date:** [May 21, 2008, 4:15am UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-code-please/260925/2 "2008-05-21T04:15:48Z")

</div>

Not sure, however I noticed…

```auto

if (_root.templatedir != "") {
    loadMovie(_root.templatedir + "/" + _root.category + "/" + _root.theme + ".swf", "loadmoviebottom");
} else {
    if (_root.templatedir1 != "") {
        loadMovie(_root.templatedir1 + "/" + _root.category + "/" + _root.theme + ".swf", "loadmoviebottom");
    } else {
        loadMovie( **theme** + ".swf", "loadmoviebottom");
    }
}

```

Try changing that to **\_root.theme**

---

<div class="post-metadata">

**Author:** ![jon\_bla](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jon\_bla](https://forum.kirupa.com/u/jon_bla)\
**Post date:** [May 21, 2008, 1:22pm UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-code-please/260925/3 "2008-05-21T13:22:07Z")

</div>

I dont know if this will work

but shouldnt it be like

```auto

loadMovie([theme + ".swf", "loadmoviebottom");

// OR

loadMovie(eval(theme + ".swf"), "loadmoviebottom");

```

---

<div class="post-metadata">

**Author:** ![JBPresents](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@JBPresents](https://forum.kirupa.com/u/JBPresents)\
**Post date:** [May 21, 2008, 1:48pm UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-code-please/260925/4 "2008-05-21T13:48:49Z")

</div>

it’s just a load image?  
like put an image on the screen?

\_root.createEmptyMovieClip(“emp”,-1);  
\_root.emp.attachMovie(“clip”,“clip”+1,1);  
var pill:MovieClip = \_root.emp[“clip”+1];  
pill.\_x = 550/2;  
pill.\_y = 400/2;

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [May 21, 2008, 3:22pm UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-code-please/260925/5 "2008-05-21T15:22:57Z")

</div>

-1 is bad 😛

\*\*if (\_root.templatedir != “”) { \*\*

doesn’t make sense twice in a row

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [May 23, 2008, 1:12am UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-code-please/260925/6 "2008-05-23T01:12:10Z")

</div>

```auto
var root:MovieClip = this;
loadMovie((root.templatedir1 ? (root.templatedir1 + "/" + root.category + "/") : "") + root.theme + ".swf", "loadmoviebottom");

```

Without seeing your file, nothing seems wrong - however, try to avoid referencing the \_root
