1

I'm trying to play the flash file through HTML. The button in the flash is supposed to open a webpage but it doesn't open when I try through my browser. The buttons work fine when I test them in flash. This is the HTML code that uses the .swf file.

</div>
<div class="bodytext"> 
<object width="800px" height="400px" data="C:\Users\ME\Documents\Adobeflash\Tulsi\algo-              mainmenu.swf"></object>
</div>
<br/>

The action script for the button from the flash file is below:

button_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);

 function fl_ClickToGoToWebPage(event:MouseEvent):void
{
navigateToURL(new URLRequest("http://www.adobe.com"), "_self");
}
1
  • If you want to use the flash object just to open a link, why not using an html element : <a>, <span>, ... ? Commented Dec 2, 2014 at 13:00

2 Answers 2

1

I faced the same problem, and figured out that the problem was with the .swf file itself. Flash allows network publish settings for .swf versions. So I changed the settings to something like this:

File -> Publish Settings -> [Flash .swf] -> Local Playback Security - Access Network only

Sign up to request clarification or add additional context in comments.

Comments

0

Try this in the html div..

note: use forward slash for any urls in browser (backslash is for OS file manager). Also if you keep the html and SWF file together in same folder then its enough to just say value="algo-mainmenu.swf" and data="algo-mainmenu.swf"


  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="400">
    <param name="movie" value="file:///C:/Users/ME/Documents/Adobeflash/Tulsi/algo-mainmenu.swf" />
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="file:///C:/Users/ME/Documents/Adobeflash/Tulsi/algo-mainmenu.swf" width="800" height="400">
    <!--<![endif]-->
      <p>Alternative content</p>
    <!--[if !IE]>-->
    </object>
    <!--<![endif]-->
  </object>


If all else fails.. consider using SWFObject to embed. It is a .js file that you will download and put in same folder as html and SWf files and the above code should work or try the tutorials shown in link.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.