SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trying to control a function from a child window

    Hi, i'm trying to set up something that seems simple yet is evading me. I have a page that consists of two frames ('top' and 'bottom'). The top frame contains a javascript function that is used to start and stop playing mp3s via a flash file. The music is stopped by a user click using this command:

    Code:
    onClick="MM_callJS('Playa.doStop()')"
    Here is the function itself:

    Code:
    Playa.doStop = function() {
    	var p = Playa.__getPlaya();
    	if (p != null) {
    		p.SetVariable("remoteRequest", "Stop");
    	}
    };
    This all works just fine. Here's where the problem comes in... By clicking on a link in the 'bottom' frame, users can launch a new browser window that streams its OWN music upon launch, thereby competing with the music playing in the top frame of the parent window. What i need is to have this child window (on load) access the top frame of the parent window and run the 'Playa.doStop() function to stop the music.

    I thought this would do it, but it's no good.
    Code:
    <body onLoad="MM_callJS('opener.top.Playa.doStop()">
    Any insights would be golden.

    Thanks,
    Chairman Blow


    p.s. this mp3 player thing is a nice, simple, customizable feature without all the bulk of some of the others i'd found.... if anyone's interested.
    Playa streaming mp3 flash player . Not spamming... i have no affiliation with 'em.

  2. #2
    SitePoint Enthusiast RogueJedi's Avatar
    Join Date
    Oct 2001
    Location
    Texas
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This may work:
    opener.top.frames[0].Playa.doStop()
    Rob Nolan
    Do or do not, there is no try.

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2004
    Location
    Canada
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would have thought the following more likely:

    <body onLoad="opener.mytopframesname.MM_callJS('Playa.doStop()">


Bookmarks

Posting Permissions

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