9 Replies Latest reply on Dec 4, 2006 11:18 AM by Xtramania

    How can I control an browser from Director

    Level 7
      Hi

      I need to start browser from director, with some definite link and than
      close it when user klicks a button

      How can this be done?

      Thanx
      Jorg


        • 1. Re: How can I control an browser from Director
          Level 7
          You can open a browser window from Director by using the gotoNetPage()
          function. Just specify the URL that you want. To close this window from
          Director is a whole different operation.

          Browser windows can only be closed remotely using Javascript. If this
          same browser window was not opened using js, then the window may not be
          closable using js. Each browser reacts differently to remote js
          commands. A window.X.close(), where X is the name of the window that was
          opened, will work from some browsers, it will generate an error message
          from others. Internet Explorer will generate a message that will make
          you think that this action will cause a change in the Earth's rotation.
          This is because Microsoft did not invent Javascript.

          You have no control over what browser the end user will be using, and
          you have no control over how the user's browser will react.

          If you can generate the page that you want to show using a cgi, then you
          can usually close the page using Javascript. The best method to close
          the window is to use a JS function on the page to be closed. Call the
          function from Director.

          --
          Rob
          _______
          Rob Dillon
          Adobe Community Expert
          http://www.ddg-designs.com
          412-243-9119

          http://www.macromedia.com/software/trial/
          • 2. Re: How can I control an browser from Director
            Level 7
            Thank you Rob.

            But how do I call a JS function in definite browser window?
            How Do I know which of the opened browser windows is "my", opened by my
            application?

            Probably I can use badapi Xtra to define window actual for me and close it
            to with budApi Functions?
            Or is there any other approach?


            "Rob Dillon - Adobe Community Expert" <rob@-remove-ddg-designs.com> wrote in
            message news:rob-5F2255.07454727112006@forums.macromedia.com...
            > You can open a browser window from Director by using the gotoNetPage()
            > function. Just specify the URL that you want. To close this window from
            > Director is a whole different operation.
            >
            > Browser windows can only be closed remotely using Javascript. If this
            > same browser window was not opened using js, then the window may not be
            > closable using js. Each browser reacts differently to remote js
            > commands. A window.X.close(), where X is the name of the window that was
            > opened, will work from some browsers, it will generate an error message
            > from others. Internet Explorer will generate a message that will make
            > you think that this action will cause a change in the Earth's rotation.
            > This is because Microsoft did not invent Javascript.
            >
            > You have no control over what browser the end user will be using, and
            > you have no control over how the user's browser will react.
            >
            > If you can generate the page that you want to show using a cgi, then you
            > can usually close the page using Javascript. The best method to close
            > the window is to use a JS function on the page to be closed. Call the
            > function from Director.
            >
            > --
            > Rob
            > _______
            > Rob Dillon
            > Adobe Community Expert
            > http://www.ddg-designs.com
            > 412-243-9119
            >
            > http://www.macromedia.com/software/trial/


            • 3. Re: How can I control an browser from Director
              Level 7
              If you use a cgi to open the window, you can add a name parameter in the
              head of the document, you can also just write in a name parameter. Look
              at the window.name object in any Javascript reference.

              You may be able to use BuddyAPI for this. I've never tried. Remember
              that BuddyAPI only works from a projector.

              In article <ekeps8$4u6$1@forums.macromedia.com>,
              "Jorg Mann" <jorg.mann@gmx.de> wrote:

              > Thank you Rob.
              >
              > But how do I call a JS function in definite browser window?
              > How Do I know which of the opened browser windows is "my", opened by my
              > application?
              >
              > Probably I can use badapi Xtra to define window actual for me and close it
              > to with budApi Functions?
              > Or is there any other approach?
              >
              >
              > "Rob Dillon - Adobe Community Expert" <rob@-remove-ddg-designs.com> wrote in
              > message news:rob-5F2255.07454727112006@forums.macromedia.com...
              > > You can open a browser window from Director by using the gotoNetPage()
              > > function. Just specify the URL that you want. To close this window from
              > > Director is a whole different operation.
              > >
              > > Browser windows can only be closed remotely using Javascript. If this
              > > same browser window was not opened using js, then the window may not be
              > > closable using js. Each browser reacts differently to remote js
              > > commands. A window.X.close(), where X is the name of the window that was
              > > opened, will work from some browsers, it will generate an error message
              > > from others. Internet Explorer will generate a message that will make
              > > you think that this action will cause a change in the Earth's rotation.
              > > This is because Microsoft did not invent Javascript.
              > >
              > > You have no control over what browser the end user will be using, and
              > > you have no control over how the user's browser will react.
              > >
              > > If you can generate the page that you want to show using a cgi, then you
              > > can usually close the page using Javascript. The best method to close
              > > the window is to use a JS function on the page to be closed. Call the
              > > function from Director.
              > >
              > > --
              > > Rob
              > > _______
              > > Rob Dillon
              > > Adobe Community Expert
              > > http://www.ddg-designs.com
              > > 412-243-9119
              > >
              > > http://www.macromedia.com/software/trial/

              --
              Rob
              _______
              Rob Dillon
              Adobe Community Expert
              http://www.ddg-designs.com
              412-243-9119

              http://www.macromedia.com/software/trial/
              • 4. Re: How can I control an browser from Director
                Level 7
                but if I do no use Budapi, I still not get it, how can I close the window of
                browser?
                How can I communicate from director to window, opened with command
                gotoNetPage?
                Director Movie is working as projector, not as shockwave




                "Rob Dillon - Adobe Community Expert" <rob@-remove-ddg-designs.com> wrote in
                message news:rob-BD9969.08531627112006@forums.macromedia.com...
                > If you use a cgi to open the window, you can add a name parameter in the
                > head of the document, you can also just write in a name parameter. Look
                > at the window.name object in any Javascript reference.
                >
                > You may be able to use BuddyAPI for this. I've never tried. Remember
                > that BuddyAPI only works from a projector.
                >
                > In article <ekeps8$4u6$1@forums.macromedia.com>,
                > "Jorg Mann" <jorg.mann@gmx.de> wrote:
                >
                > > Thank you Rob.
                > >
                > > But how do I call a JS function in definite browser window?
                > > How Do I know which of the opened browser windows is "my", opened by my
                > > application?
                > >
                > > Probably I can use badapi Xtra to define window actual for me and close
                it
                > > to with budApi Functions?
                > > Or is there any other approach?
                > >
                > >
                > > "Rob Dillon - Adobe Community Expert" <rob@-remove-ddg-designs.com>
                wrote in
                > > message news:rob-5F2255.07454727112006@forums.macromedia.com...
                > > > You can open a browser window from Director by using the gotoNetPage()
                > > > function. Just specify the URL that you want. To close this window
                from
                > > > Director is a whole different operation.
                > > >
                > > > Browser windows can only be closed remotely using Javascript. If this
                > > > same browser window was not opened using js, then the window may not
                be
                > > > closable using js. Each browser reacts differently to remote js
                > > > commands. A window.X.close(), where X is the name of the window that
                was
                > > > opened, will work from some browsers, it will generate an error
                message
                > > > from others. Internet Explorer will generate a message that will make
                > > > you think that this action will cause a change in the Earth's
                rotation.
                > > > This is because Microsoft did not invent Javascript.
                > > >
                > > > You have no control over what browser the end user will be using, and
                > > > you have no control over how the user's browser will react.
                > > >
                > > > If you can generate the page that you want to show using a cgi, then
                you
                > > > can usually close the page using Javascript. The best method to close
                > > > the window is to use a JS function on the page to be closed. Call the
                > > > function from Director.
                > > >
                > > > --
                > > > Rob
                > > > _______
                > > > Rob Dillon
                > > > Adobe Community Expert
                > > > http://www.ddg-designs.com
                > > > 412-243-9119
                > > >
                > > > http://www.macromedia.com/software/trial/
                >
                > --
                > Rob
                > _______
                > Rob Dillon
                > Adobe Community Expert
                > http://www.ddg-designs.com
                > 412-243-9119
                >
                > http://www.macromedia.com/software/trial/


                • 5. Re: How can I control an browser from Director
                  Level 7
                  This is not really an answer to your question as much as just something
                  to think about. Why is it so important that you close the user's
                  browser window? I personally find it extremely annoying when I am using
                  a program and they decide to start closing my windows. I use Firefox,
                  not IE, and I typically have multiple tabs open. If I were to use your
                  program as you are describing, it will open a new tab (the default
                  behaviour for gotoNetPage), then try to close all of Firefox (since all
                  the tabs are in the same window). If you close my browser while I have
                  stuff that hasn't been saved or something, I will be very upset.

                  Basically, what I'm saying is that it may be a good idea (as well as
                  being a WHOLE lot easier to program) to just send a popup on the
                  projector's screen saying that the user can close their browser now if
                  they wish.

                  I'm sure there is a way to close just the tab you are interested in in
                  Firefox if you want to do the research to find it out. But then, what
                  happens if a user is using Opera? What happens if a user has javascript
                  disabled (as many people and corporate IT departments will do for
                  security)? Then your code will fail. It's a lot easier to just tell
                  the user that the browser thing is done, go ahead and close it please.
                  • 6. Re: How can I control an browser from Director
                    Level 7
                    As Mike said, just because you can do something, that doesn't mean that
                    you should do it. You need to think about what it is that you doing for
                    your end user. If you want to open a browser window and show them a web
                    site, then use gotoNetPage to open that URL. In most circumstances, this
                    will put the new browser window in front of your projector window. The
                    user can get back to the projector by clicking on the projector's window.

                    If you are working strickly in Windows, then you might want to look at
                    the WebXtra. This will let you run a browser window inside the Director
                    stage. There is also the WebViewer Xtra, this one is cross platform. I
                    know nothing about either of these xtras.

                    Taking things away from a user, like a browser window, needs to be
                    considered from both viewpoints, yours and theirs. Since all browsers
                    work differently, you need to know and anticipate what will happen if
                    you close their browser. As Mike said, tabs are one thing to consider.
                    The user may also be downloading files, monitoring a server, etc. If you
                    arbitrarily close their connection, you may have wrecked their day.

                    Think very carefully about what you are trying to accomplish and then
                    set your design to simplify the user's experience and make that
                    experience as pleasant as possible.

                    --
                    Rob
                    _______
                    Rob Dillon
                    Adobe Community Expert
                    http://www.ddg-designs.com
                    412-243-9119

                    http://www.macromedia.com/software/trial/
                    • 7. Re: How can I control an browser from Director
                      Level 7
                      Did you notice in the first post where it says "when the user clicks a
                      button"? It is clearly stated that it would be up to the user to click a
                      button when they feel comfortable to do so. To me the question is, more why
                      can't they just click the quit button on the browser?

                      Cheers!
                      Timm

                      "Mike Blaustein" <mblaustein@gmail.com> wrote in message
                      news:ekf0qj$csh$1@forums.macromedia.com...
                      > This is not really an answer to your question as much as just something to
                      > think about. Why is it so important that you close the user's browser
                      > window? I personally find it extremely annoying when I am using a program
                      > and they decide to start closing my windows. I use Firefox, not IE, and I
                      > typically have multiple tabs open. If I were to use your program as you
                      > are describing, it will open a new tab (the default behaviour for
                      > gotoNetPage), then try to close all of Firefox (since all the tabs are in
                      > the same window). If you close my browser while I have stuff that hasn't
                      > been saved or something, I will be very upset.
                      >
                      > Basically, what I'm saying is that it may be a good idea (as well as being
                      > a WHOLE lot easier to program) to just send a popup on the projector's
                      > screen saying that the user can close their browser now if they wish.
                      >
                      > I'm sure there is a way to close just the tab you are interested in in
                      > Firefox if you want to do the research to find it out. But then, what
                      > happens if a user is using Opera? What happens if a user has javascript
                      > disabled (as many people and corporate IT departments will do for
                      > security)? Then your code will fail. It's a lot easier to just tell the
                      > user that the browser thing is done, go ahead and close it please.


                      • 8. Re: How can I control an browser from Director
                        Level 7
                        Jorg,

                        Is this for a kiosk where you want them to stay within a certain website? Or
                        is this for a marketing CD where they jump to a site, local web content, or
                        something else? It makes a difference. Also, does it need to be
                        cross-platform?

                        If it's just a promotional CD, you can just use "gotoNetPage "URL",
                        {"targetName"}", and let them close the browser with the usual quit button.

                        If it's for a kiosk, or controlled environment and Windows, you can use an
                        ActiveX web browser right in Director. You have to set up the web page with
                        really good navigation so they don't need the back button. Thee one problem
                        with this is the tab key doesn't work right in forms. A way to work around
                        this is by making a VB wrapper around the ActiveX that fills the screen with
                        a quit button near the bottom that just quits the VB and you're right there
                        with your Director screen showing.

                        Timm


                        "Jorg Mann" <jorg.mann@gmx.de> wrote in message
                        news:eke911$e69$1@forums.macromedia.com...
                        > Hi
                        >
                        > I need to start browser from director, with some definite link and than
                        > close it when user klicks a button
                        >
                        > How can this be done?
                        >
                        > Thanx
                        > Jorg
                        >
                        >


                        • 9. Re: How can I control an browser from Director
                          Xtramania Level 1
                          quote:

                          Originally posted by: Newsgroup User
                          ...
                          If it's for a kiosk, or controlled environment and Windows, you can use an
                          ActiveX web browser right in Director. You have to set up the web page with
                          really good navigation so they don't need the back button. Thee one problem
                          with this is the tab key doesn't work right in forms.
                          A way to work around
                          this is by making a VB wrapper around the ActiveX that fills the screen with
                          a quit button near the bottom that just quits the VB and you're right there
                          with your Director screen showing.

                          Timm



                          The latest version of ActiveCompanionSet :: ActiveX xtra can properly handle Tab and other keys (Del, Ctrl+C, Ctrl+V etc) with Internet Explorer ActiveX on stage.

                          Eugene