"SWFObject is undefined"

4 messages Options
Embed this post
Permalink
Andyram2k

"SWFObject is undefined"

Reply Threaded More More options
Print post
Permalink
Hi all,
        Thanks for taking the time to read my post, really appreciated.

I'm trying to launch shadowbox from within a .swf, but when i click the button to launch shadowbox, i get a "swfobject is undefined" error.

Live example: http://andyram2k.com/virtualtest.html 

Flash button action:

on(release) {
                getURL("javascript:openShadowbox('http://www.andyram2k.com/flash/xmlwebservices.swf', 'swf', 'Test');");
}


Flash FLA file: http://andyram2k.com/virtual.fla

HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>test</title>

<link href="http://www.andyram2k.com/shadowbox/shadowbox.css" rel="stylesheet" type="text/css" />
<SCRIPT src="http://www.andyram2k.com/swfobject.js" type=text/javascript></SCRIPT>
<script type="text/javascript" src="http://www.andyram2k.com/shadowbox/shadowbox.js"></script>
<script type="text/javascript">
function openShadowbox(content, player, title){
    Shadowbox.open({
        content:    content,
        player:     player,
        title:      title
    });
}
</script>

</head>

<body>

<div id=pageImage></div>
<SCRIPT type=text/javascript>
var so = new SWFObject("virtual.swf" , "mymovie", "550", "400", "8", "transparent");
so.addParam("wmode", "transparent");
so.write("pageImage");
</SCRIPT>

</body>
</html>

I'm sure i had this working before with an older version of shadowbox when i was originally experimenting with the script, but i think i may have missed something on this occasion! :)

If anyone has any ideas or fixes, i would really appreciate it. Thanks very much.

 - Andy.
Andyram2k

Re: "SWFObject is undefined"

Reply Threaded More More options
Print post
Permalink
D'oh. Silly mistake - that's what working 12 hours straight does to you.

For anyone who has the same issue, you need the shadowbox.init also :)

<script type="text/javascript">
Shadowbox.init({
language: 'en',
players:  ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv']
});
</script>

Hopefully i've helped at least one person through my clumsiness :)

Cheers guys, please mark as resolved

- Andy.
brankolo

Re: "SWFObject is undefined"

Reply Threaded More More options
Print post
Permalink
Thank you, guy!
it was helpful for me.

;)
antmx

Re: "SWFObject is undefined"

Reply Threaded More More options
Print post
Permalink
Thanks, me too!