How to use button to load another swf file

BenjaminWong used Ask the Experts™
Hi Expert, I am new to CS4 but I am learning.  I have created a simple button with intention to use it to load another swf file. I have used the following AS3 scrips but it did not work.  Plase help:

function setupEvents() {
      //associate events with event handlers

function clickButtonHandler(e:MouseEvent) {
trace("Clicked Button");

function release(e:MouseEvent):void {
trace("I am here");
var loader.load=new loader();

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
this code should do it

function newvid(event:MouseEvent) {
trace("you clicked me");
var loadit = new Loader();
loadit.load(new URLRequest("thevid.swf"));
my_mc.addEventListener(MouseEvent.MOUSE_DOWN, newvid);

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial