Issues with detect and redirect using SWFObject

Visto 131 veces
Saltar al primer mensaje no leído

Nick

no leída,
19 mar 2012, 18:28:3819/3/12
a swfo...@googlegroups.com

Hi everyone,

I have recently built a non-flash version of my website that I would like to be able to implement a detect and redirect to. I have tried multiple methods after reading the SWFObject docmentation and still havent been able to get it to work.

The js file for SWFobject resides under pathway js/swfobject.js

I have tried using fo.vars redirctURL, If/else methods, etc.

I used dynamic publishing with the generator and tried to include a redirect in the alternate method to no avail.

All I need is a simple redirect. I.E. if the user has FP 6.0 or higher, they get directed to the flash site. For lower flash versions, or no flash at all they get directed to the non-flash site.

Any help would be greatly appreciated:

Here is the main chunk of code I have been working with, excluding all the other HTML stuff on the site:

<head>
<script>
if (swfobject.hasFlashPlayerVersion("7.0.0")) {
// User has flash

   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <script type="text/javascript" src="js/swfobject.js"></script>
  <script type="text/javascript">
   var flashvars = {};
   var params = {};
   params.quality = "best";
   params.bgcolor = "ebebea";
   var attributes = {};
   attributes.id = "non-flash";
   swfobject.embedSWF("flash/menu_vf8.swf", "Non-flash", "980", "190", "6.0.0", false, flashvars, params, attributes);
  </script>
       
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <script type="text/javascript" src="js/swfobject.js"></script>
  <script type="text/javascript">
   var flashvars = {};
   var params = {};
   params.quality = "best";
   params.bgcolor = "ebebea";
   var attributes = {};
   attributes.id = "non-flash 1";
   swfobject.embedSWF("flash/slideshow_vf8.swf", "Non-flash 1", "980", "486", "6.0.0", false, flashvars, params, attributes);
  </script>

} else {
// User does not have flash
window.location="non-flash/index.html";
}
</script>
 </head>
<body id="page1">
<div id="main">
<!-- header -->
<body>
<div id="Non-flash">
</div>

<div id="Non-flash 1">
</div>
</body>

Sam Sherlock

no leída,
22 mar 2012, 2:38:1522/3/12
a swfo...@googlegroups.com
I have edited you code below

I think the flash page should make use of static objects not dynamic ones and redirect if the version is not greater than
but I have left the code to use dynamic for now.

 - S




On 19 March 2012 22:28, Nick <nwie...@gmail.com> wrote:

Hi everyone,

I have recently built a non-flash version of my website that I would like to be able to implement a detect and redirect to. I have tried multiple methods after reading the SWFObject docmentation and still havent been able to get it to work.

The js file for SWFobject resides under pathway js/swfobject.js

I have tried using fo.vars redirctURL, If/else methods, etc.

I used dynamic publishing with the generator and tried to include a redirect in the alternate method to no avail.

All I need is a simple redirect. I.E. if the user has FP 6.0 or higher, they get directed to the flash site. For lower flash versions, or no flash at all they get directed to the non-flash site.

Any help would be greatly appreciated:

Here is the main chunk of code I have been working with, excluding all the other HTML stuff on the site:

<head>


<!-- you need the lib here to make use of it in first condition -->

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

   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 

<script>


if (swfobject.hasFlashPlayerVersion("7.0.0")) {
// User has flash

   var flashvars = {};
   var params = {};
   var attributes = {};


   params.quality = "best";
   params.bgcolor = "ebebea";

   attributes.id = "non-flash";
   swfobject.embedSWF("flash/menu_vf8.swf", "Non-flash", "980", "190", "6.0.0", false, flashvars, params, attributes);

 // just reset flashvarm param & attrib objects eg flashvars = {} but I removed them this as was just the same as above
// change the id though as it is not the same as first && ids can't have spaces

   attributes.id = "non-flash1";


   swfobject.embedSWF("flash/slideshow_vf8.swf", "Non-flash 1", "980", "486", "6.0.0", false, flashvars, params, attributes);

} else {
// User does not have flash
window.location="non-flash/index.html";
}
</script>
 </head>
<body id="page1">
<div id="main">
<!-- header -->
<body>
<div id="Non-flash">

put a message here for users with no js enabled

</div>

<div id="Non-flash1">


put a message here for users with no js enabled 

</div>
</body>

--
You received this message because you are subscribed to the Google Groups "SWFObject" group.
To view this discussion on the web visit https://groups.google.com/d/msg/swfobject/-/JnETa8_NuV8J.
To post to this group, send email to swfo...@googlegroups.com.
To unsubscribe from this group, send email to swfobject+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/swfobject?hl=en.

Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos