Preloader not working !!!

Hi All,
I used 2 preloaders code, but both are not working !!!, what problem with this code ?
script 1
stop();
this.addEventListener(Event.ENTER_FRAME, loading);
function loading(e:Event):void
          var total:Number = this.stage.loaderInfo.bytesTotal;
          var loaded:Number = this.stage.loaderInfo.bytesLoaded;
          loader.kolam.loadTxt.text = Math.floor((loaded/total)*100);
          if (total == loaded)
                    this.removeEventListener(Event.ENTER_FRAME, loading);
                    loader.nextFrame()
script 2
var preLoaderPercent:Number;
this.loaderInfo.addEventListener(Event.COMPLETE, loadComplete);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
function loadComplete(e:Event)
          this.loaderInfo.removeEventListener(Event.COMPLETE, loadComplete);
          this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadProgress);
     loader.nextFrame();
function loadProgress(e:ProgressEvent):void
          preLoaderPercent = e.bytesLoaded / e.bytesTotal;    
     loader.kolam.loadTxt.text = preLoaderPercent;

You could say as3 is fixed for expected behavior. Why should an ENTER_FRAME event fire off before the document is even loaded?
A preloader is always a good idea. Give it a try. Being there's no more as2 nonsense about using _root to gain access to movieclips and code, a preloader won't screw up your code anymore by being what we used to think of as "_root".
Try building the stub as I mentioned and use the Loader class to load that SWF. Here's a tutorial.
e.g.
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
// init a new loader
var preload:Loader = new Loader();
// listen for loading complete
preload.contentLoaderInfo.addEventListener(Event.COMPLETE, preloadCompleteHandler);
// listen for errors
preload.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, preloadErrorHandler);
// listen for progress!
preload.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, preloadProgressHandler);
// load my content
preload.load(new URLRequest("myContent.swf"));
// handlers
// handle complete
function preloadCompleteHandler(e:Event):void
     // load complete! add to display list, remove preloader visuals, etc
     addChild(preload); // a loader is a display object, you can add it directly
// handle error
function preloadErrorHandler(e:IOErrorEvent):void
     // do what you wish if there is an error loading the SWF
     trace(e);
// progress handler
function preloadProgressHandler(e:ProgressEvent):void
     // display the progress in some way
     var bytesLoaded:int = e.bytesLoaded;  // current bytes loaded
     var bytesTotal:int = e.bytesTotal;         // total bytes to load
     // now do what you want, like ver a percent loaded
     var percent:Number = bytesLoaded / bytesTotal * 100;
     trace(percent + " loaded");

