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.
|
|
|
|
|
![]() |
||
Problem with iframe & Javascript - Trying to communicate with a flash movie
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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="clsid 27CDB6E-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> |
|
|
|
|||
|
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.
|
![]() |
| Tags |
| problem, iframe, javascript, trying, communicate, flash, movie |
| Thread Tools | |
|
|
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 |