The object/embed code we have all been used to using for embedding flash does not work with the new IE properly. The user is prompted to "click to activate and use this control" first, before being able to use the object. More info about this can be found here: http://en.wikipedia.org/wiki/Macromedia_Flash#.22Click_to_activate_and_use_this_control.22

The solution at the Adobe/Macromedia site (http://www.adobe.com/devnet/activecontent/articles/devletter.html) didn't work when embedding ming with php.

Other approaches which involved onload-modifying innerHTML which I found via searching didn't work for me.

The javascript function below, if included with the other javascript functions provided by Adobe at the above page, will enable Ming/flash to be embedded without prompting the user to "click to active and use this control".

There may be better/easier solutions, but happily this one does work, for IE, Firefox, Safari.

Here is the javascript function to add:

function AC_MING_RunContent(){
  var ret =
    AC_GetArgs
    (  arguments, "", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

The only difference between this function, and a similar one provided by Adobe (the "AC_FL_RunContent()" function), is the second argument.

AC_MING_RunContent() uses "" as the second argument, whereas AC_FL_RunContent uses ".swf". The ".swf" was getting appended to the url meant to summon php/ming (...php.swf).

The Adobe documentation does a good job of explaining how to use an external javascript file, and then how to call it.

In their example they call AC_FL_RunContent..., whereas we'll use the AC_MING_RunContent... function like so:

<script type="text/javascript">
AC_MING_RunContent('codebase',
  'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0',
  'width','200','height','200','src','${YOURURL}','quality',
  'high','name','${YOURURL}','allowscriptaccess','sameDomain','pluginspage',
  'http://www.macromedia.com/go/getflashplayer' ,'movie','${YOURURL}' );
</script> 

Hope this is helpful to someone!

libming: ClickToActivate (last edited 2009-06-25 03:09:40 by localhost)