5 Replies Latest reply on Mar 22, 2009 2:35 PM by robdillon

    Adding text to javascript pop up window

    Taankk
      I am opening a pop up windows with javascript from my Flash movie that works fine. Each opening window has a video in it. Now what I'd like to do is add text under/above the quick time movie inside the pop up windows. I'm not very savvy with programming and I've tried to look all over but can't find a simple direct answer, so any help would be greatly appreciated.
      Thanks!


      Here's the code I have inside the Flash movie:

      btn_rebecca.onRelease = function() {
      getURL("javascript:openNewWindow('Videos/rebecca.mov','thewin','width=500,height=400,toolb ar=no,scrollbars=no')");
      }

      And here's the code I have in the html:

      <script language="JavaScript">
      function openNewWindow(URLtoOpen, windowName, windowFeatures) {
      newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
      </script>


        • 1. Re: Adding text to javascript pop up window
          robdillon Most Valuable Participant
          What you are doing now is just creating a new html window that contains the QT movie. If you want to add text then you will have to alter the html of that window. Is there any reason why you can't format an html document to contain the text and the QT movie and then open that document?
          • 2. Re: Adding text to javascript pop up window
            Taankk Level 1
            Thanks for your message Rob! Hmmm... good question. I guess I could do that as well... I'm not sure exactly how to do that, in a way that lets me define the window size, not having scroll bars etc. like it is now, so that it looks like a pop up window and not a whole page? Also, I need to have about 20 of them, one for each QT movie, so I thought I would have been easier if I could do it with the code, and not have to create 20 pages and do all the linking etc. Any ideas how that would be done? Do I need to create those pages in dreamweaver and then link to the pages in Flash? Can I still define the window sizes and format exactly the same? Thanks!!

            • 3. Re: Adding text to javascript pop up window
              robdillon Most Valuable Participant
              An html document is an html document. If you create a document that has a line of text, then the QT movie, and then another line of text, you have the basic layout of the movie. If you just open this document in a browser, it will work as a normal html document. If you open that same page using the window.open() JS method, then you can define the chrome and size of the window.

              If you don't want to create all 20 pages and load then on your server, then you could write a JS function to write the content to an html document on the fly. You might do this by:
              1. Use window.open() to open up a blank html document,
              2. Use document.write() to write the html content that you want in that document.
              That way you can create as many custom windows with unique content as you want.

              If all of the content is static, then it really is a whole lot less work to just make the html documents and open them as needed.
              • 4. Re: Adding text to javascript pop up window
                Taankk Level 1
                Can you give me an example code and tell me where to put it? I'm a super beginner in actionscript or any programming, and don't know how to do that... I would really appreciate it! I tried to look on the Flash help section, but I'm not savvy enough to figure it out based on that. Thanks!!!
                • 5. Re: Adding text to javascript pop up window
                  robdillon Most Valuable Participant
                  None of that has anything to with actionscript. It's all done in javascript. You can find out more about javascript at: http://www.w3schools.com/js/default.asp. Discussing javascript is pretty far off the focus of this forum.