[SWFObject] FlashObject Undefined
Brian Lee
brian.lee at kaboose.com
Tue Oct 3 16:17:40 PDT 2006
I've updated to version 1.4.4 and converted all of my flash code to the
following format
Swfobject.js include line in the header (between the <head></head> tags)...
<script language="javascript"
src="http://fundev.kaboose.com/swfobject.js"></script>
Code examples on a typical page...
<div id="navBar"></div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("http://fundev.kaboose.com/topnav.swf", "topNav",
"995", "136", "6", "#DAEAAA");
so.addVariable("xmldata", "http://fundev.kaboose.com/navXML.xml");
so.addVariable("currentSelection", "3");
so.setAttribute('xiRedirectUrl',
'http://fundev.kaboose.com/fun-blaster/halloween/index.html');
so.addParam("wmode", "opaque");
so.write("navBar");
// ]]>
</script>
<div id="subNavFlash"></div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("http://fundev.kaboose.com/subnav.swf", "subNav",
"810", "108", "6", "#B4D453");
so.addVariable("subNavXML",
"http://fundev.kaboose.com/funBlasterSubNav.xml");
so.addVariable("currentSelection", "3");
so.setAttribute('xiRedirectUrl',
'http://fundev.kaboose.com/fun-blaster/halloween/index.html');
so.addParam("wmode", "opaque");
so.write("subNavFlash");
// ]]>
</script>
<div id="sideBarFlash"></div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("http://fundev.kaboose.com/sidebarNav.swf",
"sideBarFlash", "162", "297", "6", "#DAEAAA");
so.addVariable("sideBarXML", "http://fundev.kaboose.com/210.xml");
so.setAttribute('xiRedirectUrl',
'http://fundev.kaboose.com/fun-blaster/halloween/index.html');
so.addParam("wmode", "opaque");
so.write("sideBarFlash");
// ]]>
</script>
<div id="featureFlash">
<div class="featureBG" id="featureBG"></div>
</div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("http://fundev.kaboose.com/halloween_AC.swf",
"FeatureFlash", "480", "235", "6", "#B4D453");
//Default attributes list
//Custom attributes list
so.addVariable("printables_link4",
"http://fundev.kaboose.com/fun-blaster/halloween/printables/halloween-colori
ng-pages.html");
so.addVariable("printables_link3",
"/fun-blaster/halloween/printables/halloween-printables.html?page=2");
so.addVariable("printables_link2",
"/fun-blaster/halloween/printables/halloween-printables.html?page=1");
so.addVariable("printables_link1",
"/fun-blaster/halloween/printables/halloween-printables.html?page=1");
so.addVariable("link7",
"http://fundev.kaboose.com/fun-blaster/halloween/games/game_monster_numbers.
html");
so.addVariable("link6",
"http://fundev.kaboose.com/fun-blaster/halloween/games/game_spooky_differenc
es.html");
so.addVariable("link5",
"http://fundev.kaboose.com/fun-blaster/halloween/games/game_ghostly_differen
ces.html");
so.addVariable("link4",
"http://fundev.kaboose.com/fun-blaster/halloween/games/game_frankenbrain.htm
l");
so.addVariable("link3",
"http://fundev.kaboose.com/fun-blaster/halloween/games/game_transylmania.htm
l");
so.addVariable("link2",
"http://fundev.kaboose.com/fun-blaster/halloween/games/game_streamer_screame
r.html");
so.addVariable("link1",
"http://fundev.kaboose.com/fun-blaster/halloween/games/game_whack_o_wheen.ht
ml");
so.addVariable("more_link4",
"http://fundev.kaboose.com/fun-blaster/halloween/science/halloween-slime.htm
l");
so.addVariable("more_link3",
"http://fundev.kaboose.com/fun-blaster/halloween/recipes/edible-eyeballs.htm
l");
so.addVariable("more_link2",
"http://fundev.kaboose.com/fun-blaster/halloween/recipes/sticky-spiders.html
");
so.addVariable("more_link1",
"http://fundev.kaboose.com/fun-blaster/halloween/recipes/ghostly-pears.html"
);
so.addVariable("arcadeHome",
"http://fundev.kaboose.com/fun-blaster/games/index.html");
so.addVariable("costumes_link3",
"http://fundev.kaboose.com/fun-blaster/halloween/crafts/halloween-wizard-wan
d.html");
so.addVariable("costumes_link2",
"http://fundev.kaboose.com/fun-blaster/halloween/crafts/halloween-vampire-bl
ood.html");
so.addVariable("costumes_link1",
"http://fundev.kaboose.com/fun-blaster/halloween/crafts/halloween-witch-hat.
html");
so.addVariable("pumpkin_link6",
"/fun-blaster/halloween/printables/halloween-pumkin-art.html?page=3");
so.addVariable("pumpkin_link5",
"/fun-blaster/halloween/printables/halloween-pumkin-art.html?page=3");
so.addVariable("pumpkin_link4",
"/fun-blaster/halloween/printables/halloween-pumkin-art.html?page=2");
so.addVariable("pumpkin_link3",
"/fun-blaster/halloween/printables/halloween-pumkin-art.html?page=2");
so.addVariable("pumpkin_link2",
"/fun-blaster/halloween/printables/halloween-pumkin-art.html");
so.addVariable("pumpkin_link1",
"/fun-blaster/halloween/printables/halloween-pumkin-art.html");
so.addParam("wmode", "opaque");
so.write("featureBG");
// ]]>
</script>
</div>
On 10/3/06 7:08 PM, "Geoff Stearns" <geoff at deconcept.com> wrote:
> first, update to the latest version - older versions have small bugs
> that may come back to haunt you.
>
> second, if you are seeing that error, it usually means that you are
> trying to execute js before the script is loaded... so make sure you
> are linking the script in the head of the document, so it will be
> loaded 100% before you call the functions associated with it.
>
>
> On Oct 3, 2006, at 3:28 PM, Brian Lee wrote:
>
>> Hello,
>>
>> I've been struggling with this problem for a while now and can't
>> seem to
>> figure out whats wrong I'm using the swfobject but on random
>> ocassions I'll
>> get this error "Line [number]... Error FlashObject is undfined"
>> I'll be
>> asked to debug if I click no the same error on a different line
>> will come
>> up... Has anyone else experience this problem? The page has a lot
>> of flash
>> object on it at minimum 3-5.
>>
>> The FlashObject is referenced externally here is a sample of from
>> my page
>> this line is in between the <head></head> tags
>>
>> <script language="javascript"
>> src="http://fundev.kaboose.com/FlashObject.js"></script>
>>
>> Sample call...
>>
>>
>> <div id="subNavFlash"></div>
>>
>> <script type="text/javascript">
>> // <![CDATA[
>> var so = new FlashObject("http://fundev.kaboose.com/subnav.swf",
>> "subNav", "810", "108", "6", "#B4D453");
>> so.addVariable("subNavXML",
>> "http://fundev.kaboose.com/funBlasterSubNav.xml");
>> so.addVariable("currentSelection", "3");
>> so.setAttribute('xiRedirectUrl',
>> 'http://fundev.kaboose.com/fun-blaster/halloween/index.html');
>> so.addParam("wmode", "opaque");
>> so.write("subNavFlash");
>> // ]]>
>> </script>
>>
>> Regards,
>>
>> Brian
>>
>> _______________________________________________
>> SWFObject mailing list
>> SWFObject at lists.deconcept.com
>> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
More information about the Swfobject
mailing list