swfobject.addLoadEvent(fn) offers a cross-browser onload, se our API docs: http://code.google.com/p/swfobject/wiki/api
Our solution is based on a solution by James Edwards: http://brothercake.com/site/resources/scripts/onload/ On Jun 12, 8:23 am, Aran Rhee <[email protected]> wrote: > Hi DJ Mib > > There are a number of solutions out there already which do what your > function does: either looping through added functions or overwriting / > adding onload functions. Here is a good link which describes the > methods:http://ekduitin.wordpress.com/2009/05/16/handle-multiple-window-onloa... > > BTW - Why are you using Netscape 4 / IE5? > (we have stopped supporting these browsers in SWFObject now) > > Thanks for your post anyhow - perhaps there are others who need a solution. > > Cheers, > Aran > > On Fri, Jun 12, 2009 at 3:29 PM, DJ Mib <[email protected]> wrote: > > > I had problems using the "Window.onload" in JavaScript, to add more > > than one function, so they could all be executed once the page load. > > Looking at the SWFObject, I noticed that get a solution to these > > problems, which can add various functions to be executed once the page > > is loaded. > > > I found interesting, and more at the same time, find that some older > > browsers (Netscape 4, IE 5 ...), not accept very well this solution. > > > So I thought to create a method that can accept add various functions > > to be executed once the page load. And yet, I thought in a form that > > could place an order for implementation of certain functions. > > > Code for the method that has worked and created in current and older > > browsers: > > > <!-- CODE JAVASCRIPT --> > > > function carOK(){}; > > > carOK.prototype.funcoes = function(){ > > // here, several commands and functions to be executed first > > someFunctions; > > someCommands; > > } > > > var mib=carOK.prototype.funcoes; > > > win.onload = function(){ > > var carr = new carOK(); > > for(var car in carr){ > > if(eval("typeof(carr."+car+")") == "function"){ > > eval("carr."+car+"();"); > > } > > } > > for(var car in carr.funcoes){ > > if(eval("typeof(carr.funcoes."+car+")") == "function"){ > > eval("carr.funcoes."+car+"();"); > > } > > } > > } > > > <!-- CODE JAVASCRIPT --> > > > And when I call I call a function like this: > > > <!-- CODE JAVASCRIPT --> > > > mib.second = second function; > > mib.third = third function; > > mib. fourth = fourth function; > > //and will continue ... > > > <!-- CODE JAVASCRIPT --> > > > Once the page loads, the first functions that are implemented are > > those which are within: > > > <!-- CODE JAVASCRIPT --> > > > carOK.prototype.funcoes = function(){ > > // here, several commands and functions to be executed first > > someFunctions; > > someCommands; > > } > > > <!-- CODE JAVASCRIPT --> > > > Then, go running in order: > > > mib.second ... mib.third ... mib. fourth ... > > > What you think of the idea? > > Ass: DJ Mib > > > Note: Translated by GOOGLE! > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
