Hi Aran, the "setCount"-method is defined within the flash using the ExternalInterface.
The problem is, that the "setCount()"-method also contains some- initalization values, which should override the default values for the flash-element (which are defined in the flash-element). So i need to be able to call the "setCount()"-method _before_ the flash-element is written, preferably after the "addParam()"...lines. If i do this call directly after the "so.write" i have to use a dirty timeout, because otherwise i get the error "method setcount not defined" since the flash-element takes a second to load (+ the user sees the "initial" version of the flash-element for a second) How could i achieve this? You wrote: > 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. But this is too late for me as pointed out above...... On Apr 23, 4:12 am, "Aran Rhee" <[email protected]> wrote: > 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 -~----------~----~----~----~------~----~------~--~---
