swfobject using the param (wmode)

6,267 views
Skip to first unread message

nana

unread,
May 12, 2008, 7:26:37 AM5/12/08
to SWFObject
Hi I use the swfobject1.5 with this scripts (from
http://www.askapache.com/css/getting-flash-to-show-up-in-front-of-content.html
to achive the wmode transparent things.)

<script type="text/javascript">
var so = new SWFObject("intro.swf", "flashcontent", "700", "220", "7",
"#ffffff"); so.addParam("wmode", "transparent");
so.write("flashcontent");
</script>

but right now the swfobject is 2.0
the javascripts should look like how?

currently my code is like this:

<script type="text/javascript">

var params = {};

swfobject.embedSWF("banner.swf", "myContent", "700", "220",
"8.0.0","expressInstall.swf", params);

</script>

I have no idea how to code javascripts, any help would really
appreciate!!! thanks a lot!!!!

gossamermedia

unread,
May 12, 2008, 4:33:57 PM5/12/08
to SWFObject
I think, from the documentation, you would write the params the same
way you did in 1.5.

<script type="text/javascript">

var params = {};
params.wmode = "transparent";

swfobject.embedSWF("banner.swf", "myContent", "700", "220", "8.0.0",
"expressInstall.swf", params);
</script>

-g

nana

unread,
May 13, 2008, 5:19:55 AM5/13/08
to SWFObject
Hi Thanks for your reply.
I tried it..but it doest work.. any ideas?

Bobby

unread,
May 13, 2008, 8:52:08 AM5/13/08
to SWFObject
The example by gossamermedia should work. Any way, please study the
example from the test suite:
http://www.swffix.org/swfobject/testsuite/test_dynamic_params.html

gossamermedia

unread,
May 13, 2008, 12:22:45 PM5/13/08
to SWFObject
can you show your script?

-g

Bobby

unread,
May 13, 2008, 4:01:49 PM5/13/08
to SWFObject
Just do a "view source":
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>SWFObject v2.0 - dynamic embed params</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var flashvars = {
name1: "hello",
name2: "world",
name3: "foobar"
};
var params = {
menu: "false",
wmode: "transparent"
};
var attributes = {
id: "myId",
name: "myId"
};
swfobject.embedSWF("test6_flashvars.swf", "myContent", "300", "120",
"9.0.0", "expressInstall.swf", flashvars, params, attributes);
</script>
</head>

<body style="background-color:#ccc;">
<div id="myContent">
<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>
</body>
</html>

nana

unread,
May 20, 2008, 5:16:46 AM5/20/08
to SWFObject
Hi all,

Thanks for the reply and sorry for my late reply.

Hmm..actually, my code looks the same code you post. Mayb I missed out
something ?

I paste here, maybe you guys can spot it out easily..

My code looks like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Omnitouch</title>
<link rel="stylesheet" href="css/import.css" type="text/css"
media="screen,print" />
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
var params = {wmode: "opaque"};
swfobject.embedSWF("images/swf/te.swf", "header", "960", "287",
"8.0.0", params);
</script>
</head>

<body id="top">

<div id="container">
<div id="header">
<ul>
<li class=" contact"><a href="#4">Contact Us</a></
li>
<li class="terms"><a href="#3">Terms &amp;
Conditions</a></li>
<li class="policy"><a href="#2">Privacy Policy</
a></li>
<li class="lastChild sitemap"><a
href="#1">Sitemap</a></li>
</ul>
<img src="images/common/flashmock.jpg" width="960"
height="287" alt="" />
</div>
...
...
</div>

</body>
</html>

Once again, thank you!





jsopra

unread,
May 20, 2008, 9:10:31 AM5/20/08
to SWFObject
this is my question too...

I´m use:

- var params = {wmode: "opaque"};
- swfobject.embedSWF("imagens/fla/BANNER.swf", "banner", "760",
"140", "8", {wmode:"transparent"});

...and nothing.

gossamermedia

unread,
May 20, 2008, 11:07:49 AM5/20/08
to SWFObject
jspora,

a couple of things jump out. you have hyphens before your param
variable. those don't need to be there. also, you are calling wmode
opaque, then calling wmode transparent. and actually where you are
calling wmode transparent you need to be calling the param variable.
you should look at nana's or bobby's examples above and follow that.

g

gossamermedia

unread,
May 20, 2008, 11:08:05 AM5/20/08
to SWFObject
nana,

I used your code and ran a test. Everything is working fine. I suspect
you may have a directory problem. A couple of things...

1. Make sure your directory structure is correct. Currently you should
have(assuming your page is named index.html)
/index.html
/js/swfobjects.js
/images/swf/te.swf

