A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: 2 flash movies playing in 2 seperate browser windows

  1. #1
    Junior Member
    Join Date
    Feb 2006
    Posts
    2

    2 flash movies playing in 2 seperate browser windows

    hi guys, this is my first ever post so i hope its not a stupid question but i have a problem i just cant figure out, and wondered if there is a way to do it.

    i have a flash movie playing in one browser. it's a website that has background music playing etc,

    there is a link in the movie to launch a new popup browser and load the other site that the link refers to.

    so when the user clicks the link the popup opens and loads the other site which also has background music playing. so now both tracks are playnig and of course. it sounds terrible.

    here's my problem. is there a way to stop the sound in the "parent" browser playing when for example the user launches the popup child window and the new movie plays?

    if the user then for example closed the child browser window, or clicked back on the parent and brought that into "focus" is it possible to then stop the child window playing and let the parent begin to play again?

    i realize there is probably some javascript as well as heavy actionscript invovled here. so i really need help, as i'm not going to be winning awards for either if you know what i mean

    i'm sorry my first post is a bit heavy.

    i have used this javascript which seems to work in identifying if the newbroser (child) is open or not, and if it is not to open another etc.,

    <script language="javascript" type="text/javascript">
    <!--
    var newwindow = '';

    function popitup(url)
    {
    if (!newwindow.closed && newwindow.location)
    {
    newwindow.location.href = url;
    }
    else
    {
    newwindow=window.open(url,'name','height=550,width =750,left=50,top=50');
    if (!newwindow.opener) newwindow.opener = self;
    }
    if (window.focus) {newwindow.focus()}

    }

    // -->
    </script>


    but i'm really completely stuck in trying to figure out how to get the sound to stop in the parent browser window when the child browser window is selected and vice versa.

    any ideas?

    thanks in advacne to everyone who takes the time and patience to read this and post a response. i'm hoping one of you guys is an expert and knows how this can be solved.

    - son of marzipan

  2. #2
    Senior Member
    Join Date
    Oct 2003
    Posts
    1,354
    The quick answer is yes. Two flash movies can communicate with one another. I just don't recall how its done at the moment. Nothing Ive ever done myself.
    Here is a link a thread that has some links to sites that have done it...

    http://flashkit.com/board/showthread...hlight=stickee

    Most portfolio sites that have this problem, simply have an action that turns off the sound of the main portfolio site when the user clicks on a 'link' button. And turns it back on, once the user clicks on the main portfolio site again. Usaully they don't have anything to turn off the music on the 'linked' site. I guess they are assuming that the user will most likely close the 'linked' site before returning to the main protfolio site.

  3. #3
    Junior Member
    Join Date
    Feb 2006
    Posts
    2
    Hey DallasNYC,

    many thanks. wow that was a damn impressive site. probably alot more advanced than what i need.

    i've been trying now with the idea of loading the sound on another level then stopping it if you go to the other browser etc., then all i can think of is to reload the site if your focus on the paretn becomes "true" again, but its getting too complex for something that i'm sure can be done a lot simplier. if only how?

    i guess thats the question most people ask....how?

    i got this deadline coming and i can feel the breath of the boss about to start breathing down my neck and that boy could do with some gum

    Son of Marzipan

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    http://www.macromedia.com/cfusion/kn...54&mode=simple

    QUOTE - One of the new powerful features in Macromedia Flash MX is a class called LocalConnection. This class has methods which allow you to send data from one movie to another without using FSCommand or JavaScript. LocalConnection sends strings and entire objects, with several properties, from one movie to another. It can also invoke ActionScript methods in the receiving movie. Using LocalConnection, you can send multiple objects as many times as necessary. The LocalConnection class works even when movies are running in different types of browser. For example, a movie running in Netscape can send a localConnection to a movie running in Internet Explorer.

  5. #5
    Member
    Join Date
    Nov 2002
    Posts
    88
    it sounds cool, I need something similar: I want to make 2 movies interact each other in this way: if I press a button, I want the other movie stop to a set frame on a timeline, so if I had buttons 1, 2, 3, 4, 5, on movie 1, I want'em to stop movie 2 on frames 1, 2, 3, 4, 5. Is it possible? I visited the link but I've still no clues...

  6. #6
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    I visited the link but I've still no clues...

    perhaps this file might help.
    http://www.jackleaman.co.uk/test/loc...ion/index.html

    If not you'll have to struggle on and test and re-test until you learn
    how to manipulate the localConnection class

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center