swfobject and flash firestarter

User 440260 Photo


Registered User
26 posts

I have tried to implement swfobject with flash firestarter but have had no luck.

The original trial without swfobject works okay. The code is...
<div style="background-color: #000; width: 450px; margin-left: 300px; position: absolute; top: 80px;">
<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'
codebase='http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0'
ID=RissonsText2 WIDTH=450 HEIGHT=40>
<PARAM NAME=movie VALUE='RissonsText2.swf'>
<PARAM NAME=quality VALUE=high>
<PARAM NAME=wmode VALUE=transparent>
<PARAM NAME=loop VALUE=false>
<EMBED src='RissonsText2.swf' loop=false quality=high wmode=transparent
WIDTH=450 HEIGHT=40 TYPE='application/x-shockwave-flash'
PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>
</EMBED>
</OBJECT>
</div>

I replaced this with the following code to try and get swfobject to work but it just displays the alternative text. Can any one tell me where I am going wrong.
(I have uploaded the swfobject.js file and included a link to it in the head of the page.

<div id="flashcontent">
Alternative text
</div>

<script type="text/javascript">
var so = new SWFObject("RissonsText2.swf", "RissonsText2.fire", "450", "40", "4,0,0,0", "#f00");
so.addParam("quality", "high");
so.addParam("wmode", "transparent");
so.addParam("loop", "false");
so.write("flashcontent");
</script>

Any help or pointers would be greatly appreciated. I know I will have missed something really simple.

Thanks
User 37670 Photo


Registered User
2,138 posts

Hi.
Can you give us a link to the web page with the flash on it please? Maybe have both the regular flash and the swf flash code on the same page so we can see what's going on?
E-Learning Specialist
www.mainsites.ca is my website, and yes, some of it is crappy.
User 37670 Photo


Registered User
2,138 posts

When looking again at your code, in the second example you have this:
var so = new SWFObject("RissonsText2.swf", "RissonsText2.fire", "450", "40",
You don't need to name the .fire file. It is only used by Firestarter, so your code should look more like this:
var so = new SWFObject("RissonsText2.swf", "RissonsText2", "450", "40",
as your file is called "RissonsText2" as a name, without the .fire
See if that helps

You can view more info here: http://www.coffeecup.com/forums/softwar … #post43489 but remember that information is old, so check out the swfobject.js or flashobject.js information on the website to see what might be new. (if no link posted, just google it)

One last question.....Since I.E. no longer needs a workaround or fix for the activeX issue, why not just use the regular flash code?
E-Learning Specialist
www.mainsites.ca is my website, and yes, some of it is crappy.
User 440260 Photo


Registered User
26 posts

Hi,
Thanks Cliff for your reply. I had added the RissontText2.fire just in case it would make a difference. As you can probably tell, I am out of my depth here. I had used flash firestarter to add some text on this page...

http://www.rissons.co.uk/index.php

I then decided to try swfobject to get around the problems of users who didn't have flash and the IE activex problem.
As I couldn't get the swfobject to work on the index page, I uploaded the test pages to..
http://www.rissons.co.uk/trialFlash.html (the page that worked)
and
http://www.rissons.co.uk/trialSwf.html (the page that didn't)

Helen
User 37670 Photo


Registered User
2,138 posts

The IE activeX issue is a thing of the past (well, if we all upgraded our browsers anyway). As for not having flash installed, there is code in the regular flash code that will prompt the user to download or upgrade their flash program AND the swfobject.js file still uses the .swf flash file, so the user NEEDS flash installed either way.
Bottom line is that you can use swfobject if you want, but you shouldn't have to anymore.
I will still have a look at your links to see if I can find any issue with the code to help you.
E-Learning Specialist
www.mainsites.ca is my website, and yes, some of it is crappy.
User 37670 Photo


Registered User
2,138 posts

OK, found the problem. Not sure why this is in your code, but once you remove it all will work fine.

var so = new SWFObject("RissonsText2.swf", "RissonsText2", "450", "40", "4,0,0,0", "#f00");

That last part of this line of code "#f00" needs to be removed. Don't forget to also remove the last comma after "4.0.0.0",

The finished line of code should look like this:
var so = new SWFObject("RissonsText2.swf", "RissonsText2", "450", "40", "4,0,0,0");

Use that and I bet it will all work out fine.
E-Learning Specialist
www.mainsites.ca is my website, and yes, some of it is crappy.
User 463058 Photo


Ambassador
1,086 posts

As far as alternate content goes, if you aren't using the swfobject script which replaces the content of the specified div with the flash, this is another method.

The alternate content appears after the final param tag and before the closing object tag, so the browser will show it if the flash plugin isn't installed.

<div style="background-color: #000; color:#FFFFFF; width: 450px; left: 300px; position: absolute; top: 80px;">
<object type="application/x-shockwave-flash" data="RissonsText2.swf" id="RissonsText2" width="450" height="40">
<param name="movie" value="RissonsText2.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name="loop" value="false" />
<p style="text-align:center; margin:0; padding:0; font:25px/40px 'Times New Roman', Times, serif;">...traditional food with a modern twist</p>
</object>
</div>
User 440260 Photo


Registered User
26 posts

Thanks Cliff and Cary.
I removed the '#f00' but it still didn't work.

I tried the above code and Bingo - I managed to get the alternative content displaying when I disabled Flash.

This seems a lot easier than swfobject :)

Thanks all for your help.
User 463058 Photo


Ambassador
1,086 posts

Hi Helen,

I checked your current page, and the text is almost completely hidden when the flash plugin is absent. This is because of the default margins and padding.

Try this for the alternate content. It will also make the text italic, so it looks more like the flash text.

<p style="width: 450px; margin: 0 0 0 50px; padding:0; font:italic 25px/40px 'Times New Roman', Times, serif;">...traditional food with a modern twist</p>
User 447551 Photo


Ambassador
139 posts

Very nicely done website

Not entirely sure of the grammer over there but shouldn't your main page read

sTeeped in History and not
seeped in History

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.