Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActionScript to close a pop-up window..?

Status
Not open for further replies.

jst

Programmer
Aug 1, 2001
25
0
0
GB
I have a movie which is self-contained in a small pop-up window which is launched from the main web-page.

Is it possible to use ActionScript in the final frame of the movie to automatically CLOSE the pop-up window that contains it..? In other words, the user would click on a link on the main web-page to launch the pop-up window which show the movie, and when the movie finishes, the pop-up window closes itself.

If I was inserting a clickable link in standard html/javascript I'd use:

<a href=&quot;#&quot; onClick=&quot;self.close();return false;&quot;>Close Window </a>

but, as a newcomer to Flash5, I can't work out if this is adaptable for ActionScript to automatically close the window with NO action from the user.

Any suggestions gratefully received!
 
hi JST

there's a couple of methods of closing pop-ups in the FAQ section.

dave
dave@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^​
 
Many thanks!

I thought they all refered to launching a pop-up window rather than if the movie was actually WITHIN one... but right at the bottom lies the solution.

I've adapted it as follows:

-- Make your final movie frame a KeyFrame
-- Right-click on the frame.. select Actions..
-- Double-click on Basic Actions.. getURL..

-- In the URL box at the bottom of the actionscript window type: javascript:window.close()

-- Leave the &quot;window&quot; box blank

-- Select &quot;don't send&quot;


Thanks again. Excellent!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top