Home Tutorial Java Jsp Embed Flash file in JSP

 
 

Share on Google+Share on Google+
Embed Flash file in JSP
Posted on: July 2, 2010 at 12:00 AM
Advertisement
In this Section, we will discuss about how to insert a flash file in JSP.

Embed Flash file in JSP

In this Section, we will discuss about how to insert a flash file in JSP. In the example given below we have used HTML tag in JSP code to embed flash file.

<OBJECT> in HTML  is used to insert an object in html document and also provide all the information to run this object.

<PARAM> in HTML  is used to pass the parameters that are required to implement the object.

<EMBED> in HTML is provide easiest and most supportive way to embed video, sound, flash files in the web page. We can add Real Media, Quick Time movies, Windows Media, Flash animations in web page through <EMBED> tag.

GENERAL CODE TO INSERT FLASH FILE(.swf) IN JSP :

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.
com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="225" height="113">
<param name="quality" value="high">
<embed src="Yourfilename.swf " quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"  width="225" height="113">
</embed>
</object>

Most of the code  you don't need to touch, so don't worry about making sense of that. The italicized section sets the codebase for the version of Flash used, to check against to see if your user has that version. The rest has taglines to download the Flash player (if the user doesn't have it) and the parameters that you would need to edit--mainly, the line labeled EMBED src="Yourfilename.swf".

Example :

flash_jsp.jsp

<HTML>

<HEAD>

<meta http-equiv=Content-Type content="text/html;

charset=Big5">

<TITLE>Embed flash file in jsp page.</TITLE>

</HEAD>

<BODY bgcolor="red">

<p><font size="6"color="blue">

<% out.println("This is embedded flash file in jsp page."); %>

</font></p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

codebase="http://download.macromedia.com/

pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"

width="225" height="113">

<param name="quality" value="high">

<embed src="whitebird1.swf" quality="high"

pluginspage="http://www.macromedia.com/go/getflashplayer"

type="application/x-shockwave-flash" width="225" height="113">

</embed>

<embed src="flyingsnail1.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"

type="application/x-shockwave-flash" width="225" height="113">

</embed>

</object>

</div>

</BODY>

</HTML>

 

OUTPUT :

Download Source Code

Advertisement

Related Tags for Embed Flash file in JSP:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 2, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com