How are you going to call a method on something which doesn't exist yet? Is the trackCounter.setCount() method specific to the flash file, or is it related to just normal html stuff on the page and can be called anywhere?
If you need to call some tracking code that is specific to the flash file, then call the js function from within flash when it is embedded on the page with ExternalInterface or a direct getURL / loadVars call. Aran -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of j0llyr0g3r Sent: Thursday, 23 April 2009 5:24 AM To: SWFObject Subject: How can i call a JS-method _before_ swfobject.write()? Hey guys, i initialize one of my flash-elements like this: var trackCounter = new SWFObject (PATH_TO_TRACK_COUNTER,...................); trackCounter.addParam("allowfullscreen","false"); trackCounter.addParam("allowscriptaccess","always"); trackCounter.addParam("wmode", "opaque"); trackCounter.write("track_count_flash"); Now, this flash-element responds to a JavaScript-function called "setCount()", which is defined within the flash-element (sorry for being not so precise, but i don't know anything about flash). Normally, i call this method like this (_after_ the initialisation above): var trackCounter = document.getElementById ("track_counter_flash_element"); trackCounter.setCount(trackListCount, ........); This is working so far. My question: Is it possible to call the "setCount()"-Funktion before i "write" the flash-element via swfobject? I mean something like this in my initalization: var trackCounter = new SWFObject (PATH_TO_TRACK_COUNTER,...................); trackCounter.addParam("allowfullscreen","false"); trackCounter.addParam("allowscriptaccess","always"); trackCounter.addParam("wmode", "opaque"); /* call setCount() here.......*/ /* but how */ trackCounter.write("track_count_flash"); How could i do this? Thanks for every suggestion! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
