0 Replies Latest reply on Jun 10, 2009 7:58 AM by Extreme911

    Problem: Flex and focus() from Javascript

    Extreme911 Level 1

      Hello,

       

      Here is my problem.

      I have 2 html pages.

      2nd - Flexwindow.html

       

      opener.html contains a javascript which is similar to this:

      var window2 = window.open("Flexwindow.html", "MyWindow");


      function focuswin()

      {

         window2.setBrowserFocus();

      }

       

      focuswin() function called by pressing a button.

       

       

      Flexwindow.html contains a flex swf and a java script:

       

      function setBrowserFocus(){ 

        document.getElementById("MyflexObject").focus();   

      }

       

      So basicaly when im starting Opener.Html it will automaticaly run my flexwindow.html in front of Opener.html (opener will be under the flex page) (and this working perfectly).

       

      The problem that if i will bring opener.html in front by clicking on it, and then will click the button with focuswin(), it will bring back in front my flexwindow.html (thats what i actualy needed) but it WILL AUTOMATICALY REFRESH SWF to it initial state (and thats what i dont need).

      How i can stop refreshing this swf caused by javas focus() function?

       

      Thank You