Similar Messages

  • Preloader not working in Internet Explorer

    Hi there friends
    I'm pulling my hair out! I cannot get the preloader to work in IE. It works fine in firefox.
    Here's the details
    Preloader is set to 5% and is the default
    Project is 66 slides in length, but I've had this problem with projects much smaller.
    The resolution is 1014x713, big I know, but is an average 16. k/s according to the stats
    Project has audio. All that audio is at least 0.1 second away from the start of the slide.
    Internet Explorer insists on downloading the whole file before playing
    I've seen this issue reported on the forums, but apart from the shifting of audio, I don't know of any fix.
    Please Obi wan you're my only hope...

    Hi there
    Your mention of "Surely someone in support must have heard about this?" seems to infer that you feel these forums are staffed by Adobe support personnel?
    Sorry, but that's not the case. It's user-to-user support. Once in a while we see one of the Captivate developers pop in, but you cannot and should not count on it.
    See if the link posted below helps any.
    Click here to view
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Preloader not working when image scroller present

    Hi:
    I designed a .fla that involves a large panoramic image that
    I stitched together in PhotoShop, then imported into the library
    and made into a movie clip, I then have the movie clip of the
    panoramic load into an image scroller (the one in the components
    library) on the main timeline so you get the sense you are panning
    through the photo. Within the movie clip of the panoramic there are
    buttons in it that then call other movie clips to load another
    movie clip on top of the image scroller.
    code attached to the buttons is:
    on(release){
    _root.attachMovie("myMovie", "screen",1);
    _root.screen._x =10;
    _root.screen._y =425;
    My issue is the file is so large that I have made created a
    preloader.
    If I load the movie clip of the panoramic directly onto the
    timeline the preloader works fine...
    When I try to load the imagescroller that calls the movie
    clip my preloader does not work at all...
    Does anyone have any ideas?
    I will gladly supply you with any code you may need.
    Thank you
    Janalese

    Thank you for your information. It worked great as far as...I
    could build a preloader and have the movie show up on the screen as
    I wanted. Now for problem number two that has developed...
    The MovieClipLoader that calls external .swf file. This is a
    movie that has an image scroll bar that calls a movie clip that
    scrolls a panoramic photo. Within that movie clip of the panoramic
    I have buttons that then call other movie clips from the library
    using
    on(release){
    _root.attachMovie("myModelScroll", "screen",1);
    _root.screen._x =10;
    _root.screen._y =425;
    This is an example of what I am doing
    I have a panoramic shot that is in an image scroller, that
    panoramic is of a group of buildings each building has a button
    next to it. Those buttons then call up another movie clip from the
    library using the attachMovie clip to show another mini movie clip
    of what the building looks like inside, and what the purpose is.
    Issue:
    The buttons within the movie clip that is loaded into the
    image scroller fail to work. If I just load the .swf files into the
    browser it works just fine...
    but the issue is I have a huge file with an image scroller so
    I need a progress bar and a MovieClipLoader function.
    How do I now get the other code attached to the buttons
    within the movie clip that says attachMovieClip to work within the
    context.
    I am so baffelled as to why it won't work...
    Here is the code to my preloader and movieClipLoader
    My actionScript skills are very limited so any help is
    greatly appreciated but needs to be supplied in simple language.
    Thank you very much

  • Flash Preloader Not Working with Local Files?

    Hello all,
    I have created a digital resumé using a Flash
    presentation. The presentation links to several SWF files that are
    rather large. I have designed and implemented preloaders for the
    files.
    My intent is to burn the whole product to CD for
    distribution. The problem I am having is that my Flash preloaders
    work perfectly in FireFox; I click the button in the main
    presentation and the preloader comes up in the target screen,
    followed by the SWF.
    However, the preloaders do not work at all in IE, which
    leaves a black pane with nothing in it and causes the user to click
    the button several times trying to figure out why nothing is
    happening.
    The Flash presentation that is being displayed is embedded in
    a HTML document. The user clicks a button to load a SWF to a
    separate screen; the preloader runs until the file is loaded.
    Any help you could provide is appreciated.

    I have attached the actionscript for the data connection. The
    odd thing about this issue is some of the data is being displayed
    from the webservice call and then some is not. The drop down list
    is not being populated but I am getting some text in a textarea
    that is on the form. My datasource is a SQL Server database and in
    ColdFusion administrator, I used the actual machine name to point
    to the datasource because it is directly linked to my web server.
    This configuration is the one giving me problems. If I change the
    datasource to my test SQL Server (server.somewhere.com) it works
    fine. Does this help any?

  • Captivate 7 preloader not working - with screen captures for clarity

    Hi Community,
    so I'm working in the Captivate 7 trial version, because the preloader for Captivate 6 isn't working for me. We have a ~48MB project with mp3's on almost every slide, flash videos, flash animations, quizzes and plenty of jpegs.
    Before we publish the project we make sure we click everything that's needed, but because it's still not working I took screen shots of all the settings. Maybe I'm missing something, I would appreciate your help.
    Thank you guys so much!!
    Nat

    I'm assuming here that your preloader animation is at least appearing when you are loading the file so that you KNOW it IS working.
    Try setting your preloader progressively higher until you find the percentage at which the load times start INCREASING again.  If you have a lot of videos in your project, setting the preloader at a very low value like 10% doesn't necessarily affect the load times that much because Captivate still has to load a certain amount of the total number of assets before it can start to play anyway.  It could be that you have a whopping great event video right near the start of the project and that's what is causing the lengthy delay.
    If your issue is still with the preloaders NOT appearing at all, then the only settings that would affect this are the ones on the Preferences > Project  > Start and End > Preloader path and percentage.  The path looks to be fine, but if preloader animations are not visible at all, try changing to a different preloader.  Maybe only SOME of them work.  The Default.swf preloader is usually reliable.

  • Preloader not working in AS3 when viewing in a browser

    Hi there, It's me again Ysong.
    I have a problem regarding PRELOADING.
    MY TIMELINE:
    • First frame -- dynamic text which is my preloader with AS3 in it. NO MORE OBJECT in the frame only text which is dynamic.
         stop();
         loaderInfo.addEventListener(ProgressEvent.PROGRESS, updatePreloader);
         function updatePreloader(evtObj:ProgressEvent):void
              var percent:Number = Math.floor((evtObj.bytesLoaded*100)/evtObj.bytesTotal);
              myLoadText.text = "Loading..." + percent+"%";
              if (percent==100){
                        nextFrame();
    • Second frame -- the whole site in MOVIE CLIP which will be loaded after the preloading ends.
    ***The whole SWF file is only 600KB when publishing.
    ***When simulating download the preloader is working.
    MY PROBLEM:
    Whenever I uploaded these two files: (1) index.swf and (2) index.html, the preloader doesn't work. When viewed in browser it apprears to be white screen. After a couple of minutes, the index.swf appears and the preloader is not appearing as it should be. With (2), I didn't change anything on Dreamweaver just upload the file published by Flash Professional CS4.
    WHAT IS THE PROBLEM? Can anyone help me with this. I've uploaded (PUT) the files through Dreamweaver with a testing server configured.
    Thank you & Regards,
    YSONG

    hi Ned,
    I currently downloading the tutorial link you posted.
    Do you have any idea what is really happening? Because I really wanted to have a loading text only before the whole site is loaded. The SIMULATED DOWNLOAD in Flash CS4 is working great but whenever copy it in my hosting server and view it in my browser the preloader is not working.
    Thank you for your immediate response.
    Regards,
    YSONG

  • Captivate 6 preloader not working

    I have the preloader in Captivate 6 set to 10%.  The original Adobe loading screen appears for 10%, but then a "Loading" screen just appears until the entire project is loaded.  It takes the same amount of time as when the preloader is set to 100%.  The only difference is which "load" screen I'm looking at.  Is there a fix?

    My associate and I are having the same issues any help would be appreciated. We are using Cap 6.0.1.240 64bit Windows 7 machines.  In our project we have mp3 audio files. We also 3 flv files streaming from our Flash server.  We also have question slides but are not utilizing a question pool.  We also have a certificate widget at the end of the project.  We are linking to our content server through Moodle 2.4.  Or swf file is approx 38megs.  We were experiencing significant load times on several different networks with large bandwidth.   We have tried the following:
    - preloader AS3 at 10%
    - reduced the file size significantly (from 138M to 38M)
    - set slides to JPEG
    - made all audio files MP3s
    - off set the audio on slides to begin at .1
    - removed the quiz slides from the project
    - removed the video links from the project
    And still our load times hover around 18 to 25 seconds with each test and the preloader does not work.  Do you have any suggestions that will help?  Is this addressed in ver 7?
    Thank you,
    VJ

  • Preloader not working in IE.

    I created a preloader for an external swf. It works just fine
    in Firefox but when i tried to view it in IE the progress bar
    doesnt move at all. I need help to know why this isnt working, or
    at least an alternative way of doing a preloader that works in IE.
    Here is the site that the preloader is on
    http://www.geentertainment.com
    Oh yea, this worked fine when i tested it locally, but when i
    uploaded it thats when it just didnt want to do anything in
    IE.

    you probably need a cross-domain policy file.

  • Adobe Flash CS6 Image Filling Preloader not working?

    I'm trying to make a flash preloader using a image that slowly fills up.
    I used the tutorial on this site:
    http://flashexplained.com/preloaders/creating-a-preloader-for-your-flash-site-using-the-im age-of-a-bottle-and-a-rectangular-mask/
    I tried following the instructions until I finished and saw it wasn't working correctly. When i tried testing by simulating internet speed the screen showed blank for the first few seconds until the image loaded already half-way filled up. It's supposed to load completely transparent and slowly fill up from the bottom.
    So, I downloaded the source file from the tutorial link i showed above to see if i had dont something wrong while following the instructions only to find it happens there too... I uploaded a video of my screen on Youtube to show what is happening to me:
    Does anybody know why this is happening? Could it maybe be because I'm using the newer Adobe CS6? Any help is appreciated.

    The code is:
    stop();
    rectMask_mc._height = 1;
    this.onEnterFrame = function():Void  {
              var loadedData:Number = this.getBytesLoaded();
              var allData:Number = this.getBytesTotal();
              var percent:Number = Math.round(loadedData/allData*100);
              rectMask_mc._yscale = percent;
              if (loadedData>=allData) {
                        gotoAndStop(10);
                        delete this.onEnterFrame;
    I did a little testing and noticed when I deleted the line "rectMask_mc._height = 1;" it still does the same filling animation I got before that starts halfway.. so I'm guessing that command no longer works in CS6?!
    Edit:
    I just tried the "rectMask_mc._height = 1;" command by itself and it works...
    I'm sorry im just new to Flash, trying to learn the basics and reading up on tutorials but they are all outdated so I'm trying to figure out whats the problem with it not loading with its height at "1" then filling up when I'm using the entire code. The height command only works when I delete the rest of the code.

  • Preloader not working when published

    Hi...I have situation with my preloader. I am loading audio
    from an external folder. When I click on the audio a preloader
    loads the audio and upon completion plays audio.
    My problem lies in that when I test the movie everything
    works as expected. Once I view the actual .swf or the .exe after I
    publish, the preloader doesn't work. The audio still loads but the
    preloader does nothing. It might be important to not after I
    ctrl+return to test, I ctrl+return again to test as if it were
    online. It works when I do the simulate download and not right away
    then.
    Does anyone know what I might be doing wrong? Is there a
    setting in the publish settings I need to change?
    This is the first time I've had this happen. Usually I have a
    pre-loader at the begining of a flash file and load the file. This
    one is in a movie clip and only activated upon a mouse action.
    Any help or suggestions is greatly appreciated.
    Luke

    Thank you for your information. It worked great as far as...I
    could build a preloader and have the movie show up on the screen as
    I wanted. Now for problem number two that has developed...
    The MovieClipLoader that calls external .swf file. This is a
    movie that has an image scroll bar that calls a movie clip that
    scrolls a panoramic photo. Within that movie clip of the panoramic
    I have buttons that then call other movie clips from the library
    using
    on(release){
    _root.attachMovie("myModelScroll", "screen",1);
    _root.screen._x =10;
    _root.screen._y =425;
    This is an example of what I am doing
    I have a panoramic shot that is in an image scroller, that
    panoramic is of a group of buildings each building has a button
    next to it. Those buttons then call up another movie clip from the
    library using the attachMovie clip to show another mini movie clip
    of what the building looks like inside, and what the purpose is.
    Issue:
    The buttons within the movie clip that is loaded into the
    image scroller fail to work. If I just load the .swf files into the
    browser it works just fine...
    but the issue is I have a huge file with an image scroller so
    I need a progress bar and a MovieClipLoader function.
    How do I now get the other code attached to the buttons
    within the movie clip that says attachMovieClip to work within the
    context.
    I am so baffelled as to why it won't work...
    Here is the code to my preloader and movieClipLoader
    My actionScript skills are very limited so any help is
    greatly appreciated but needs to be supplied in simple language.
    Thank you very much

  • Flash Preloader not working anymore

    The final and most crucial part to completing a project I
    have is the preloader. When I first developed this, the preloader
    worked fine. a 1.7MB file later, it shows a blank screen, and then
    the preloader shows 100% and the page loads.
    I was given advice to have the movie clips not be exported to
    the first frame, but have them elsewhere in the movie. Problem with
    that is that they stop working if I do that.
    Anyway, here's my code. Hopefully someone can figure out why
    it's not appearing while it loads!
    stop();
    loadingBar._yscale = 1;
    var loadingCall:Number = setInterval(preloadSite, 50);
    function preloadSite():Void {
    var siteLoaded:Number = _root.getBytesLoaded();
    var siteTotal:Number = _root.getBytesTotal();
    var percentage:Number = Math.round(siteLoaded/siteTotal*100);
    loadingBottle._yscale = percentage;
    percentClip.percentDisplay.text = percentage + "%";
    percentClip._y = loadingBottle._y + loadingBottle._height;
    bytesDisplay.text = "loaded " + siteLoaded + " of " +
    siteTotal + " bytes";
    if (siteLoaded >= siteTotal) {
    clearInterval(loadingCall);
    _root.gotoAndPlay("Movie", 1);
    }

    This is normally a hardware issue. You should contact Apple and discuss what options you have. As one last effort, you could attempt to Restore the iPhone and set it up as a new device. If the problem continues after doing this, then it is most likely a hardware issue.
    - Greg

  • Preloader not working for 35 MB swf file. Please help!

    Hello,
    I'm working on a glorified slideshow, it has a music track that is 3+ minutes long, pretty nice graphics, and transitions. I started builing in Flash and am halfway done... it looks great too !
    Problem is, when I'm testing the preloader with the download profiler set to DSL - it crawls and at 1% and on, the soundtrack starts to play... by the time the download is at 42% its at least a minute into the soundtrack and it's in and out, coming on then cutting out but not starting over. Needless to say, this is not okay! I know it's a huge file. SHould I maybe export it as an mov and put it in a FLV player?
    Thanks for reading & helping
    Ms.Lee

    Ok, so my preloader code was all wrong, now it's this:
    import flash.events.ProgressEvent;
    var request:URLRequest = new URLRequest("HitTheGround6.swf");
    var ldr:Loader = new Loader();
    this.addChild(ldr);
    ldr.x=0;
    ldr.y=0;
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
    ldr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    ldr.load(request);
    function progressHandler(evt:ProgressEvent):void {
        var percent:Number = evt.target.bytesLoaded / evt.target.bytesTotal;
        preloader.fill.scaleX = percent;
    function completeHandler(evt:Event):void {
        this.removeChild(preloader);
        evt.target.content.gotoAndPlay(2);  //this is the key
    This awesome blog post has the files & explaination!!!
    http://www.negush.net/blog/how-to-preload-as3-clips/

  • Preloader Not Working Properly

    I know, another Preloader post. I was asked to problem solve why a preloader sometimes shows up, but mostly doesn't, leaving the viewer confused as to why they are staring at a blank page for a long time, waiting for something to happen. Problem is, I am not very knowledgable in flash.
    Below is the code I was asked to work with.The client wanted the entire site to preload; opening animation and videos throughout the site. My boss actually ended up piecing this code together, but is also not a flash guru, so he is out of ideas.
    I don't really know what the issue is, and most of the tutorials I looked up deal with a different code.
    stop(); var nc:NetConnection = new NetConnection(); nc.connect(null); var ns:NetStream = new NetStream(nc); var videoPlayer:Video = new Video(); videoPlayer.attachNetStream(ns) ns.play("http://www.missionpublicaffairs.com/MPA-031813.flv"); ns.pause(); var SWFtotal:int; var VIDEOtotal: int; var AVGtotal: int; function checkLoad():void { trace("Video Bytes Loaded: " + ns.bytesLoaded); trace("SWF Bytes Loaded: " + this.stage.loaderInfo.bytesLoaded); SWFtotal = int(((this.stage.loaderInfo.bytesLoaded/this.stage.loaderInfo.bytesTotal)*100)); VIDEOtotal = int(((ns.bytesLoaded/ns.bytesTotal)*100)); AVGtotal = int(((SWFtotal + VIDEOtotal)/2)) //MattText.text = "Video Loaded: " + VIDEOtotal + "%"; //SWFText.text = "SWF Bytes Loaded: " + SWFtotal + "%"; TotalText.text = "Total Loaded: " + AVGtotal + "%";           if ((ns.bytesLoaded == ns.bytesTotal) && (this.stage.loaderInfo.bytesLoaded == this.stage.loaderInfo.bytesTotal)) {           clearInterval(myInterval);           this.gotoAndPlay(2); } } var myInterval:uint = setInterval (checkLoad, 200); 
    The site link is here, if needed. Again, sometimes it shows, sometimes not. Please let me know if you need anything answered in order to give me pointers. Thanks in advance.
    M!

    kglad, thanks for replying. Is there is a specific place I need to stick the code? I've tried it in a couple of different places and when I test it (via Control>Test Movie>Test-Download Settings 56k>Simulate Download) I am still seeing a blank page.

  • Why does my PRELOADER not work.

    I have made many attemps to get thjis right, but keep running into basically the same problem.
    I keep getting an error that says "the class or interface "Event" could not be loaded" here is mypreloader.fla file attached.
    I really need a preloader for my flash intro, please help me.

    Hi,
    loaderF();
    function loaderF(){
        var toLoad:Number = loaderInfo.bytesTotal;
        var loaded:Number = loaderInfo.bytesLoaded;
        var total:Number = loaded/toLoad;
        if(loaded == toLoad){
            //removeEventListener(Event.ENTER_FRAME, loaderF);
            gotoAndStop(2);
        } else {
            preloader_mc.preloaderFill_mc.scaleX = total;
            preloader_mc.percent_txt.text = Math.floor(total*100) + "%";
            preloader_mc.ofBytes_txt.text = loaded + "bytes";
            preloader_mc.totalBytes.text = toLoad + "bytes";
    use like this.. if AS2
    Saransoft

  • HELP - preloader not working

    Using CS4 Actionscript 2.0
    Frame 1 of preloader:
    percent = Math.floor(getBytesLoaded()/getBytesTotal()*100);
    myOutput.text = percent+ "%";
    Frame 2 of preloader:
    if(percent== 100){
    nextScene();
    }else{
    gotoAndPlay(1);
    Check out what happens after percentage loaded. It just goes to Frame 1 of next scene but doesn't play it....  although if you right click and click PLAY it will indeed play it..
    How to get it to start upon 100% loaded??
    THANK you
    I SHOULD NOTE that the scene that won't play has an embedded FLV in timeline

    Hi Ned, and thanks
    I tried moving FLV to frame 3, and changed actionscript accordingly, but now the preloader only flashes quickly and the movie starts... so there is no counting of bytes any longer, just a quick flash of the preloader text and the movie starts

Maybe you are looking for