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]>
> .
> 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.

Reply via email to