2 Replies Latest reply on Jan 21, 2008 1:15 PM by Garyl Woolworth

    navigateToURL problems in Flex 3

    Mike8086
      Our flex app is called from Coldfusion/HTML, and when the app finishes, we need it to refresh the page the app is on to update images. Unfortunately, it seems there is a bug in navigateToURL that makes it ineffective in Firefox.

      We tried a workaround where we try to call JavaScript to get it to refresh the page, but that doesn't work either, on the production server.

      The strange thing is, it works fine from my local developer's environment. I run the app, then when it finishes, as in the example below, the browser hits google's homepage just fine.

      But when we put the app on the production server, it is not running the JS refresh. It doesn't report any security or other errors, either. It just "sits" there.

      Our production environment looks like this:
      Server 1: SWF file
      Server 2: HTML that calls SWF file, embedded in Coldfusion CFM file.

      We have "allowScriptAccess" set to "always" in the html file.

      Also, we set up cross-domain access that is allowing the actual SWF file to run across servers without generating security errors. It runs fine and performs its task to upload a file to the server. But at the end, the refresh/call to HTML from Flex/JS doesn't work.

      Here's a couple of code snippets:

      --- JAVASCRIPT ---
      function moveit() {
      window.location = ' http://www.google.com'
      }

      --- FLEX ---
      package {
      import flash.external.ExternalInterface;
      public class URLUtil
      {
      protected static const WINDOW_OPEN_FUNCTION : String = "moveit()";
      public static function openWindow(url : String, window : String = "_blank",
      features : String = "") : void
      {
      ExternalInterface.call(WINDOW_OPEN_FUNCTION);
      //ExternalInterface.call(WINDOW_OPEN_FUNCTION, url, window, features);
      }
      }
      }

      and the actionscript that calls it:

      URLUtil.openWindow(" http://www.google.com/");

      We are just trying to get ANY type of refresh/call to HTML working at this point. Any help would be appreciated!

      Thanks!
      Mike
        • 1. Re: navigateToURL problems in Flex 3
          rob@whizbang.net
          I have a similar problem. The web server calls the SWF, which is located on a media server. Everything works fine until we try to refresh the page. Does anyone have any thoughts?

          We're using ActionScript 3.0 and CF8.
          Thanks!
          • 2. Re: navigateToURL problems in Flex 3
            Garyl Woolworth Level 1
            Just a quick question. You said "Server 2: HTML that calls SWF file, embedded in Coldfusion CFM file." how exactly are you embedding a cfm file within an html file? Wouldn't your html file need to be a cfm file as well to parse the cf code? My second question is where is the javascript function located? If it's inside of of the cfm file and it works fine running that by itself, but then doesn't work within the HTML file my guess is the ExternalInterface has lost scope of where the javascript function is.