5 Replies Latest reply on Sep 11, 2007 11:09 AM by

    Flash Not  Working In HTML


      I am new to flash. I am creating a website with parts of it designed in Flash.
      I wanted to design the menu bars in flash and some other parts aswel in the future.
      I created a button in flash:
      1) Created a circle and then turned it into a button and named it home.
      2) I then added a new layer called Actions.
      3) I clicked on the first frame and then pressed F9.
      4) I wrote the following code into it:
      function goHome(event:MouseEvent):void
      var targetURL:URLRequest = new
      URLRequest(" http://google.com");
      home.addEventListener(MouseEvent.CLICK, goHome);

      6) I publish the flash and get the html and .swf files.
      7) I then open the HTML document and then click on the button and get the following error:
      SecurityError: Error #2028: Local-with-filesystem SWF file file:///C:/Documents and Settings/Hamid/My Documents/Test/Untitled-2.swf cannot access Internet URL http://greenal.co.uk.
      at global/flash.net::navigateToURL()
      at Untitled_fla::MainTimeline/goHome()

      Please If someone can advise on this...
      If any one can advise on how to put different components of flash together in HTML...

        • 1. Re: Flash Not  Working In HTML
          SymTsb Level 2
          This is simply the security sandbox telling you that it won't allow you to access any content outside of your local domain. Look at the Security classes in Flash CS3's AS3 Documentation. This should get you going in the right direction.
          1 person found this helpful
          • 2. Re: Flash Not  Working In HTML
            miguel_loves_jesus Level 1
            hey, try setting the Actionscript to 2.0 instead of 3.0 that always worked for me
            1 person found this helpful
            • 3. Re: Flash Not  Working In HTML

              Thanks for the reply.
              I get what you are saying. BUT
              I want to create my menus in Flash and then put all the website together in HTML (Dream weaver). This means that the action script must relate to a URL link... I hope you get what I am saying.
              Please advise on this. Sorry if I am being ambiguous.

              • 4. Re: Flash Not  Working In HTML
                SymTsb Level 2
                I understand you perfectly. The issue is still the same. You are getting Security throw backs from the flash player. Upload the file to the web and test it there.

                Playback from the local machine is going to cause the security sandbox to be notified that you are trying to access files on a remote computer not in the local network and Flash is going to prevent it. This can be prevented by uploading the file to a server and testing from there.
                • 5. Re: Flash Not  Working In HTML

                  I tried what you said. It works perfectly well.

                  Thanks a lot.