Preloader. So Frustrating...

I am using flash develop and as3.
But for the last couple of weeks I have been banging my head against a brick wall trying to get a preloader to work
This is my preloader code
package
          import flash.display.Bitmap;
          import flash.display.DisplayObject;
          import flash.display.MovieClip;
          import flash.display.StageAlign;
          import flash.display.StageScaleMode;
          import flash.events.Event;
          import flash.events.IOErrorEvent;
          import flash.events.ProgressEvent;
          import flash.utils.getDefinitionByName;
           * @author Progress Studios
          public class Preloader extends MovieClip
                    [Embed(source = "Pictures/Preloader.png")]private const PreloaderImage:Class;
                    private const PImage:Bitmap = new PreloaderImage();
                    public function Preloader()
                              if (stage) {
                                        stage.scaleMode = StageScaleMode.NO_SCALE;
                                        stage.align = StageAlign.TOP_LEFT;
                              addEventListener(Event.ENTER_FRAME, checkFrame);
                              loaderInfo.addEventListener(ProgressEvent.PROGRESS, progress);
                              loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
                              // TODO show loader
                              stage.addChild(PImage);
                    private function ioError(e:IOErrorEvent):void
                              trace(e.text);
                    private function progress(e:ProgressEvent):void
                              // TODO update loader
                    private function checkFrame(e:Event):void
                              if (currentFrame == totalFrames)
                                        stop();
                                        loadingFinished();
                    private function loadingFinished():void
                              removeEventListener(Event.ENTER_FRAME, checkFrame);
                              loaderInfo.removeEventListener(ProgressEvent.PROGRESS, progress);
                              loaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, ioError);
                              // TODO hide loader
                              startup();
                    private function startup():void
                              var mainClass:Class = getDefinitionByName("Main") as Class;
                              addChild(new mainClass() as DisplayObject);
I am using this line in my document class
[Frame(factoryClass="Preloader")]
I am using a swc to get all my graphics
What am I doing wrong why wont I get a picture for my preloader

