fcOnTheWeb Logo Web technologies, made easy.

fcOnTheWeb Red DotEmbedding Flash with SWFObject

Today we take a look slightly complex but common way to embed SWF files into your web page - SWFObject.

SWFObject is JavaScript that is used to send display the SWF in the browser. The two key reasons for using SWFObject are:

So now we know what SWFObject is and why to use it, where do we get it from? At the moment it is hosted by Google and it can be downloaded from their SVN. You can download it here: http://code.google.com/p/swfobject/downloads/list. When you download the file from Google it comes with an example that shows how to use SWFObject. That is what we have based this article off.

Below is an example of Flash embedded with SWFObject.

Your version of Flash Player is lower than the required 10.0.0.

Click below to upgrade to the latest version and then try again.

Get Adobe Flash player

This example detects for Flash Player 10.0.0. If you have an earlier version, you will be seeing the alternate text prompting you to download the latest version. For the benefit of those of us with the latest version, this is what the alternate text looks like:

Your version of Flash Player is lower than the required 10.0.0.

Click below to upgrade to the latest version and then try again.

Get Adobe Flash player

Now, onto the code we need to use to get our SWF file on the page. There are two areas of code that we need to put into our HTML to get things working: some JavaScript in the HEAD section and some HTML in the BODY. First, let's look at the JavaScript:

<script type="text/javascript" src="swfobject.js"></script>

<script type="text/javascript">

swfobject.registerObject("myId", "10.0.0");

</script>

Our first line simply includes the necessary swjobject.js file. There is nothing too amazing about that. The second line starts the custom JavaScript we have to write. Into the swfobject.registerObject method we need pass two elements - the id of our object and the version of Flash Player we want to check for. The third line simply ends our JavaScript.

The Flash Player version we are checking for is important because we will alter this to check our own alternate text. Once you have the SWF file successfully embedded onto the page, you will want to write and style your alternate text. To see this yourself you just need to change the version to something higher than you have, 20.0.0 for example, and the alternate text will display. Remember to set it back to what it should be once the text looks the way you want it to though.

Next is the HTML we add to get the SWF on the page (this is the code provided by Google):

<div>

<object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="300">

<param name="movie" value="tester.swf" />

<!--[if !IE]>-->

<object type="application/x-shockwave-flash" data="tester.swf" width="300" height="300">

<!--<![endif]-->

<div>

<h1>Alternative content</h1>

<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

</div>

<!--[if !IE]>-->

</object>

<!--<![endif]-->

</object>

</div>

We won't go through this section line by line, but we will pick out the important bits you will want to edit. Firstly in line two, the first object line, you need to edit the width and height attributes to match the width and height of your SWF.

Next, on the line beneath that, you need to change the value attribute to the path of your SWF file.

Repeat these changes for the data (SWF path), width and height attributes of the next object tag.

And lastly is the alternate content that is shown to users without the correct Flash Player. This is everything inside the div tags. Above we have an <h1> and a <p> tag. Whatever you put between the two div tags is what is shown as the alternative content. So in here you can write and style whatever you want to match the tone and look of your web page.

And that's about all there is to it. There are more elements surrounding SWFObject that we will go into at a later stage, such as the passing in of optional parameters and that sort of thing. But today we have covered enough to get a basic understanding of SWFObject and get you started with it on your website. For more information you can refer to Google's documentation on how to use SWFObject, http://code.google.com/p/swfobject/wiki/documentation.

From now on fcOnTheWeb.com will be using this SWFObject and this style of implementation to embed all their Flash.

ferrari_chris

