• 0

javascript/actionscript/html help


Question

I'm building a website for a university project and i've hit a bit of a wall... I have a couple of flash objects (flv player) in hidden divs, which use javascript to pop up. i noticed that once one of the divs is closed, the video/audio from that div will keep playing unless paused/stopped while the div is visible. I've been trying to figure out a way to stop playback of the swf files via a javascript function to no avail. I essentially know nothing about javascript which really doesn't help - I only started learning html & css a few months ago but have picked it up very quickly.

As I said, I have tried a couple of methods so far as advised by friends but they relied on object tags:

<object type="application/x-shockwave-flash"
 data="video.swf" width="400" height="320" id="flvMovie">

paired with js:

function StopflvMovie()
{
    var mov=getFlashMovieObject(flvMovie");
    mov.Stop();
}

<span id="close"><a href="javascript:StopflvMovie();setVisible('layer3')" style="text-decoration: none">Close</a></span>

Now I am using swfObject to embed the flash objects so as to keep IE compatibility which means i no longer have object tags. i now have a .js file named "swfobject.js", accompanied by:

		<script type="text/javascript">
			var flashvars = {};
			var params = {};
			var attributes = {};
			attributes.id = "flashcontent";
			swfobject.embedSWF("lighthead.swf", "myAlternativeContent", "500", "100", "10", false, flashvars, params, attributes);
		</script>
				<script type="text/javascript">
			var flashvars = {};
			var params = {};
			var attributes = {};
			attributes.id = "flashcontent2";
			swfobject.embedSWF("mp3Player.swf", "myAlternativeContent2", "300", "100", "10", false, flashvars, params, attributes);
		</script>
				<script type="text/javascript">
			var flashvars = {};
			var params = {};
			var attributes = {};
			attributes.id = "flashcontent3";
			swfobject.embedSWF("video.swf", "myAlternativeContent3", "400", "320", "10", false, flashvars, params, attributes);
		</script>

and:

<div id="myAlternativeContent">
			<a href="http://www.adobe.com/go/getflashplayer">
				<img src="https://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
			</a>
		</div>
<div id="myAlternativeContent2">
			<a href="http://www.adobe.com/go/getflashplayer">
				<img src="https://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
			</a>
		</div>
<div id="myAlternativeContent3">
			<a href="http://www.adobe.com/go/getflashplayer">
				<img src="https://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
			</a>
		</div>

(these examples cover all 3 flash objects on the page, one of which is just a header. the problem I'm having is only relevant to "mp3Player.swf" and "video.swf")

the page in question is hosted at: http://lunik.co.uk/emil/drk/media.html'>http://lunik.co.uk/emil/drk/media.html (click the small green arrow below the menu, then click "visual spectacle > stream")

and the route folder where you can find all relevant scripts etc is at: http://lunik.co.uk/emil/drk

I'm supposed to hand this project in on friday and I have to create and entire research project, portfolio and presentation to go with it, all in one day. Due to this, I will hand it in without solving this problem if necessary but I'm a perfectionist and would really appreciate any help anyone can give me!! Also, I really want to learn more about how js works and solving this problem would be a small breakthrough for me. Please help!!!!

Thanks in advance!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

thats really strange. i've tried it in FF on 3 seperate machines and it continues every time.

Also, I forgot to mention I'm using video maru 3.5b. it may help if i could find any detailed API documentation but it appears theres none to speak of. :/

Link to comment
Share on other sites

This topic is now closed to further replies.