4 Replies Latest reply on Jan 15, 2008 10:56 AM by Newsgroup_User

    dynamic flash vars and java script function

    AScracker Level 1
      hi
      i am using to flash vars to get the dynamic variable .... and also i am using java script function to open the popup window....
      /// Flash Code
      import flash.external.ExternalInterface;
      tempRef.onPress = function() {
      var temp:String = "newWindow1.html?"+img;
      ExternalInterface.call("OpenPopUpWindow", temp);
      };

      can any help me to solve this issue....
      ~~Sk

        • 1. Re: dynamic flash vars and java script function
          AScracker Level 1
          Hi,

          can any help me to solve this issue..
          i do't where i need to change the code..
          it'll be gratefull if any body give me some idea....

          ~~
          Sk
          • 2. Re: dynamic flash vars and java script function
            clbeech Level 3
            AScracker - you already have a thread on this subject, just below this one. where there is an answer in the last post.
            • 3. Re: dynamic flash vars and java script function
              AScracker Level 1
              yeah i have used as window.open()... It's not working
              i have kept the alert function ... alert function is also not working ....
              main issue is flash is not able to call that OpenPopUpWindow function
              • 4. Re: dynamic flash vars and java script function
                Level 7
                Hi A,

                Have you tried a getURL javascript call? It's not recommended but it's
                an alternate that's worth a shot. The format is:

                var windowStr:String="newWindow1.html?"+img;
                getURL ("javascript: OpenPopUpWindow('"+windowStr+"');");

                Like I said, it's not the recommended way but at least you can see if
                JavaScript interaction is working. Something more simple can also help:

                getURL ("javascript: alert ('This is a test alert')");

                If these work but ExternalInterface doesn't, it could be a result of
                JavaScript scope (same as Flash scope). The JavaScript function, in other
                words, is sitting in another part of the DOM object than the Flash object
                and so Flash can't call it. Try defining the function right bfore the Flash
                object embed tag so that both are in teh same scope, and give it another
                try.

                Good luck,
                Patrick Bay
                BAY NEW MEDIA

                "AScracker" <webforumsuser@macromedia.com> wrote in message
                news:fmipus$sho$1@forums.macromedia.com...
                > yeah i have used as window.open()... It's not working
                > i have kept the alert function ... alert function is also not working ....
                > main issue is flash is not able to call that OpenPopUpWindow function