# Replacing Components with MovieClips

**URL:** https://forum.kirupa.com/t/replacing-components-with-movieclips/298302
**Category:** flash
**Created:** [October 16, 2009, 7:30am UTC](https://forum.kirupa.com/t/replacing-components-with-movieclips/298302 "2009-10-16T07:30:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nikneven](https://avatars.discourse-cdn.com/v4/letter/n/41988e/32.png) [@nikneven](https://forum.kirupa.com/u/nikneven)
#### Post date: [October 16, 2009, 7:30am UTC](https://forum.kirupa.com/t/replacing-components-with-movieclips/298302/1 "2009-10-16T07:30:42Z")

</div>

Ok, so I have a guest book that I am working off of, [found here](http://www.flash-db.com/Tutorials/guestbook/). But it uses the button component, which is just too large and unpretty for my tastes. How do I replace the button component with the myButton movieClip. I have tried just a straight swap, but that doesn’t work. The AS on the button is:

```auto
on(click){
    /* 
    Modify these reference paths to yours if you
    have changed them. Also modify gb_status
    reference path if required
    */
    yourname = _parent._parent.write.yourname.text;
    youremail = _parent._parent.write.youremail.text;
    yourcomments = _parent._parent.write.yourcomments.text;
    
    // Check variable data
    if (yourname eq "") {
        _parent._parent.write.gb_status.text = "Required: Name";
    } else if (youremail eq "") {
        _parent._parent.write.gb_status.text = "Required: Email Address";
    } else if (!youremail.length || youremail.indexOf("@") == -1 || youremail.indexOf(".") == -1) {
        _parent._parent.write.gb_status.text = "Required: Valid Email Address";
    } else if (yourcomments eq "") {
        _parent._parent.write.gb_status.text = "Required: Comments";
    } else {
        _parent._parent.write.gb_status.text = "Please wait...";
        newEntry = new LoadVars()
        newEntry.ref = this
        newEntry.submit = "Yes" 
        newEntry.yourname = yourname
        newEntry.youremail = youremail 
        newEntry.yourcomments = yourcomments 
        newEntry.sendAndLoad("GuestBook.php?action=write&r="+random(999), newEntry, "POST") 
        newEntry.onLoad = function(success){ 
            if(success){ 
                _parent._parent.write.gb_status.text = this.gb_status;
                _parent._parent.read.loadEntries("Default", 10);
                // Clear fields
                _parent._parent.write.yourname.text = "";
                _parent._parent.write.youremail.text = "";
                _parent._parent.write.yourcomments.text = "";
            }
        } 
    }
}

```

[Here is the fla](http://tinyurl.com/ygaejqz)

Any help would be greatly appreciated.
