Go Back   Dynamic Drive Forums > General Coding > Flash
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #1  
Old 10-31-2009, 08:11 AM
mathewonsu mathewonsu is offline
New Comer (less than 5 posts)
 
Join Date: Oct 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How can I make my .swf play only when clicked?

The title explains it.
How can I make my .swf's play only when clicked?
I'm new to this and when I open a page I only want the .swf files to play when clicked on.
HTML or Javascript please.

I appreciate anyone who helps

Last edited by mathewonsu; 11-06-2009 at 10:53 AM.
Reply With Quote
  #2  
Old 11-03-2009, 01:00 AM
kaos kaos is offline
Junior Coders
 
Join Date: Jul 2009
Location: I live in Washington (USA)
Posts: 66
Thanks: 3
Thanked 3 Times in 3 Posts
Default

can i see an example?
Reply With Quote
  #3  
Old 11-03-2009, 01:18 AM
davelf's Avatar
davelf davelf is offline
Regular Coders
 
Join Date: Jul 2009
Location: earth
Posts: 136
Thanks: 7
Thanked 9 Times in 9 Posts
Default

here you go:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!-- include flashembed. this file is not included in the "official" jQuery tools package -->
<script type="text/javascript" src="http://static.flowplayer.org/js/tools/tools.flashembed-1.0.4.min.js"></script>


<style>
#flash {
	width:785px;
	height:300px;
	background-color:#333;
	border:1px outset #000;
	text-align:center;
	cursor:pointer;
	
}

#flash h2 {
	font-size:40px;
	color:#fff;
	margin-top:80px;
}

</style>



<script>
// script inside the domReady method is executed after page is scriptable
flashembed.domReady(function() {

	// get flash container and assign click handler for it
	document.getElementById("flash").onclick = function() {

		// when being clicked -> load flash inside "this".
		flashembed(this, "wall.swf");
	}
});
</script>

<!-- our flash container with some initial HTML inside it -->
<div id="flash">
	<h2>Click here to play movie</h2>
</div>
hope this help you, good luck.
__________________
_____________________

David Demetrius // imaxxo
_____________________
Reply With Quote
  #4  
Old 11-07-2009, 02:31 AM
davelf's Avatar
davelf davelf is offline
Regular Coders
 
Join Date: Jul 2009
Location: earth
Posts: 136
Thanks: 7
Thanked 9 Times in 9 Posts
Default

Hi mathew, i give you the files demo of that embed flash:

demo.zip

for other information about this, see at:

play flash on click

Hope this will help you, good luck.
Attached Files
File Type: zip flashOnClick.zip (24.2 KB, 77 views)
__________________
_____________________

David Demetrius // imaxxo
_____________________
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Forum Jump


All times are GMT. The time now is 05:31 AM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.