Skip to main content
Participating Frequently
September 25, 2009
Question

Problems with Flash loading

  • September 25, 2009
  • 1 reply
  • 1072 views

I have embedded a flash file in my ColdFusion page. I have had trouble with the file loading slow. It will just show a broken image indicator in the browser, and then it will eventually show up. I have tried to solve this problem with a preloader. Problem is, the pre loader doesn't play right away either. It just shows the broken image indicator, just like before, then the preloader comes up for a very short time and then the movie loads. Any ideas?

Flash preloader:

var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest("ATOITOrg6.swf"));
                          
function loop(e:ProgressEvent):void
{
     var perc:Number = e.bytesLoaded / e.bytesTotal;
     percent.text = Math.ceil(perc*100).toString();
}

function done(e:Event):void
{
     removeChildAt(0);
     percent = null;
     addChild(l);
}

ColdFusion for embedding Flash:

         <cfoutput>
            <object type="application/x-shockwave-flash" data="#flash#OrgPreloader.swf" width="520" height="700">
            <param name="movie"
            value="#flash#OrgPreloader.swf" />
            </object>     
         </cfoutput>

This topic has been closed for replies.

1 reply

R0bert!Author
Participating Frequently
September 25, 2009

Code pasting above didn't work well. I'll try again.

ActionScript:

var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest("ATOITOrg6.swf"));
                     
function loop(e:ProgressEvent):void
{
    var perc:Number = e.bytesLoaded / e.bytesTotal;
    percent.text = Math.ceil(perc*100).toString();
}

function done(e:Event):void
{
    removeChildAt(0);
    percent = null;
    addChild(l);
}

CF code for embedding Flash:

        <cfoutput>
            <object type="application/x-shockwave-flash" data="#flash#OrgPreloader.swf" width="520" height="700">
            <param name="movie"
            value="#flash#OrgPreloader.swf" />
            </object>   
        </cfoutput>