# Replace root with new SWF?

**URL:** https://forum.kirupa.com/t/replace-root-with-new-swf/244779
**Category:** flash
**Created:** [November 21, 2007, 5:25pm UTC](https://forum.kirupa.com/t/replace-root-with-new-swf/244779 "2007-11-21T17:25:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![HunterSkookum](https://avatars.discourse-cdn.com/v4/letter/h/65b543/32.png) [@HunterSkookum](https://forum.kirupa.com/u/HunterSkookum)
#### Post date: [November 21, 2007, 5:25pm UTC](https://forum.kirupa.com/t/replace-root-with-new-swf/244779/1 "2007-11-21T17:25:25Z")

</div>

Hi,

I have a question that I thought would have a simple answer, but I can’t find it anywhere!

I have a button, myButton, and I’d like the SWF to “link” to another SWF on click. Meaning, I’d like to replace the SWF with another. I know I could create a master SWF and then create a Loader class within it and then when you click the button in the child SWF it could call a function in the master SWF to load a new file, but - that seems _really_ complex for such a simple action so I’m sure there’s a straightforward way to do this.

Code:  
function onClickBtn(e:Event):void  
{  
loadMovie(“what\_web.swf”); // AS2 version  
}

myButton.addEventListener(MouseEvent.CLICK, onClickBtn);

Thanks so much for your help!  
H