Problem lies in your constructor:
if (stage) {
                                        stage.scaleMode = StageScaleMode.NO_SCALE;
                                        stage.align = StageAlign.TOP_LEFT;
                              addEventListener(Event.ENTER_FRAME, checkFrame);
                              loaderInfo.addEventListener(ProgressEvent.PROGRESS, progress);
                              loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
                              // TODO show loader
                              stage.addChild(PImage);
you want to use sth. like this to prevent unexpected beahavioor in all your class instances that have to access the displyaylist:
if(stage){
init();
else{
addEventListener(Event.ADDED_TO_STAGE,init);
public function int(e:Event = null):void{
//put all the code that accesses stage here

Similar Messages

  • I would like to remove the icons that came preloaded when I did the update for ios7. The Disney, yahoo, Espn etc. these icons aren't in my bookmarks so how do I remove them from my safari home screen?

    I would like to remove the icons that came preloaded when I did the update for ios7. The Disney, yahoo, Espn etc. these icons aren't in my bookmarks so how do I remove them from my safari home screen? Can anyone help?

    I am trying to figure this out as well. It is really frustrating. I wish I could go back to iOS 6 this *****

  • Touchscreen and Other Frustrations

    I am a commercial truck driver that owns an iPhone 4S. The only available means of keeping the phone charged is by utilizing the vehicle's 12 volt DC plug (also known as the cigarette lighter plug for most). Whenever I try to use the phone while it's plugged in, the screen inputs register incorrectly whenever I try to type on the phone. I would usually receive jittery and jumpy responses while either trying to type or scroll on the screen. I go through great lengths at keeping both my hands and the phone clean whenever I use the phone, so dirt and dust is never an issue. There is a front and rear screen protector on the phone, and the phone is protected by a case (incase brand phone case purchased from a major retailer). I googled this issue the other day, and I am not alone with having touchscreen problems with the phone being plugged in. And grounding is not an issue.
    More frustrations with this phone includes not being able to establish a home page in the Safari web browser, organize bookmark folders the way that I want, deleting Sprint's preloaded bookmark (no matter how much I try to delete it, the Sprint bookmark keeps returning), and not being able to cancel out a route in Google Maps. I've owned four "high end" Android OS phones in the past (all HTC brand), and I've never had the issues described above. This is my first iPhone. With a phone that brands itself as being simple right out of the box, I feel that I shouldn't have to resort to Google to find out how to carry out simple tasks. I never had these random issues with HTC. I just don't like Android. I'm going to give this phone another month, and then I may just end up going back using Android phones.
    And then there's the iPhone 4S battery issue with the promise of a fix "coming soon".
    Sick of being frustrated with this phone...

    A factory reset will put your phone back to the state of when you first got the phone except with the most current Android Operating system installed.
    Downloaded applications, emails, contacts, calendar entries text messages and personalized settings will be gone.
    If you can access them, I would suggest backing up your contacts to either the Google account, Backup Assistant or the SD card. Contacts and calendar information saved to the Google account will be restored once you sign into your same Google account.
    There are also applications available from the Android Market that can backup everything

  • Another preloader problem

    all,
    i'm also having a strange problem. i am also using the lynda.com tutorial. i got frustrated when it didn't work, then recreated my movie step by step.
    rebuilt the file with all layers on frame 2. frame 1 is blank except for the dynamic text/preloader code in the actions layer.
    everything tested fine.
    later, as i built the movie out (to about frame 500), the preloader counter stopped working*.
    *i just figured out the counter issue: under properties panel (with a movie clip selected), under the 'export for actionscript' the option to 'export in frame 1' selected, disables the visual counter in my preloader.
    next, i comment out the entire 1st frame coding (stop and preloader text) and the movie plays fine and stops at the end.
    when i enable the "stop();" code, the playhead stops on the 1st frame—so that part works.
    the problem comes when i remove the comment in the preloader text:
    • test mode: frame stops at 2 (only the background shows, the playhead doesn't continue)
    the problem of the playhead staying at frame 2 still exists. it's making me crazy!
    i'm on a mac, osx (snow leopard), mac pro dual/quad core, 8gb ram
    any help would be greatly appreciated.
    the file can be downloaded here:
    http://www.roguedog.com/files/design/clients/d1r3.fla.zip

    when loading is complete you're directing the play head to the next frame (2) and stopping it.  if you want the playhead to advance to the next frame and play use:
    stop();
    //Preloader
    loaderInfo.addEventListener(ProgressEvent.PROGRESS, updatePreloader);
    function updatePreloader(evtObj:ProgressEvent):void
         //container for the progress of the site (download)
         var percent:Number = Math.floor((evtObj.bytesLoaded*100)/evtObj.bytesTotal);
         preloader_txt.text = percent+"%";
         if (percent==100) {
             play();

  • Preloader keeps looping- desperate

    Hi,
    I'm having issues with a preloader on my website. I made it
    in a seperate swf from my main site using the progress bar
    component but I added an animation movie clip to go along with it.
    the issue i'm having is coming up with script to stop my animation
    movie clip when my website loads. Right now my progress bar loads
    and then disappears but my animation continues playing over my
    website menu. I'm so frustrated with this, I been looking at sites
    all day trying to find script that might work. I need some code to
    make my animation disappear when my site loads. I'm using CS3
    action script 2.0. Any help would be greatly greatly appreciated.
    the malfunctioning awfulness of my preloader can be viewed at
    www.jenniferwaydesign.com

    Hi,
    Sorry, No I was just trying something and the animation
    disappeared entirely but no the problem is still there, I put the
    original swf file with the faulty animation script back up so it
    should show it now.
    yes, it is a large flash file and i think eventually i'll
    have to do that but for time's sake at the moment what i have just
    has to work for resumes until i have the time to go in and redo
    everything
    I've been trying to use event listeners, i'm just having a
    difficult time applying the percent loaded in my progress bar to my
    animation movie clip to make it go away when the event is
    loaded.

  • Preloading in templates

    i posted previously, but was not very clear. I originally
    used preloads for the many rollover images in my site. I want to
    remove them now, however every time I open a template, the <body
    onload="..."> keeps reappearing. I am using library items and
    have removed the preloads from them. I have tried removing them
    from the code manually and using the tag inspector. But they keep
    reappearing... very frustrating.
    http://www.boyerrv.com
    is the site, but you will probably need the templates... let
    me know.

    > I am using
    > library items and have removed the preloads from them.
    If you have preloads in a library item, then you have a
    broken library item.
    Well formed library items do not (MUST not) contain
    <html>, <head>, or
    <body> tags, thus there is no place to 'hang' a
    preload.
    To remove the preloads from the pages, you MUST remove them
    from the
    template page (why even bother though?). Open the template,
    click on the
    <body> shown on the QuickTag Selector bar at the bottom
    of the document
    window, open the behaviors panel with this body tag selected,
    and select
    "Preload Images" in the Behaviors panel. Click the "-" on the
    behaviors
    panel, and the behavior will be gone.
    By the way, this is the same response I gave to you the first
    time you
    posted this question (more or less).
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "RVs in Erie, PA" <[email protected]> wrote
    in message
    news:ec2kbn$3go$[email protected]..
    >i posted previously, but was not very clear. I originally
    used preloads for
    >the
    > many rollover images in my site. I want to remove them
    now, however every
    > time
    > I open a template, the <body onload="..."> keeps
    reappearing. I am using
    > library items and have removed the preloads from them. I
    have tried
    > removing
    > them from the code manually and using the tag inspector.
    But they keep
    > reappearing... very frustrating.
    >
    >
    http://www.boyerrv.com
    > is the site, but you will probably need the templates...
    let me know.
    >

  • Preloader progress bar not move in IE, but move well in Firefox

    I have been in this problem for several days. I really got
    frustrated about it. Pls. anybody can give me some help.
    I created a general preloader using movieClipLoader object
    and draw a progress bar using movieClip. I set the progress bar's
    progress by setting bar_mc._x = percentage, and created as a swf
    file. when test it , it works well, when open it using firefox, it
    still work well, can show the gradual progress in the bar, but if I
    using IE 6 or 7 to open it, it will not show the gradual progress ,
    just jump from 0% to 100% after the whole file is completely
    loaded.
    I saw a note about progress bar not show graduate progress in
    Flash Player 9, so I uninstall it and install Flash Player 8 again,
    it is still like that.
    I really don't know what 's the problem. Could any friends
    give me some suggestion or idea, that will be greatly helpful.
    Thanks.

    Have you contacted Project VII support or searched their knowledge base?
    http://www.projectseven.com/support/index.htm
    Also, is there any way to remove unused styles (in an external CSS) in DW? Just it would be a pain to go through and remove the styles I've tried, but then later decided not to use.
    Not exaclty a DW answer, but I've used the free FireFox add-on to help me find unused selectors. Point it to a sitemap.xml and it can spider the whole site (as listed in that xml file).
    https://addons.mozilla.org/en-US/firefox/addon/5392
    But be careful with it. It apparently doesn't read JavaScript and your PMM triggers are actually used.
    Mark A. Boyd
    Keep-On-Learnin' :-)
    If you are reading this via email, be aware that it may not be an accurate representation of my message. Login to read the actual message and/or to reply.

  • Preloader causes SWF to download twice

    Hi there,
    I'm wondering if anyone else has run in to this issue, where
    a movie with no 'export for runtime sharing' assets will be
    downloaded twice when accessed via a preloader script (see
    preloader code below). In this case, the SWF file 'main.swf' is
    downloaded twice - the second time straight after the preloader has
    finished with it. This is not usually detectable as most browsers
    cache the movie and it is instantly taken from cache, however on
    browsers that have the cache turned off this can be a very slow and
    frustrating experience.

    Hi kglad,
    At first that seemed like a silly comment, but it forced me
    to double-check everything. After the original block of code above,
    the movie continues to play an animation on the main timeline,
    always returning to the 2nd frame when done (the frame after the
    code above). In the full code for the onLoadInit event I had a
    _root.gotoAndStop(1); (see below) which called the movieclip
    main.swf to load again... I have changed this to
    _root.gotoAndStop(2); and it now works as intended.
    Thanks for the starter! :)
    -Shannon

  • Re installing preloaded software after a crash

    I have had a second HD crash since buying this machine 2 1/2 yrs ago. I do have back ups to an external drive and have been able to restore all but one program (MediaImpression2 as part of Total Media Suite). I contacted ArcSoft who said it was a custom program for the HP preloads on laptops so they cannot help.
    I do not have the extended HP warranty (have one through Tiger direct), so I cannot utilize HP support. Has anyone else experienced such a frustration? If so, how did you solve it?  I have photos mid- edit that cannot be opened by any other program. I would appreciate any advice.
    Thank you

    Have you tried the download on your support page to see if it installs the total package?
    http://h20564.www2.hp.com/hpsc/swd/public/detail?sp4ts.oid=5060881&swItemId=ob_96616_2&swEnvOid=4058
    If no joy with that-you might try this from a third party site. I would do a manual System Restore point just to be on the safe side- sometimes you get junkware along with a free download.
    http://arcsoft-mediaimpression.en.softonic.com/
    ******Clicking the Thumbs-Up button is a way to say -Thanks!.******
    **Click Accept as Solution on a Reply that solves your issue to help others**

  • Infamous White Screeen While Preloading

    Greetings to all good people of Adobe Community,
    Unfortunately using CP5.5 and CP6, white screen while preloading always appears. White screen disappears after a few seconds (or more) and preloader shows 15% progress and continues to load until 100% (or less depending on settings).
    I have tried everything: switched preloaders, disabled Quiz reporting, making new course, aggregated project, removing audio, first blank slide, auto start, etc.
    No matter what I do there is always that white screen and it is so frustrating since there is a series of big chapters in this course and after user switches to another chapter white screen just hangs in there and they always think something went wrong and they don't wait 5-6 seconds (or more) for preloader to show (again at 12-15% of loaded content). Please see attached video.
    I was hoping CP6 won't be having this issue but unfortunately it does. Any suggestion on how to fix this  would be appreciated. Thanks!

    Does anyone have a solution for this? Please?

  • Spry HTMLPanel preloader works...sort of...need some help

    Hello everyone :
    I have been fighting with this htmlpanel preloader for over 2 weeks now and I'm frustrated beyond words.
    http://1g2s.arena-i.com
    Hit portfolio, then any of the clients
    Currently, the preloader appears to work. And by appears to work I mean, it seems to preload the html (which is only 0.8k and loads quickly) but it doesn't seem to wait for the 250k +/- image inside the html as part of the preload. The preloading animated gif is only on screen for a split second, then the page appears, then the image loads.
    - The container that loads the htmlpanel ("content-center") has the class="HTMLPanelLoading"
    - There's another container in it with the class="HTMLPanelLoadingContent"
    ===========================================
    The current script, does this:
    - Fades out the container
    - Loads the new page into it
    - Fades it back in
    <script type="text/javascript">
                var hp4 = new Spry.Widget.HTMLPanel("content-center", {evalScripts: true});
                function hpanelFade(theURL){
                    var obs1 = {onPostUpdate:function(){openContent.start();}};
                    openContent.start();
                    openContent.addObserver(obs1);
                    var effectObs = {onPostEffect:function(){hp4.loadContent(theURL);}};
                    var obs = {onPostUpdate:function(){openIt.start();}};
                    closeIt.start();
                    closeIt.addObserver(effectObs);
                    hp4.addObserver(obs);
                var openContent = new Spry.Effect.Fade("content-wrap", {to: '100', duration:0, toggle:false});
                var closeIt = new Spry.Effect.Fade("content-center",{from: '100', to: '0', duration:500});
                var openIt  = new Spry.Effect.Fade("content-center",{to: '100', duration:400});
             </script>
    ===========================================
    I found this but don't know where/how to implement it within the context of the script above --or-- if incorporating this will even work :
    <script language="JavaScript" type="text/javascript">
       // Create an HTMLPanel widget and bind it to the element with
       // the id of "samplePanel".
       var hpanel = new Spry.Widget.HTMLPanel("samplePanel");
       // Add a function as an observer of the panel.
       function myObserverFunc(notificationType, notifier, data)
          if (notificationType == "onPostUpdate")
             alert("onPostUpdate fired!");
       hpanel.addObserver(myObserverFunc);
       // Add an object as an observer of the panel.
       var obs = new Object;
       obs.onPostUpdate = function(notifier, data) { alert("onPostUpdate was fired!"); };
       hpanel.addObserver(obs);
       // Remove the observers that were added.
      hpanel.removeObserver(myObserverFunc);
      hpanel.removeObserver(obs);
    </script>
    These are the two pages I've been using for reference...
    http://labs.adobe.com/technologies/spry/articles/html_panel/index.html
    http://labs.adobe.com/technologies/spry/articles/data_api/apis/html_panel.html
    Has anyone been able to implement this correctly??!?!?!?!

    ...

  • New T430 hard drive is bad and Lenovo won't supply replacement preloaded software

    Placed order for Lenovo T430 with preloaded Microsoft Office 2010, Adobe Elements, and Adobe Lightroom on 1/13/13.  I received the computer in January and have had ongoing problems with it since that time, requiring multiple contacts with tech support.  Overall, I could use the product (minus the thinkpad laster bluetooth mouse I also purchased from Lenovo that would not stay connected to the computer) up until this last week, when it would not start without going into the boot menu, but could not get out of the boot menu. 
    I called tech support, who thought it was the operating system and sent me recovery discs to reinstall the OS.  I had help from a computer servicing company who checked my computer and found the hard drive is bad.  They have called Lenovo, who are sending the hard drive out to be replaced.  However, Lenovo is refusing to replace the preloaded (by Lenovo) software I purchased from them.
    Case # A05LT3Q
    Tech support says that my account where I registered the product would be able to provide the software.  I called customer service about that and spoke with Hason about the problem.  He stated that he would have to start a customer advocate case for me.  He says he does not yet have a case # for me, but will call me before he leaves at 7pm tonight.  I will post that case # when and if I receive it from him.
    Am more than frustrated with this case and the problems I am having.

    If I remember correctly, the recovery discs should have everything that came with the system. I could be wrong though.
    W520: i7-2720QM, Q2000M at 1080/688/1376, 21GB RAM, 500GB + 750GB HDD, FHD screen
    X61T: L7500, 3GB RAM, 500GB HDD, XGA screen, Ultrabase
    Y3P: 5Y70, 8GB RAM, 256GB SSD, QHD+ screen

  • Adobe Cloud membership - I am stuck in the loop of Licensing VERY Frustrating!!!

    I have an Adobe Cloud membership - I am stuck in the loop of Licensing as well VERY Frustrating - I have a project due and have been troubleshooting for days -
    Un Installing - Re installing - NIGHTMARE  - Please someone help me!!! Thanks in advance -

    What happens when you enter your Adobe ID tied to your subscription?

  • Problem with Preloader in my Flash AS2 Game

    I have been using this tutorial to make a preloader:
    http://www.republicofcode.com/tutori.../preloader_bc/
    I have run into one problem though.
    When I simulate the download, it just shows the background color of the game while it loads, and when it finished loading, it shows the loading screen fully loaded. I have followed the tutorial exactly, except added my file names into the AS2 code.
    Here is the ActionScript in Frame 1 I have for the preloader:
    if (_root.getBytesTotal() != _root.getBytesLoaded()){
    stopAndGoto(1);
    preloaderBar._xscale=(_root.getBytesLoaded()/_root.getBytesTotal())*100;
    loaderTxt.text=Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100)+"%";
    Any hints or answers to what i'm doing wrong?
    Thanks, MrA615.

    Your description of what you've done and the code you show does not match what the tutorial says to do and what code to use... (there is no stopAndGoTo() function in Flash).
    Right-click the second frame on the upper layer labeled Actions and select Actions. Copy and paste the code below to make our preloader functional.
    if (_root.getBytesTotal() != _root.getBytesLoaded()){
    gotoAndPlay(1);
    bar_mc._xscale=(_root.getBytesLoaded()/_root.getBytesTotal())*100;
    loader_txt.text=Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100)+"%";

  • I want to Sync my iPhone 4 to iTunes however I get an error message from iTunes each time I connect the phone to the PC saying that I should restore to factory settings. Frustrating because it's already annoying enough that I can't drag and drop mp3's!!!

    I have never been so frustrated before in my life with any phone. I find it obnoxious as it is that I cannot simply drag and drop files (especially MP3's) straight from my PC directly into my phone, which I have been used to doing up until now. Everyone who convinced me to get the iPhone has instructed me that my frustration can be fixed by downloading iTunes and syncing it all up via that program (which I have never used before). So, I downloaded the program successfully, however when I connect the iPhone 4 to the PC and iTunes is open, I get an error message that 'iTunes cannot read the content of the iPhone "iPhone" and that I should go to the Preferences tab of the iPhone and select 'restore' to restore this phone to factory settings. First of all, I don't understand why I need to do that. I have already downloaded apps and other important things in the 2 days that I have the phone. I am also scared that it will erase my contacts. This is such a headache. Music is very imporatant to me, but I am getting so frustrated that I don't have freedom over the phone which I thought was supposed to be one of the best out there. I would really appreciate help in this matter. I am sure the phone is great but I am on the verge of taking it back and getting something else.

    Hey joshuafromisr,
    If you resintall iTunes, it should fix the issue. The following document will go over how to remove iTunes fully and then reinstall. Depending on what version of Windows you're running you'll either follow the directions here:
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    http://support.apple.com/kb/HT1925
    or here:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/HT1923
    Best,
    David

Maybe you are looking for