# Attaching MovieClip from Library (Please help)

**URL:** <https://forum.kirupa.com/t/attaching-movieclip-from-library-please-help/258027>\
**Category:** flash\
**Created:** [April 19, 2008, 8:03pm UTC](https://forum.kirupa.com/t/attaching-movieclip-from-library-please-help/258027 "2008-04-19T20:03:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![adnan794](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@adnan794](https://forum.kirupa.com/u/adnan794)\
**Post date:** [April 19, 2008, 8:03pm UTC](https://forum.kirupa.com/t/attaching-movieclip-from-library-please-help/258027/1 "2008-04-19T20:03:54Z")

</div>

Hello

I have created a textfield and then attached a movieclip as a background on top of which I wanna place the text field just like a button.

Here is the code

var txt:TextField = new TextField();

var bg:MovieClipClass = new MovieClipClass( );  
bg.addChild( txt );

txt.text = “Hello World!!”;  
addChild(bg);

The movieclip and text field are displayed on the stage but the text field is not on top of the background clip it is always away from the clip I have even tried

assigning the moviclip x and y coordinate to text field but does not work.

Any help will be well appreciated

Thank in advance
