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

This is a discussion on "Problem with iframe & Javascript - Trying to communicate with a flash movie" within the JavaScript Forum section. This forum, and the thread "Problem with iframe & Javascript - Trying to communicate with a flash movie are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 26th, 2006, 00:04
New Member
Join Date: Jan 2006
Age: 28
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:


<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="clsid27CDB6E-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>
Reply With Quote

  #2 (permalink)  
Old Feb 5th, 2006, 03:06
Junior Member
Join Date: Jul 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to phleet
Re: Problem with iframe & Javascript - Trying to communicate with a flash movie

I'm not entirely sure, but try window.playMovie() or window.parent.playMovie() in the link in the iframe. I hardly see why you need to use an iFrame in the first place though.
Reply With Quote
Reply

Tags
problem, iframe, javascript, trying, communicate, flash, movie

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript & Flash video problem in IE let2008 JavaScript Forum 1 May 2nd, 2008 09:58
Problem with xml-flash and loading movie property mars Flash & Multimedia Forum 8 Apr 11th, 2008 17:41
Javascript and flash movie jasonjkd JavaScript Forum 13 Nov 1st, 2007 20:06
Problem with Mouseover in Flash Movie thomas159 Flash & Multimedia Forum 1 Sep 11th, 2007 16:46
Can a jsp file in an IFrame calls a javascript function outside of the IFrame jadeite100 JavaScript Forum 0 May 31st, 2007 14:29


All times are GMT. The time now is 23:59.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43