Skip to main content
New Participant
July 2, 2013
Answered

My AS3 Buttons in Flash do not work in HTML.

  • July 2, 2013
  • 1 reply
  • 840 views

Hey there,

I created an SWF with 5 Buttons. I used the following code:.

mybutton1.addEventListener(MouseEvent.CLICK,f);

function f(e:Event){

navigateToURL(new URLRequest("http://www.myurl1.com"));

}

mybutton2.addEventListener(MouseEvent.CLICK,f2);

function f2(e:Event){

navigateToURL(new URLRequest("http://www.myurl2.com"));

}

mybutton3.addEventListener(MouseEvent.CLICK,f3);

function f3(e:Event){

navigateToURL(new URLRequest("http://www.myurl3.com"));

}

mybutton4.addEventListener(MouseEvent.CLICK,f4);

function f4(e:Event){

navigateToURL(new URLRequest("http://www.myurl4.com"));

}

mybutton5.addEventListener(MouseEvent.CLICK,f5);

function f5(e:Event){

navigateToURL(new URLRequest("http://www.myurl5.com"));

}

It works perfectly fine when I export the SWF from Flash.

When embedding the SWF in an HTML file nothing happens. The buttons don't work, no error message, nothing.

Help anyone?

Thanks!

This topic has been closed for replies.
Correct answer Ned Murphy

The code looks fine so that is not the problem.  It might be your embedding code for the web page.  Have you tried letting Flash publish an html page and then tested that page, or are you relying on something else to create the embedding code?

1 reply

Ned Murphy
Ned MurphyCorrect answer
Brainiac
July 2, 2013

The code looks fine so that is not the problem.  It might be your embedding code for the web page.  Have you tried letting Flash publish an html page and then tested that page, or are you relying on something else to create the embedding code?

New Participant
July 2, 2013

Yo Ned,

I directly exported an HTML file from Flash and it worked perfectly.

Thanks a lot!

Benni

Ned Murphy
Brainiac
July 2, 2013

You're welcome Benni.