2. Make sure you are using swfobject.js v.2

3. Your Flash player is version 8 or greater.

4. This may not apply to you, but recently I couldn't get a script of
mine to work. Everything was correct except for something I couldn't
see. The line-endings were unicode instead of mac/unix or windows. I
forgot I was editing unicode scripts the night before and I left my
editor in that mode.

jsopra

unread,
May 20, 2008, 1:03:21 PM5/20/08
to SWFObject
please look the code:
...
<script type="text/javascript">
swfobject.embedSWF("imagens/fla/BANNER.swf", "banner", "760", "140",
"8", {wmode:"transparent"});
</script>
</head>
<body>
....
<div id="banner" class="flash"> if not run flash, download here! </
div>
<div id="programacao" class="prog"><b>ON THE AIR: xxx </div>
---

#programacao should be on top of #banner, but as the swf is not
transparent, the div #programacao don´t appears.
The z-index of containers is right, when they shot the swf of the
code, appears the div #programacao on top of div #banner correctly.
What the problem? In this case i should use the first version of
swfobject?

thanks

PS:
- sorry nana for use you topic. If you request i´m delete my posts
and create a new topic.
- sorry the bad english! hehe

Aran Rhee

unread,
May 20, 2008, 7:21:51 PM5/20/08
to swfo...@googlegroups.com
You are passing the params object as the wrong argument to the embedSWF()
function. Have a look at the docs - It specifies:

<script type="text/javascript">
var flashvars = {};
var params = {};
var attributes = {};
swfobject.embedSWF("myContent.swf", "myContent", "300", "120",


"9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>

As you can see, the flashvars object goes first, THEN the params object.


Aran

Message has been deleted

jsopra

unread,
May 21, 2008, 2:02:08 PM5/21/08
to SWFObject
and if i do not want to spend the expressinstall?

grateful for any help!

Getify Solutions, Inc.

unread,
May 21, 2008, 2:17:09 PM5/21/08
to swfo...@googlegroups.com
pass false as the value for that particular parameter, and
expressinstall will silently be disabled. :)

--Kyle

--------------------------------------------------
From: "jsopra" <jso...@gmail.com>
Sent: Wednesday, May 21, 2008 1:02 PM
To: "SWFObject" <swfo...@googlegroups.com>

nana

unread,
May 25, 2008, 10:51:48 PM5/25/08
to SWFObject
Hi all, thanks for the help. (Sorry for my late reply)
Feel free to post anything in this thread :)

Hmm.. Ya.. I had make sure the path and everything is okay.. (at least
i dun see error at the bottom right corner, I have a green arrow mark)

Is that okay I post a link here to see the problems?


Once again, thank you!

Aran Rhee

unread,
May 25, 2008, 10:55:26 PM5/25/08
to swfo...@googlegroups.com
If you are still having problems after reading the solution and have a test
page, then go ahead and post the link.

Aran

-----Original Message-----
From: swfo...@googlegroups.com [mailto:swfo...@googlegroups.com] On
Behalf Of nana
Sent: Monday, 26 May 2008 12:52 PM
To: SWFObject
Subject: Re: swfobject using the param (wmode)

nana

unread,
May 27, 2008, 10:36:41 PM5/27/08
to SWFObject
Thank you.

Here's the link, this one I use the version 1.5:
http://www.nana4design.com/notionage/omni/index.html

this one I use 2.0
http://www.nana4design.com/notionage/omni/about.html

pls see both link to see the differences.
version 2.0 when the navi tab is selected, the round corner on top of
the flash navi is chop off,
but the version 1.5 the navi tab round corner is shown on top of the
flash banner.

once again, thank you very much.

nana

unread,
Jun 16, 2008, 1:41:46 AM6/16/08
to SWFObject
Hi! I 've got it done!!!

The reason it doest work is bcos I dun put the param sequence
correctly!

Thank you very much!!! ^^v

Aran Rhee

unread,
Jun 16, 2008, 2:20:12 AM6/16/08
to swfo...@googlegroups.com
Um...Yes. That is what I said to you ~1 month ago! (if you check the thread
- this is what I wrote on May 21)

I'm glad you got it working anyhow.

Aran

-----Original Message-----
From: swfo...@googlegroups.com [mailto:swfo...@googlegroups.com] On
Behalf Of nana
Sent: Monday, 16 June 2008 3:42 PM
To: SWFObject
Subject: Re: swfobject using the param (wmode)

nana

unread,
Jun 23, 2008, 5:19:34 AM6/23/08
to SWFObject
Thank you very much!
> Thank you very much!!! ^^v- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages