Groups | Blog | Home
all groups > flash actionscript > december 2006 >

flash actionscript : link from popup to parent


roulatorbey
12/25/2006 2:16:30 AM
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.
kglad
12/25/2006 2:49:42 AM
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.
roulatorbey
12/25/2006 2:08:27 PM
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?
kglad
12/25/2006 3:37:45 PM
roulatorbey
12/25/2006 4:52:32 PM
kglad
12/25/2006 5:59:02 PM
roulatorbey
12/25/2006 10:18:40 PM
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...
kglad
12/26/2006 5:01:59 AM
roulatorbey
1/10/2007 9:17:25 PM
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.
kglad
1/11/2007 7:32:50 AM
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.
AddThis Social Bookmark Button