Results 1 to 5 of 5

Thread: How can I make my .swf play only when clicked?

  1. #1
    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.

  2. #2
    Join Date
    Jul 2009
    Location
    Washington (USA)
    Posts
    94
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Default

    can i see an example?

  3. #3
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 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 // davejob
    _____________________

  4. #4
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 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.
    _____________________

    David Demetrius // davejob
    _____________________

  5. #5
    Join Date
    Sep 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by mathewonsu View Post
    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
    well, i suppose you could put a 'STOP' action on the first frame and a 'Play on mouse click' ACTION..

    QIKFIRE

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •