4 Replies Latest reply on Apr 30, 2009 9:53 AM by devidas

    Place link in Flash text, which opens sized Browser window

    devidas

      I am working in Flash CS3, AS2.0.

       

      I know how to place a simple link in text in a Flash document which opens a new URL.

       

      How would I modify that link so that when the URL opens, I control the size, placement, scrolling and amount of chrome visible on the opened new URL?

       

      Thanks, I realize I should know this, but I have not a clue on how to do it.

        • 1. Re: Place link in Flash text, which opens sized Browser window
          RossRitchey Level 4

          This is actually more difficult than it should be.

           

          In the past, you could simply call: getURL("javascript:.............") and open a programmatic pop-up using javascript directly in the getURL call.  BUT, as of player 9,0,124 (i think it was that rev - but to be safe, lets just say player 9) Adobe shut that avenue down due to security issues.

           

          Now, you need to write a function in the javascript of the HTML page to open the window for you (you can pass the settings in for reusability) and use the ExternalInterface class.

           

          An example:

           

          import flash.external.ExternalInterface;

           

          myBtn.onRelease = function(){

               ExternalInterface.call("openWindow");

          }

           

          This code will, when the button with the instance name "myBtn" is clicked, call the Javascript function "openWindow()" in the page.  That function would have the javascript needed to open the programmatic pop-up.

          • 2. Re: Place link in Flash text, which opens sized Browser window
            devidas Level 1

            I hope I understand you...

             

            1) I create a button, place instance of it on a layer, instance name is  myBTN.

             

            2) Create AScript for that button on it's own layer with following code:

             

            import flash.external.ExternalInterface;

             

            myBtn.onRelease = function(){

                 ExternalInterface.call("openWindow");

            }

             

            3)  I get stuck here:   I try the script assist in Flash and see where the URL that I want to define is inserted, but do not see where the sizing information would go in regards to the sizing, chrome, placement, scrolling.... of the opened new URL.

             

            thx....

             

            Dave

            • 3. Re: Place link in Flash text, which opens sized Browser window
              RossRitchey Level 4

              3) Everything that happens to open the window URL needs to happen in a Javascript function called "openWindow()" on the page.  This is in the HTML, not the Flash.

               

              Google Javascript Pop-up window to learn how to open the window with javascript.

              • 4. Re: Place link in Flash text, which opens sized Browser window
                devidas Level 1

                OK, got that....

                 

                So in my case, some of the browser content I have control over.  Some of the pages, I do not and I could not insert code into them.  So this is not a good solution, but there may not be a good solution according to the changes to Flash that you have brought up.

                 

                OK, thank you....!