Current location: Hot Scripts Forums » General Web Coding » JavaScript » Problem with iframe & Javascript - Trying to communicate with a flash movie

Problem with iframe & Javascript - Trying to communicate with a flash movie

Reply
  #1  
Old 01-25-06, 07:21 PM
victorpantet victorpantet is offline
New Member
 
Join Date: Jan 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Problem with iframe & Javascript - Trying to communicate with a flash movie

So I have an embedded flash movie in my page, I also have an IFRAME called "content" loading a page that contains this hyperlink:

<a href="#" target="_top" onClick="playmovie()">Play</a>

I'm basically trying to call that javascript function to play my flash movie... of course I can't figure out how to target that function once my link loads into the iframe within the page that contains the javascript and the flash move... Please someone tell me what I'm doing wrong...

Below is the script I have on the main page, along with the embedded flash movie:

Code:
<SCRIPT LANGUAGE="JavaScript"> 
<!--  
var movieName = "testcommand";

function thisMovie(movieName) {
  // IE and Netscape refer to the movie object differently.
  // This function returns the appropriate syntax depending on the browser.
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[movieName]
  }	else {
    return document[movieName]
  }
}

// Checks if movie is completely loaded.
// Returns true if yes, false if no.
function movieIsLoaded (theMovie) {
  if (typeof(theMovie) != "undefined") {
    return theMovie.PercentLoaded() == 100;
  } else {
    return false;
  }
}


function playmovie() {
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).Play();
  }
}

//--> 

</SCRIPT>


<object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" 
width="336" 
height="57" 
id=testcommand>

<param name="movie" value="flashfiles/mp3.swf">
<param name="quality" value="high">

<embed 
NAME="testcommand"
src="flashfiles/mp3.swf" 
quality="high" 
swLiveConnect="true"
pluginspage="http://www.macromedia.com/go/getflashplayer" 
type="application/x-shockwave-flash" width="336" height="57">
</embed>

</object>

Last edited by TwoD; 01-27-06 at 06:28 AM. Reason: Please use [code][/code] wrappers.
Reply With Quote
  #2  
Old 01-27-06, 06:32 AM
TwoD TwoD is offline
Community Liaison
 
Join Date: Sep 2003
Location: 404
Posts: 1,811
Thanks: 0
Thanked 0 Times in 0 Posts
Try window.parent.playmovie()
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript for iframe [please help me] kapaboz JavaScript 5 06-12-06 03:16 PM
PHP and JavaScript causing a problem of storing the value phplearner PHP 4 07-24-05 12:15 AM
JavaScript command to refresh IFrame Content Thomas Walker JavaScript 2 05-05-05 11:06 AM
problem getting the REAL src of an iframe kurt_nj JavaScript 0 06-23-04 05:22 PM
javascript object hidden by flash object morlack JavaScript 1 03-09-04 06:36 AM


All times are GMT -5. The time now is 08:12 PM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2 (Unregistered)