Hi Lacroix,

Thank you for replying. I think you should have a closer look at my
code:

<a href="#" onclick="$('works').backgroundImage('dummy string')">works</a>
<a href="#" onclick="$('worksnot').backgroundImage('dummy string')">works 
not</a>


> There's actualy a bug in IE, and to execute your function you should use
> mySwiff.toElement().myFunctionToExecute();

backgroundImage is my "myFunctionToExecute".
toElement() just returns the DOM object which should be the same as
$('works');

> Marc L.
> PS: I never use the "container" argument when use Swiff, and my
> callbacks using this method work fine in IE 6,7,8 It just sometimes
> crashes Safari PC...

  I don't understand why calling onLoad should fix anything.
  I can't see a default onLoad even handler in Swiff.

  For your convinience I've uploaded my test case here:
  http://github.com/MarcWeber/tmp/tree/mootools_ie_bug

  Well using my code even crashed IE6. So I wrote a PHP function now
  generating the code - probably it still has some bugs but it does my job:

  function swfHTML($alternative_content, $id ='', $path, $w, $h, $params = 
array(), $flashVars = array()){

          if (count($flashVars) > 0){
                  foreach ($flashVars as $k => $v) {
                          $fv[] = $k.'='.urlencode($v);
                  }
                  $params['flashVars'] = implode($fv, '&');
          }

          $is_ie = strpos( $_SERVER["HTTP_USER_AGENT"], 'MSIE'  ) !== false;
          $html = '';

          if ($is_ie) {
                  $html .= 
                  '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
 id="'.$id.'"'
                  .'  
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0";'
                  .'  width="'.$w.'" height="'.$h.'">'
                  .'<param name="movie" value="'.$path.'"/>'
                  ;
          } else {
                  $html .= 
                          '<object type="application/x-shockwave-flash" 
id="'.$id.'"'
                          .' data="'.$path.'" width="'.$w.'" height="'.$h.'">';
          }

          foreach ($params as $k => $v){
                  $html .= '<param name="'._htmlentities($k).'" 
value="'._htmlentities($v).'"/>';
          }

          $html .= $alternative_content
                  .'</object>';

          return $html;
  }


Marc Weber

To unsubscribe from this group, send email to 
mootools-users+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to