# \[FMX\]Why isn't this code working?

**URL:** <https://forum.kirupa.com/t/fmx-why-isnt-this-code-working/53648>\
**Category:** flash\
**Created:** [June 6, 2004, 4:28am UTC](https://forum.kirupa.com/t/fmx-why-isnt-this-code-working/53648 "2004-06-06T04:28:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dboers](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@dboers](https://forum.kirupa.com/u/dboers)\
**Post date:** [June 6, 2004, 4:28am UTC](https://forum.kirupa.com/t/fmx-why-isnt-this-code-working/53648/1 "2004-06-06T04:28:37Z")

</div>

I saw a topic about loading movies with transtions. This is the link:

[http://www.kirupaforum.com/forums/showthread.php?t=39101&page=1&pp=15](http://www.kirupaforum.com/forums/showthread.php?t=39101&page=1&pp=15)

For myself I used loop to identify my buttons. Like this:

```auto
for (var i in this){
if (this*._name.substr(0, 4) == "btn"){
setButton (this*._name);
}
}

```

And the setButon function like this:

```auto
function setButton (clip){
var clip = eval(clip);
clip.onRollOver = function(){
// Rollover stuff here
};
clip.onRollOut = function(){
// RollOut stuf here 
};
}

```

And than I integrated the code from the other topic in the onRelease like this:

```auto
[font=Courier New]clip.onRelease = function() {
if (_root.currMovie == undefined) {
_root.currMovie = this._name;
this._parent.container.loadMovie(this._name+".swf");
} else if (_root.currMovie != this._name) {
if (this._parent.container._currentframe>=this._parent.container.midframe) {
_root.currMovie = this._name;
this._parent.container.play();
}
}[/font]
[font=Courier New]};[/font]

```

But now when I press lets say btn\_home the movie wants to load btn\_home.swf while it should load home.swf

What am I doing wrong :h:

Thank you in advance 🙂
