You can only call this function when the DOM of a web page has become available, so you can add your code e.g. to a button handler or onload handler like in this example: http://www.bobbyvandersluis.com/swfobject/testsuite_2_1/test_com.html
On May 4, 4:55 pm, Zach <[email protected]> wrote: > I can't figure this one out, since I literally copied & pasted the > code from a working example (http://pipwerks.com/lab/swfobject/ > ExternalInterface/2.0/static.html). I'm using SWFObject 2.1. > > Here's my javascript code (within the <head> tag): > > <script type="text/javascript" src="swfobject.js"></script> > <script type="text/javascript"> > swfobject.registerObject("tab", "9.0.0"); > > function callFlash(num) { > var swf = swfobject.getObjectById("tab"); > swf.asFunc(num); > > } > > callFlash("10"); > </script> > > The page displays properly, but Firebug gives me an error, saying that > "swf is null." Any ideas? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
