i believe it should be all lowercase:
document.getElementById("akmovie").play();also, be sure to invoke document.getElementById *after* the SWF has been embedded (i can't tell by your code example if you're already doing this). a handy way to 'get' the SWF after embedding is using the callback function<http://learnswfobject.com/advanced-topics/the-callback-function/>like so: var myswf = null; var flashvars = {}; var params = { wmode: "opaque", bgcolor: "#37405a" }; var attributes = { id: "akmovie" }; var embedHandler = function (e){ myswf = (e.success) ? e.ref : false; }; swfobject.embedSWF("flash/AskAnn.swf", "askannmovie", "249","226","9.0.0", false, flashvars, params, attributes, embedHandler); however, be aware that Flash Player isn't ready to receive JavaScript commands immediately after a SWF is embedded; it usually takes a few extra milliseconds for Flash Player to be ready. this means if you were to try and use JS on your SWF right away, you might get an error or have nothing happen: var embedHandler = function (e){ myswf = (e.success) ? e.ref : false; myswf.play(); }; the above example will work sometimes and fail sometimes, depending on how quickly Flash Player initializes the JavaScript support. hope that helps. - philip On Thu, May 6, 2010 at 3:33 AM, NauticalMac <[email protected]> wrote: > Hi, > Using v2.2 > Trying to play the movie using a javascript Play() method like: > document.getElementById("akmovie").Play(); > > My embed call is: > swfobject.embedSWF("flash/ > AskAnn.swf","askannmovie","249","226","9.0.0", > "expressinstall.swf",false,{ wmode: "opaque", > bgcolor: "#37405a" }, > { id: "akmovie" }, false); > I verified that the object has the id and is being reached by > getElementById() but the Play() call has no effect. > > Any ideas? > Colin > > -- > You received this message because you are subscribed to the Google Groups > "SWFObject" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<swfobject%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/swfobject?hl=en. > > -- You received this message because you are subscribed to the Google Groups "SWFObject" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/swfobject?hl=en.