Cheap Ralph Lauren UK (http://cheapralphlaurenuk.1minutesite.co.uk/) says:

2014-01-17 21:07:03

Gucci Shoes UK, http://www.guccivshoesfactory.net/
Polo Ralph Lauren Outlet Online, http://www.rralphlaurenoutlet.com/
Ralph Lauren Outlet Online, http://www.ralphlaurenipolo.com/
Ralph Lauren UK, http://www.polo-outletstoreonline.com/
Beats by Dre, http://www.discountbeatsbydresale.com/
Sacs Longchamp Pairs, http://www.saclongchamppairs.com/
Canada Goose Outlet, http://www.thecanadagooseoutlet.com/
Hollister UK Shops, http://www.cheaphollistersale.co.uk/
Michael Kors Outlet Online, http://www.michaelkors.so/
Marc Jacobs Outlet, http://www.marcjacobsonsale.com/
Michael Kors Outlet, http://www.michaelkorsr.com/
North Jackets Clearance, http://www.north-faceoutletonlines.net/
Burberry Outlet Online, http://www.burbagssale2013.com/
North Clearance Outlet Online, http://www.north-clearance.com/
Coach Factory, http://www.coach-factories.com/
Coach Outlet Online, http://www.coach-purseonsale.com/
Cheap Ralph Lauren UK, http://cheapralphlaurenuk.1minutesite.co.uk/
http://marcjacobsoutlet-2014.tripod.com/
http://www.michaelkorsoutletr.com/
Michael Kors Outlet
Discount Michael Kors
http://www.michael-korsfactorystore.com/
Michael Kors Outlet
Michael Kors Factory Store
http://www.michaellkorsfactoryonline.com/
Michael Kors Outlet
Discount micheal kors

__________

awaw (http://awa) says:

2014-04-03 09:16:15

awaw

__________

oakley sunglasses cheap (http://www.oakleysunglassescheap.us.com/) says:

2014-07-12 02:07:56

http://www.oakleysunglassescheap.us.com/ oakley sunglasses

cheap
http://www.coachoutletstoreonlineco.com/ coach factory outlet
http://www.abercrombie-andfitch.com/ abercrombie and fitch
http://www.michaelkors-outletsonline.com/ michael kors outlet
http://www.oakley-sunglassesoutlet.com/ oakley sunglasses

outlet
http://www.tory-burchoutlet.com/ tory burch outlet
http://www.abercrombieandfitchstore.com/ abercrombie & fitch
http://www.rayban--sunglasses.com/ ray ban sunglasses
http://www.fit-flops.co.uk/ fitflops
http://www.coachoutlet-factoryonline.com/ coach factory outlet
http://www.toryburch-shoes.com/ tory burch shoes
http://www.coachstoreonline.org/ coach outlet store online
http://www.coachfactory-outletinc.com/ coach factory outlet
http://www.cheapraybansunglasses.us/ cheap ray ban sunglasses
http://www.valentino.us.com/ valentino
http://www.fitfloponline.co.uk/ fitflop uk
http://www.coach-outletinc.com/ coach outlet
http://www.coachoutlet-factorystore.com/ coach outlet store

online
http://www.airjordan.us.com/ air jordan
http://www.timberlandshoesus.com/ timberland shoes
http://www.michaelkorsoutlet-online.us/ michael kors outlet
http://www.coachfactoryoutletnew.com/ coach factory outlet
http://www.coach-factoryoutletinc.com/ coach factory outlet
http://www.truereligionbrandjeans.us.com/ true religion outlet
http://www.truereligionjeans.us.com/ true religion jeans
http://www.coach--handbags.com/ coach outlet online
http://www.louisvuitton--outlet.us/ louis vuitton outlet
http://www.timberland--shoes.com/ timberland boots
http://www.isabelmarantshoes.us.com/ isabel marant shoes
http://www.coachoutletonline-factory.com/ coach outlet online
http://www.michaelkorsoutlet-online.net/ michael kors purses
http://www.louisvuitton-handbag.us/ louis vuitton handbags
http://www.coach-outletstoreonline.com/ coach outlet store

online
http://www.true-religion-jeans.com/ true religion jeans
http://www.coach-outletfactoryonline.com/ coach factory outlet

online
http://www.officialcoachfactoryoutlet.com/ coach factory outlet
http://www.louisvuitton-outlet.org/ louis vuitton outlet
http://www.coach-factoryoutlets.com/ coach factory outlet
http://www.coach-outletonline.us/ coach outlet online
http://www.michaelkorsoutletonlinestore.us/ michael kors outlet
http://www.michaelkorsoutletstoresco.com/ michael kors outlet

store
http://www.tiffanysjewelry-co.com/ tiffany and co jewelry
http://www.celineoutlet-online.com/ celine outlet
http://www.cheap-toms.net/ toms shoes
http://www.celine-handbags.com/ celine handbags
http://www.toms--shoes.us/ toms outlet
http://www.fitflopsandalssale.com/ fitflops
http://www.fitflopusaonline.com/ fitflop outlet
http://www.prada-handbag.com/ prada handbags
http://www.tiffanyandcoinc.com/ tiffany jewelry
http://www.prada-outlet.org/ prada outlet
http://www.michael-korsoutletinc.com/ michael kors
http://www.marcjacobs.us.com/ marc jacobs
http://www.supra.us.com/ supra shoes
http://www.ralphlauren.us.com/ polo ralph lauren
http://www.tiffanyjewelry.us.com/ tiffany jewelry
http://www.shoestoms.net/ toms shoes

__________

POLO says:

2014-08-04 03:01:10

http://www.superbagsmarket.com/ Super Bags Market
http://www.nike-jordanshoes.com/ Nike Jordan Shoes
http://www.thebeatsbydre.net/ Beats By Dre Outlet
http://www.michaelusakors.com/ Michael Kors Outlet Online
http://www.polo-tshirts.com/ Ralph Polo Outlet Online
http://www.northsclearance.com/ North Clearace Outlet
http://www.polo-ralphlaurenonline.com/ Ralph Polo Outlet
http://www.guccishoesuk-2014.net/ Gucci Shoes Outlet
http://www.michaelkorsstates.com/ Michael Kors Outlet
http://www.polooutlet-store.com/ Polo Outlet Store
http://www.ralph-laurenhome.com/ Ralph Lauren UK
http://www.marcjacobsonsale.com/ Marc Jacobs On Sale
http://www.mcmworldwides.com/ MCM Outlet
http://www.salongchamppairs.com/ Sac Longchamp Pairs
http://www.canada-gooser.com/ Canada Goose Outlet
http://www.burberrybags2014.com/ Burberry Outlet
http://www.michaelkors.so/ Michael Kors Outlet
http://www.oakley-sunglassfactory.com/ Oakley Sunglaases Factory
http://www.north-faceoutlet.us.com/ North Face Outlet Online
http://www.moncler-clearance.com/ Moncler Clearance
http://www.woolrich-clearance.com/ Woolrich Clearance
http://www.barbour-jacketsoutlet.com/ Barbour Jackets Outlet Online
http://www.moncler-jacketsoutletonline.com/ Moncler Jackets Outlet Online
http://www.monsterbeatsbydres.net/ Monster Beats Outlet
http://www.louis-vuittonblackfriday.com/ Louis Vuitton Outlet
http://www.lv-guccishoesfactory.com/ Louis Vuitton Factory
http://www.mcmoutlet-jp.com/ MCM 店铺
http://www.cheapdiscountoutlet.com/ Discount Clothes Sale
http://www.michael-korsfactoryonline.com/ Michael Kors Factory Online
http://www.coach-factoryoutlets.net/ Coach Factory Outlet
http://www.coach-blackfriday.net/ Coach Black Friday
http://www.coach-storeoutletonline.com/ Coach Store Outlet Online
http://www.coach-factoryoutletonlines.com/ Coach Factory Outlet Online
http://www.coachcoachoutlet.net/ Coach Outlet
http://www.coach-factory.net/ Coach Factory
http://www.coach-pursesoutlet.net/ Coach Purses Outlet Online
http://www.coach-outletonline.net/ Coach Outlet USA
http://www.mksfactoryoutlet.com/ Michael Kors Factory Outlet
http://www.zxcoachoutlet.com/ Coach Outlet Online USA
http://www.mischristmas.com/ Coach Factory Outlet Online
http://www.misblackfriday.com/ Black Friday
http://www.newoutletonlinemall.com/ Coach Purses Outlet Online
http://www.clickmichaelkors.com/ Michael Kors USA
http://www.cmichaelkorsoutlet.com/ Michael Kors Outlet USA
http://www.ralphlaurenepolo.com/ Ralph Lauren Polo

__________

http://www.monserviceplus.fr (http://www.monserviceplus.fr) says:

2014-11-13 20:30:52

Of particular note is that Vanke,

__________

wlp (http://www) says:

2015-06-06 02:58:58

burberry outlet, http://www.burberry-outlet.jp.net/
burberry outlet online, http://www.burberryoutlet.org.uk/
burbery outlet store, http://www.burberryoutlet-online.co.com/
burberry outlet, http://www.burberryoutlet-online.in.net/
calvin kleins outlet, http://www.calvinklein.co.com/
celine bags, http://www.celinebags.org/
chanel bags, http://www.chanelhandbags.net.co/
softball bats, http://www.cheapbaseballbats.net/
christian louboutin outlet, http://www.christianlouboutinshoes.ar.com/
baseball jerseys, http://www.cheapjerseys.in.net/
air jordan shoes, http://www.cheap-jordans.net/
michael kors handbags clearance, http://www.cheapmichaelkors.us.org/
nike outlet, http://www.cheap-nikeshoes.com/
oakley sunglasses cheap, http://www.cheapoakley.us.org/
oakley outlet, http://www.cheapoakleysunglasses.co.com/
oakley sunglasses, http://www.cheap-oakleysunglasses.in.net/
ray bans, http://www.cheaprayban.com.co/
shoes outlet, http://www.cheapshoes.com.co/
ugg boots, http://www.cheapuggboots.eu.com/
flat iron, http://www.chiflatiron.net.co/
christian louboutin shoes, http://www.christian--louboutin.in.net/
louboutin, http://www.christianlouboutin.org.uk/
christian louboutin outlet, http://www.christianlouboutinshoes.jp.net/
burberry, http://burberry.outletnow.net/
christian louboutin shoes, http://christian.louboutin-outlet.net/
tory burch sale, http://toryburch.salesandals.net/
abercrombie kids, http://www.abercrombieand-fitch.com.co/
abercrombie, http://www.abercrombiefitch.us.com/
abercrombie and fitch, http://www.abercrombie-kids.us.com/

__________

Larbiacense (http://cheapvia100mg.com) says:

2017-10-10 16:33:16

Buy Cyprostol Without Prescrition Secure Bentyl Find Internet Quick Shipping Overseas Cephalexin 500mg Excessive Sweating <a href=http://bestviaonline.com>buy viagra online</a> Viagra Cannada Stendra Avana Low Price Drugs Overseas discount on line fedex shipping isotretinoin 10mg medication direct

__________

Larbiacense (http://cheapvia100mg.com) says:

2017-10-10 16:33:18

Buy Cyprostol Without Prescrition Secure Bentyl Find Internet Quick Shipping Overseas Cephalexin 500mg Excessive Sweating <a href=http://bestviaonline.com>buy viagra online</a> Viagra Cannada Stendra Avana Low Price Drugs Overseas discount on line fedex shipping isotretinoin 10mg medication direct

__________

Larbiacense (http://cheapvia100mg.com) says:

2017-10-10 16:33:22

Buy Cyprostol Without Prescrition Secure Bentyl Find Internet Quick Shipping Overseas Cephalexin 500mg Excessive Sweating <a href=http://bestviaonline.com>buy viagra online</a> Viagra Cannada Stendra Avana Low Price Drugs Overseas discount on line fedex shipping isotretinoin 10mg medication direct

__________

Larbiacense (http://cheapvia100mg.com) says:

2017-10-10 16:33:24

Buy Cyprostol Without Prescrition Secure Bentyl Find Internet Quick Shipping Overseas Cephalexin 500mg Excessive Sweating <a href=http://bestviaonline.com>buy viagra online</a> Viagra Cannada Stendra Avana Low Price Drugs Overseas discount on line fedex shipping isotretinoin 10mg medication direct

__________

ylq says:

2017-11-27 23:09:20

http://www.soccershoes-outlet.com/, http://www.mcm-backpacks.com.co/, http://www.raybans-glasses.com.co/, http://www.vans-shoesoutlet.co.uk/, http://www.salvatore-ferragamos.com/, http://www.nike-huarache.co.nl/, http://www.retrojordan-shoes.com/, http://www.christian-louboutinshoesoutlet.com/, http://www.michaelkors.co.nl/, http://www.north-face.com.co/, http://www.marc-jacobs.us.com/, http://www.rosherun-shoes.us/, http://www.ralphlauren-polos.com.co/, http://www.jeans-truereligion.com/, http://www.nikeshoes.de/, http://www.scarpe-hoganshoes.it/, http://www.louboutinshoes.jp.net/, http://www.montblancpences.com/, http://www.air-maxschoenen.co.nl/, http://www.christian-louboutin-shoes.com/, http://www.cheap-jerseys.com.co/, http://giants.nfl-jerseys.org/, http://www.jimmychoo-shoes.com/, http://pelicans.nba-jersey.com/, http://www.rayban-sunglasses.co/, http://www.newbalanceschuhe.com.de/, http://www.outlet-toryburch.com/, http://magic.nba-jersey.com/, http://www.ray-bans.net.co/, http://www.barboursjackets.com/, http://www.longchamps-bags.us.com/, http://www.kate-spadebags.com/, http://www.cheapomega-watches.com/, http://www.michael-korsbags.com.co/, http://www.mbt-outlet.com/, http://pistons.nba-jersey.com/, http://www.outlet-michaelkors.us.org/, http://www.polo-ralphlaurens.us.com/, http://www.oakleysunglasses-canada.ca/, http://www.chiflatironhair.us.com/, http://raiders.nfl-jerseys.org/, http://www.nikeair-max.ca/, http://www.woolrich-jackets.com/, http://www.truereligions.net/, http://www.nike-skos.com/, http://bills.nfl-jerseys.org/, http://www.watches-omega.com/, http://www.raybans-outlet.com.co/, http://www.thenorth-face.com.co/, http://www.nike-shoes.co.nl/, http://www.nike-shoesoutlet.co.uk/, http://www.michaelkors-ins.com/, http://www.jordan-retros.com/, http://www.oakleys-sunglasses.mex.com/, http://www.nba-shoes.com/, http://www.pradas.com.de/, http://www.salvatoreferragamo.us.com/, http://www.raybanoutlet.ca/, http://www.sunglasses-oakleys.com.co/, http://www.crystals-swarovskis.com/, http://www.birkenstocks.com.de/, http://jazz.nba-jersey.com/, http://www.michaels-korsoutlet.com/, http://www.nike-shoes.com.co/, http://www.nike-airmax.com.de/, http://www.nike-airmaxsc.co.uk/, http://www.christian-louboutin.jp.net/, http://www.burberry-storevip.com/, http://www.designer-handbags.com.co/, http://www.ralph-laurens-outlet.com/, http://www.oakleys.org.es/, http://www.skechers-shoesoutlet.com/, http://www.mcm-handbags.org/, http://www.valentino-shoesoutlet.us.com/, http://panthers.nfl-jerseys.org/, http://broncos.nfl-jerseys.org/, http://www.ferragamos.co.uk/, http://www.michael-kors.cc/, http://www.nike-shoesstore.com/, http://www.barbours.us.com/, http://www.basketballshoes.com.co/, http://www.outelt-ralphlauren.co.uk/, http://www.poloralphlauren.com.de/, http://rayban.black-friday.vip/, http://www.babylisspros.com/, http://www.supra-footwears.com/, http://www.converse-schuhe.com.de/, http://www.uhren-stores.de/, http://www.bottega-bags.com/, http://www.adidas-shoes.co.nl/, http://steelers.nfl-jerseys.org/, http://www.okglassesale.com/, http://www.lacosteoutlet.com.co/, http://www.jimmychoos-shoes.com/, http://www.nike-rosherun.com.es/, http://www.michaelkorsoutlet.se/, http://coach.euro-us.net/, http://www.polosoutlet-store.com/, http://www.new-balanceshoes.com/, http://www.outlet-toryburchshoes.com/, http://oakley.black-friday.vip/, http://www.outlet-rayban.co.uk/, http://www.outlet-burberry-bags.com/, http://www.cheap-raybansoutlet.com.co/, http://seahawks.nfl-jerseys.org/, http://nuggets.nba-jersey.com/, http://rockets.nba-jersey.com/, http://www.tommyhilfigers.co.nl/, http://www.raybans-outlet.cc/, http://www.hollister-clothings-store.com/, http://www.burberryoutletonline.com.de/, http://www.tommy-hilfigers.net.co/, http://hawks.nba-jersey.com/, http://www.jordan.com.de/, http://www.new-balanceoutlet.org/, http://www.outlet-michaelkors.com/, http://www.levis-jeansoutlet.com/, http://www.birkenstockshoes.com.de

__________

Larbiacense (http://sildenaf100mg.com) says:

2017-11-29 16:36:41

Levitra Orodispersible Cialis Levitra Ou Viagra Traitements <a href=http://cheapvia50mg.com>viagra</a> Propecia Engorda


Add your comment on this article below:

Sorry, there's an error with your form entries. We really appreciate your comment, so please try again.

Form submitting now...

Name:

Website:

Email address (not displayed):

Enter your comment below: