Yeah, nothing to do with swfobject, but something in your swf....
On Fri, Jun 4, 2010 at 2:40 PM, Sam Sherlock <[email protected]> wrote: > I would say that the delay that you describe is due to the video setting up > within the player - not swfobject > > if your using the longtail media player you can use events to help you > > MediaEvent.JWPLAYER_MEDIA_LOADED > PlayerStateEvent.JWPLAYER_PLAYER_STATE > > http://developer.longtailvideo.com/trac/wiki/Player5Events > > - S > > > > > > On 4 June 2010 05:19, gwh <[email protected]> wrote: > >> Thanks so much for the quick reply, >> >> I've just tried the base param as follows: >> >> <script type="text/javascript" src="swf/swfobject.js"></script> >> <script type="text/javascript"> >> var flashvars = {}; >> var params = {base: "swf/"}; >> var attributes = {}; >> swfobject.embedSWF("swf/preloader.swf", >> "flash_replace", "430", >> "218", "9.0.0", false, flashvars, params, attributes); >> </script> >> >> This has corrected the problem to some degree. The preloader.swf file >> has the preloader and also an image on the first frame. The preloader >> is now counting up correctly but when it reaches 100%, the image >> that's on frame one still remains for about 4 or 5 seconds before the >> video appears. I thought that the preloader was supposed to end at the >> point at which the video appears. >> >> I'm not sure whether this is a swfObject related issue or something to >> do with the code in either of the swf files. >> >> Can you comment further? >> >> >> On Jun 4, 2:12 pm, Aran Rhee <[email protected]> wrote: >> > It will be to do with the way you are pathing/loading your video.swf as >> a >> > relative path. >> > >> > Your preloader is loaded as "swf/preloader.swf", so I imagine that the >> > video.swf is not being loaded from the dir you expect. >> > >> > you can set the root folder for relative paths by setting the "base" >> param. >> > >> > more here:http://kb2.adobe.com/cps/127/tn_12701.html >> > >> > either that, or you can set an absolute path (you can guarantee exactly >> > where the file is coming from) >> > >> > Cheers, >> > Aran >> > >> > <http://kb2.adobe.com/cps/127/tn_12701.html> >> > >> > >> > >> > On Fri, Jun 4, 2010 at 1:54 PM, gwh <[email protected]> wrote: >> > > Hi everyone, >> > >> > > I have a separate swf file that contains a preloader which then loads >> > > another swf file containing the main movie. The code I'm using in the >> > > preloader file is as follows: >> > >> > > var loader_mc:MovieClip = new Preloader(); >> > > var loader:Loader = new Loader(); >> > > function handleResize(e:Event) >> > > { >> > > loader_mc.x=stage.stageWidth/2; >> > > loader_mc.y=stage.stageHeight/2; >> > > } >> > > handleResize(null); >> > >> > > >> loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,onProgress >> ); >> > >> > > loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete); >> > >> > > loader.load(new URLRequest("video.swf")); >> > >> > > addChild(loader_mc); >> > > function onProgress(e:ProgressEvent) >> > > { >> > > loader_mc.nr_txt.text=int(e.currentTarget.bytesLoaded/ >> > > e.currentTarget.bytesTotal*100); >> > > } >> > > function onComplete(e:Event) >> > > { >> > > removeChild(loader_mc); >> > > addChild(loader); >> > > } >> > >> > > In the video.swf file I'm using a flvplayback component to attach the >> > > video. >> > >> > > If I let flash create the code for the html page, the above two files >> > > work as expected. However I'm not using the flash-generated html code >> > > but instead I'm using swfObject as follows: >> > >> > > <script type="text/javascript" src="swf/swfobject.js"></script> >> > > <script type="text/javascript"> >> > > var flashvars = {}; >> > > var params = {}; >> > > var attributes = {}; >> > > swfobject.embedSWF("swf/preloader.swf", >> > > "flash_replace", "430", >> > > "218", "9.0.0", false, flashvars, params, attributes); >> > > </script> >> > >> > > and >> > >> > > <div id="flash_outer"> >> > > <div id="flash_replace"> >> > > <a href="consumer/sale.php"><img src="../images/ >> > > index_swf_replace.jpg" width="430" height="218" alt="Sale now on" /></ >> > > a> >> > > </div> >> > > </div> >> > >> > > If I use the above swfObject code, it loads the preloader.swf file but >> > > the preloader gets stuck on zero. The animation functions correctly >> > > but the download of the video.swf file doesn't happen - it just stays >> > > at 0. >> > >> > > The problem seems to be linked to the swfObject code as I mentioned it >> > > doesn't happen when the html code is generated by flash. >> > >> > > I wondered if someone could point out why this might be happening and >> > > suggest a workaround. >> > >> > > Would really appreciate any help. >> > >> > > -- >> > > 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]<swfobject%[email protected]> >> <swfobject%2bunsubscr...@googlegroups .com> >> > > . >> > > For more options, visit this group at >> > >http://groups.google.com/group/swfobject?hl=en. >> >> -- >> 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]<swfobject%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/swfobject?hl=en. >> >> > -- > 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]<swfobject%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/swfobject?hl=en. > -- 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.
