9 Replies Latest reply on Jan 10, 2007 11:32 PM by kglad

    link from popup to parent

    roulatorbey
      Hi,

      I am creating a flash website, and there is a readmore button that shows a popup window. and then in the popup window there is a link to the contact us page which is not a popup but on the main page.

      when someone clicks on the contactus link from the popup, the popup should close and the main page should go to the frame that contains the contact us page.

      anyone knows what is the action script that i should put in the popup window to close it and go to the contact page?

      i hope this is clear enough...

      thank you for your help.
        • 1. Re: link from popup to parent
          kglad Adobe Community Professional & MVP
          in your popup you'll need to use the localconnection class to communicate with your main swf that contains your contact us info and you'll need to communicate with some javascript to close your pop-up.

          using the externalinterface class is the most reliable way to call the javascript function though you might find it easier to use getURL() to call a javascript function defined in your popup.
          • 2. link from popup to parent
            roulatorbey Level 1
            hey thanks for your reply...

            i forgot to mention that i am not an expert so i didnt understand anything from what you said :) is there a simple way to explain it? i was guessing it's something like parent.gotoandstop(contactpage) and popup.close... something like that?

            note: its all in flash, no html
            • 3. Re: link from popup to parent
              kglad Adobe Community Professional & MVP
              there's no simple way to explain it. first, check the help documents for localconnection to see if you can manage to get the two swfs to communicate.
              • 4. Re: link from popup to parent
                roulatorbey Level 1
                they are not two swfs, it's only one with different library items that need to communicate.
                • 5. Re: link from popup to parent
                  kglad Adobe Community Professional & MVP
                  what's in the popup window?
                  • 6. Re: link from popup to parent
                    roulatorbey Level 1
                    it's actually a flash template for a website, i'm customizing the template for a friend.
                    so the website has home page, about us, contact us, etc...
                    on each of those pages, there is a read more button that i click, and the popup shows with different text for each page.
                    the popup window is a movie clip called "TM_track_mov" in the library.
                    when i double click on it to modify it, it shows text and it has only one frame, then i double click that text again, and enter another editing mode for another movie clip called "TM_main_cont_page1" inside the first movie clip with one frame only also and same text, and then i have to double click that too to enter a third editing mode for a movie clip called "TM_page_content_scroll" which has many frame, each frame has different text, and this is where i can edit the text on each frame to match the page that i want, for example if i click the readmore button in the homepage, i use the following code:
                    on (release) {
                    _root.popup_pressed=1;
                    _root.scrHEIGHT=240
                    _root.scroller.scroller.gotoAndStop(2);

                    _root.TM_title = "Group Profile";
                    _root.READ = 1;
                    _root.scroller.gotoAndPlay("s1");
                    }
                    and if i click it from the second readmore button in the about us page for example, i use the following code:
                    on (release) {
                    _root.popup_pressed=1;
                    _root.scrHEIGHT=240
                    _root.scroller.scroller.gotoAndStop(2);

                    _root.TM_title = "Professional Corporate Services";
                    _root.READ = 2;
                    _root.scroller.gotoAndPlay("s1");
                    }
                    so i just modify the _root.READ to go to the right frame in the popup.

                    now i am having a link in the popup, which is supposed to go to contact us page, and i dont know how to link from the popup to the contactus page :S
                    so the popup has text, and then it says: click here to contact us. so when you click here, the popup is supposed to close and then go to the contact us page which is a movie clip called "page6_contect_scroll"

                    sorry about the headache and thanks for all your replies...
                    • 7. Re: link from popup to parent
                      kglad Adobe Community Professional & MVP
                      where's the code that creates, what you are calling, a popup?
                      • 8. Re: link from popup to parent
                        roulatorbey Level 1
                        hi, hope you had a nice holiday...

                        if you want to know what i mean by popup you can check the website here www.greeceonnet.com and click the "read more" button on any page.

                        I don't know what's the code creating the popup, maybe its a popup component or something i couldn't figure out.

                        I think its a group of movie clips and then a scroll I don't know really :S

                        If this is not clear then forget it, and thanks a lot for all your answers.
                        • 9. Re: link from popup to parent
                          kglad Adobe Community Professional & MVP
                          that "popup" is a movieclip in the same swf as the rest of your site. you need not use localconnection.

                          you can use removeMovieClip() to close that window and use the same code that your contacts button uses to open the contact form.