After I re-read your original post, I realized you didn’t even need to know the progress, just the complete event. CheckPlayer does this by issuing the SWF_LOADED event status when the PercentLoaded() function returns 100%. You could emulate that by having a setInterval to inspect your SWF over and over and call that PercentLoaded() until you get the 100. Or you could just let CheckPlayer tell you, which I think is easier (which is why I wrote the library!)
One other note, a common need of SWF authors seems to be knowing not just when the SWF loads, but when it's ExternalInterface callbacks are initialized (which sometimes happens a little after the SWF loads). So, CheckPlayer has a way to detect this as well (by trying to execute a function that you define to test for), and issues the SWF_EI_READY event status when it succeeds. Hope this helps. --Kyle -------------------------------------------------- From: "Adam Fridental" <[EMAIL PROTECTED]> Sent: Saturday, October 25, 2008 5:45 PM To: "SWFObject" <[email protected]> Subject: Re: Need help conserning Onload on SWFObjects > > Sounds great.. excectly what I needed.. I hope it will work ok for > me.. thanks a lot! > > On 25 אוקטובר, 18:29, "Getify Solutions, Inc." <[EMAIL PROTECTED]> > wrote: >> Actually, this *can* be done in javascript. CheckPlayer >> (http://checkplayer.flensed.com/) is a helper library to SWFObject that >> implements an event call back with load progress events, including the >> percentage of load. So, you can actually have a callback function in >> javascript notified when the flash downloading progress is occuring, and >> armed with those notices, you can update your HTML/Javascript load >> progress >> indicator. >> >> The "secret" CheckPlayer uses to do this is the oft-missed >> "PercentLoaded" >> function that you can call against a SWF that is loading. So, using that >> you could roll your own code to do the same thing. But CheckPlayer has >> done >> it for you, so you might want to check that out. :) >> >> --Kyle >> >> -------------------------------------------------- >> From: "Adam Fridental" <[EMAIL PROTECTED]> >> Sent: Saturday, October 25, 2008 4:31 AM >> To: "SWFObject" <[email protected]> >> Subject: Re: Need help conserning Onload on SWFObjects >> >> >> >> >> >> > Thanks a lot for your help. I found a guide and will start checking it >> > out now. >> >> > On 25 אוקטובר, 05:06, "Philip Hutchison" <[EMAIL PROTECTED]> wrote: >> >> javascript can't do it, you can only do that kind of stuff in Flash >> >> Player. >> >> >> if you want to use a visual indicator such as text or a progress bar >> >> to >> >> indicate download progress, you should probably create a 'loader' SWF >> >> that >> >> uses MovieClipLoader to load your MySwfFile.swf. there are tons of >> >> tutorials and advice for that on the web, try someplace like >> >> kirupa.com >> >> >> - philip >> >> >> On Fri, Oct 24, 2008 at 6:27 PM, Adam Fridental >> >> <[EMAIL PROTECTED]>wrote: >> >> >> > I have the following code using SWFObject 2.1 in a simple html page: >> >> >> > <script type="text/javascript"> >> >> > if (swfobject.hasFlashPlayerVersion("8.0.0.0")) >> >> > { >> >> > var att = { id: "myObj", data:"MySwfFile.swf", >> >> > width:"600", height:"300" }; >> >> > var par = { flashVars: "responseurl=Page.aspx?theID=5" }; >> >> > var myObject = swfobject.createSWF(att, par, >> >> > "flashcontent"); >> >> > } >> >> > </script> >> >> >> > now... sometimes it takes more than 30 seconds for the swf to load.. >> >> > and I can't change the file it self.. so I want to add a loading >> >> > text >> >> > with javascript or something similar... I tried doing it for hours.. >> >> > I >> >> > added onload to anything... I tried the addEventListener I tried the >> >> > addLoadEvent and the addDomLoadEvent... I tried everything I found >> >> > possible on the net and everything I had in mind..... but nothing >> >> > seemed to catch the end of the SWF file loading.. nothing fired when >> >> > the file loaded completely... >> >> >> > I really hope there's a solution to this problem and I'll appriciate >> >> > any help. >> >> >> > Thanks in advace, >> >> > Adam Fridental.-הסתר טקסט מצוטט- >> >> >> -הראה טקסט מצוטט--הסתר טקסט מצוטט- >> >> -הראה טקסט מצוטט- > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
