Onpress/attachmovie issues

so I wrote this chunk of code as a test to see if my other one should work:

var mc:MovieClip = _root.createEmptyMovieClip("mc", 800+id );
mc.createTextField( "txt", 800+id, 0, 50, 320, 20 )

with (_root.mc.txt ){
    text = "text";
    autoSize = "center";
    selectable = false;
    type = "dynamic";
}

with ( _root.mc ){
    attachMovie( "template", "t", this.getNextHighestDepth() );
    t._x = 180;
    t._y = 200;
    t.onPress = function( ){
        trace("something");
    };
}
         

which works fine… you press the button and it traces “something”.

then I have this:


_root.formats_mc[id+"_quality_mc"] = _root.formats_mc.createEmptyMovieClip( id+"_quality_mc", 800+id ); //id is just a unique id for each movieclip that is created

xStart = 162;
yStart = 40+prev_y_format;
        
with( _root.formats_mc[id+"_quality_mc"] ){
      attachMovie( "template", "btn", 1000+id );
      btn._x = xStart;
      btn._y = yStart;

      btn.onPress = function( ){
           trace("something");
      };
} //end with


the button shows up in the right place, but you can’t press it.
so basically, using the debugger, I see that btn.onPress is included in the variables of the movieclip _root.formats_mc[id+"_quality_mc"].btn, but it is not getting defined for some reason. btn._y and ._x work fine, so what’s the deal?