SWF Interaction With Popups

Posted on 2006-04-09
Last Modified: 2013-11-19
I have a music track in an swf file that's called upon to play by the site's main swf upon entering my site.  The site contains a couple of getURL("","_blank"); links that cause off-site pages, with their own music tracks, to open in new windows.  (I have no access to the scripting of these other sites.)  Upon opening such a new window, the new Web site's music track starts, and my site's track stops.

I don't need to know the method at this time, but might it be possible to cause my site's music track to start playing again upon closing the new site's popup window, thus returing focus to my site's window?
Question by:Jonathan Greenberg
    LVL 1

    Expert Comment

    Yes - but it will be tricky, as you will have to use javascript.

    The general technique (not specific so dont worry), would be to store a reference to the popup windows you open - and then periodicaly check they are still open.  If they are closed, your javascript can send a message to your flash movie to tell it to play its tune again.

    You can excpet to encounter some issues getting this to work with all browsers though


    Author Comment

    by:Jonathan Greenberg
    Thank you, pete.  Now that I know it can be done, are you able to provide some JavaScript (even a rough example would suffice) that would do this?  (Please be assured that, whether you are able or not, I will still award the points for answering.)
    LVL 1

    Accepted Solution

    its basicaly this.

    set a timer to check periodicaly

    check your windows still open

    if it is not then tell flash
    LVL 1

    Expert Comment

    Let us know if you get into problems during the development with specific issues.

    good luck.

    Featured Post

    Course: HTML5 Mobile App Development with PhoneGap

    PhoneGap can help you leverage your already existing HTML5, JavaScript, and CSS skills in order to create and deploy cross-platform mobile apps.This program comprehensively covers HTML5 mobile app development from top to bottom.

    Join & Write a Comment

    Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System ( introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
    There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now