8 Replies Latest reply on Mar 26, 2008 9:02 AM by Newsgroup_User

    create pop up window

    fran23
      I would like to create a pop up window- or new window to place a pdf of my resume from a button in my flash document. Can I do that and how? The instructions I found in Flash help are written for the developer mind set- I am all about visuals. If a step by step tutorial exists, even better. Thanks all.
        • 1. Re: create pop up window
          sugarfree_au Level 1
          myBtn_btn.onRelease = function(){
          getURL(" http://www.myweb.com/resume.pdf", "_blank");
          };



          • 2. Re: create pop up window
            fran23 Level 1
            I must be in the wrong thread. Did I mention visuals are my friend? How does this action work? What do I need to do to attach my pdf file to it?
            • 3. Re: create pop up window
              fran23 Level 1
              Ok. so if I use this code- where do i put my PDF/resume?

              thank you for the help.
              • 4. Re: create pop up window
                Level 7
                franny23,

                > Ok. so if I use this code- where do i put my PDF/resume?
                >
                > thank you for the help.

                Using getURL() is certainly one way to accomplish this goal. The
                getURL() function in AS2 is practically identical to the anchor tag (<a>) in
                HTML. It's mainly there for making hyperlinks (or buttons) ... basically,
                for opening documents. Usually, the to-be-opened document is an HTML page,
                but a PDF will do.

                It doesn't really matter where you put your ODF, among your site
                folders, as long as you reflect its position (its path) in your usage of
                getURL() -- just as you would with a normal HTML hyperlink.

                If your PDF and the SWF are in the same folder, you don't need a path at
                all:

                myBtn_btn.onRelease = function() {
                getURL("resume.pdf", "_blank");
                };

                If the SWF is in the root of your site, along with its HTML page (the
                page that embeds that SWF) and the PDF is in a folder called, say, pdfs,
                then your code might look like this:

                myBtn_btn.onRelease = function() {
                getURL("pdfs/resume.pdf", "_blank");
                };

                Does that make sense?

                The second parameter, "_blank", is an optional parameter that tells
                Flash how to open the new document. The default parameter is "_self", which
                means this hyperlink would replace the current page with the PDF. The user
                would have to click the Back button in order to return. The presence of
                "_blank" means the PDF will be openend in a new browser window. I don't
                know if that would count as your image of a "pop up window," but arguably it
                could.

                In the code shown, your button would have to have an instance name. The
                instance name is what gives thiat particular button a unique identifier, so
                that ActionScript can speak with it directly. As shown, the instance name
                is myBtn_btn. If you prefer, you could call it myButton or hyperlinkButton,
                or even something silly like bananas. Whatever you call it, just make sure
                to update your code to reflect that instance name.

                e.g.
                bananas.onRelease = function() {
                getURL("pdfs/resume.pdf", "_blank");
                };

                Where can you assign this instance name? Select your button on the
                Stage by clicking on it, then look at the Property inspector (Window >
                Properties). You'll see an input field for the instance name. Then you'll
                type the code shown above into a keyframe that lines up vertically with the
                keyframe that contains your button. It's recommended that you create a new
                layer just for code, because it makes all your ActionScript easier to find.


                David Stiller
                Co-author, Foundation Flash CS3 for Designers
                http://tinyurl.com/2k29mj
                "Luck is the residue of good design."


                • 5. Re: create pop up window
                  fran23 Level 1
                  Hi thanks for the reply.
                  Setting up a link in Dreamweaver/html page is easier, clicking on the dialog box and selecting a link and Dreamweaver will remember where that link is. In Flash you need to be able to communicate in Action script land where to find your link. Not so intuitive.

                  My final SWF will be placed in an html page generated from Dreamweaver, the resume pdf file will reside in the same root folder with the SWF file and index page.

                  I have named the button resume, all that said, the code should be

                  resume.onRelease = function() {
                  getURL("pdfs/resume.pdf", "_blank");
                  };

                  This code will open a new window and when it is closed my web site will still be there?
                  • 6. Re: create pop up window
                    fran23 Level 1
                    Hi thanks for the reply.
                    Setting up a link in Dreamweaver/html page is easier, clicking on the dialog box and selecting a link and Dreamweaver will remember where that link is. In Flash you need to be able to communicate in Action script land where to find your link. Not so intuitive.

                    My final SWF will be placed in an html page generated from Dreamweaver, the resume pdf file will reside in the same root folder with the SWF file and index page.

                    I have named the button resume, all that said, the code should be

                    resume.onRelease = function() {
                    getURL("pdfs/resume.pdf", "_blank");
                    };

                    This code will open a new window and when it is closed my web site will still be there?
                    • 7. Re: create pop up window
                      fran23 Level 1
                      Thank you- I figured it out.
                      • 8. Re: create pop up window
                        Level 7
                        franny23,

                        > Setting up a link in Dreamweaver/html page is easier, clicking
                        > on the dialog box and selecting a link and Dreamweaver will
                        > remember where that link is. In Flash you need to be able to
                        > communicate in Action script land where to find your link.
                        > Not so intuitive.

                        I'm not sure I understand, but if that works for you, great! :) I
                        often see hyperlinks in HTML that don't give a hint they're there, whether
                        by design (CSS, for example, or an image hyperlink) or by accident.

                        > I have named the button resume, all that said, the code should
                        > be
                        >
                        > resume.onRelease = function() {
                        > getURL("pdfs/resume.pdf", "_blank");
                        > };

                        Yes, that looks fine for ActionScript 1.0 or 2.0.

                        > This code will open a new window and when it is closed my web
                        > site will still be there?

                        Because it opens a new window, the original browser window remains
                        unchanged.


                        David Stiller
                        Adobe Community Expert
                        Dev blog, http://www.quip.net/blog/
                        "Luck is the residue of good design."