Simple preloader in AS3 - HELP

Hi,
Could anyone please point me in the direction or tell me how
to build a simple preloader in AS3/PlashPlayer 9.
I'd just like to have a movie clip in frame one which
animates until the rest of the timeline has loaded, then once
loaded go to frame 2.
I've had a look in the doucumentation and around the web to
find something but can't find anything that works and I'm finding
it quite hard.
Thanks in advance

These screen captures show the library of the movie. As you can see I export the most of them. However I have doubts about if I must convert to symbol the graphics. I have the preloader in the "presentación" folder without any exportation.
Please, Could you correct the website?. Please, tell me an e-mail address and I send you the website via WeTransfer.

Similar Messages

  • Help with simple preloader- please

    hello,
    i'm trying to get a simple preloader and progress bar working
    for a swf file. The problem is the main swf. movie starts playing
    under preloader before the preloader is finished. So when the
    preloader has finished you are already well into the main movie.
    (After the movie loops you can see the first part that was missing
    during the preload.) This is the AS that i found from a web site
    (MonkeyFlash), it is AS 3. Below is the script.
    here is a link to the page with the movie:
    http://www.aquatichealings.com/new/
    Also is it not advisable to use AS3 because it will only work
    in Flash 9 and not below and most people may not have 9? Should i
    be starting over in AS2. I had built a AS2 in Flash CS3 but had the
    same problem.
    Please kindly advise on how to make it work correctly. I'd
    really appreciate some help, i've gotten books and scoured the web
    for different methods and i'm afraid i'm a bit of a numb skull with
    Flash and can not seem to get a simple preloader and progress bar
    working correctly. THANKS!
    gregory
    var myRequest:URLRequest = new URLRequest("aquatic-h.swf");
    var myLoader:Loader = new Loader();
    myLoader.load(myRequest);
    myLoader.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
    myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress);
    myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,showContent);
    var myPreloader:Preloader = new Preloader();
    function showPreloader(event:Event):void {
    addChild(myPreloader);
    myPreloader.x = stage.stageWidth/2;
    myPreloader.y = stage.stageHeight/1.2;
    function showProgress(event:ProgressEvent):void {
    var percentLoaded:Number =
    event.bytesLoaded/event.bytesTotal;
    myPreloader.loading_txt.text = "Loading - " +
    Math.round(percentLoaded * 100) + "%";
    myPreloader.bar_mc.width = 198 * percentLoaded;
    function showContent(event:Event):void {
    removeChild(myPreloader);
    addChild(myLoader);
    }

    ... the pre-loader clip must be accompanied by a "stop"
    perhaps a "stop all sounds", too ActionScript on the action layer
    of the main timeline.
    I keep it simple and ask my prloader to not let the main
    timeline play until the final frame of the movie has loaded. The
    final frame is accompanied by a frame labeled "End" on a layer of
    the main timeline of just labels.

  • Help with simple Preloader. Error#1009  :-(

    Hello !
    I have a very simple preloader file which loads a "main.swf" file. I put on stage
    a LogoCompany (MovieClip), a Mask (MovieClip) and a Text (Dynamic).
    As the percentage of bytes from the .swf file increases, the Mask.x position is increased so the LogoCompany appears.
    Here is the code:
    // Simple Preloader
    var maskStart:Number = 116;
    var maskEnd:Number = 377;
    var maskMove:Number = maskEnd - maskStart;
    var myLoader:Loader = new Loader();
    // URL to swf.
    myLoader.load( new URLRequest("main.swf") );
    // Create event
    myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, myLoop);
    function myLoop(e:ProgressEvent):void
        var perc:Number = Math.round( (e.bytesLoaded / e.bytesTotal) * 100);
        trace ("perc == " + perc);
        txtMessage.text = "Loading... " + perc.toString() + "%";
        trace ("txtMessage.text == " + txtMessage.text);
        maskLogo_mc.x = maskStart + maskMove * perc / 100;
        trace ("maskLogo_mc.x == " + maskLogo_mc.x);
        if(e.bytesLoaded == e.bytesTotal)
            removeChild(maskLogo_mc);
            removeChild(logoCompany_mc);
            removeChild(txtMessage);
            txtMessage = null;
            addChild(myLoader);
    The animation is actually going till the end (100%).  But in the middle I always get this error:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/main_fla::frame13()
    I really don't know what is going on.
    Can anyone help me with this ?
    Thanks in Advance.
    H

    Hello Ned.
    Thank you for your prompt reply.
    Unfortunately I got the same error after I followed your suggestions:
    - Moving the .load() function after everything.
    - Marking "Permit Debugging" on Publish Settings under Flash tab. (CS3 version here)
    Any more suggestions?
    Thanks in advance.
    H

  • Preloader in AS3

    hi,
    Can u give  me any idea how to creat preloader in as3..
    Plz help me guys m new in as3
    Thanks,
    JaxNa

    on first Key frame the following code
    loader is a movie Clip
    percent is a text field
    stop();
    addEventListener(Event.ENTER_FRAME, preloader);
    function preloader(evet:Event){   
        var load_value:Number = this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal;
        loader.scaleX = load_value;
        if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
            this.gotoAndStop(2);
            removeEventListener(Event.ENTER_FRAME, preloader);

  • Flash skip preloader in AS3

    Hi, I searched the internet but I couldn't find a solution to skip the preloader in AS3. All I found was for AS2 (Maybe I didn't search well )
    When I visit my page again and the flash has already been loaded, I get stuck on frame 1 and the movie does not continue to where it supposed to be. Is there a way to skip the preloader if the swf has already been preloaded or cached?
    Here is my actionscript:
    //Import the required assets
    import flash.display.*;
    //Stop the playhead while loading occurs
    this.stop();
    //Create a listener to call the loading function as the movie loads
    this.loaderInfo.addEventListener (ProgressEvent.PROGRESS, PL_LOADING);
    /*This is the main function, basically it grabs the total and loaded bytes,
    calculates a percentage, and displays it by stretching the bar and adjusting
    the textfield display. If your bar/textbox instancenames are NOT lbar/lpc,
    you'll need to adjust this code to match your instance names*/
    function PL_LOADING(event:ProgressEvent):void {
    var pcent:Number=event.bytesLoaded/event.bytesTotal*100;
    //Stretch the bar
    lbar.scaleX=pcent/100;
    //Display the % loaded in textfield
    lpc.text=int(pcent)+"%";
    //If the movie is fully loaded, kick to the next frame on the main timeline
    //You may wish to change the gotoAndStop(2) to a gotoAndPlay(2)
    if(pcent==100){
    this.gotoAndStop(2);
    Thanks to anyone who helps.

    use:
    //Import the required assets
    import flash.display.*;
    //Stop the playhead while loading occurs
    this.stop();
    //Create a listener to call the loading function as the movie loads
    this.loaderInfo.addEventListener (ProgressEvent.PROGRESS, PL_LOADING);
    this.loaderInfo.addEventListener(Event.COMPLETE,loadCompleteF);
    function loadCompleteF(e:Event){
    this.gotoAndStop(2);
    /*This is the main function, basically it grabs the total and loaded bytes,
    calculates a percentage, and displays it by stretching the bar and adjusting
    the textfield display. If your bar/textbox instancenames are NOT lbar/lpc,
    you'll need to adjust this code to match your instance names*/
    function PL_LOADING(event:ProgressEvent):void {
    var pcent:Number=event.bytesLoaded/event.bytesTotal*100;
    //Stretch the bar
    lbar.scaleX=pcent/100;
    //Display the % loaded in textfield
    lpc.text=int(pcent)+"%";
    //If the movie is fully loaded, kick to the next frame on the main timeline
    //You may wish to change the gotoAndStop(2) to a gotoAndPlay(2)
    if(pcent==100){
    this.gotoAndStop(2);

  • Very simple preloader

    Hi!!
    I'm looking for a simple preloader with a % to load my movie.
    Does anybody have it?
    I'd like to copy the code and put on my movie, simply this.
    I try to use standard preloader in Cs5.5 but I can't understand how to use it...
    Thank you so much
    Ciao!

    Here is a link to a tutorial that explains the design and provides the code...
    http://www.gotoandlearn.com/play.php?id=85

  • HT1338 I have a Mac Mini running OSX version 10.8.5 and I want to connect an HP OfficeJet K60 printer using a USB connection.  How do I do this please?  I am not very computer literate so simple instructions would be helpful!

    I have a Mac Mini running OSX version 10.8.5 and I want to connect an HP OfficeJet K60 printer using a USB connection.  How do I do this please?  I am not very computer literate so simple instructions would be helpful!

    Hi Johnfromglenver,
    There are no Mac drivers for the HP Officejet K60 printer. Therefore it is not compatible with the Mac operating systems. Please call our technical support at 800-474-6836. If you live outside the US/Canada Region please click the link below to get the support number for your region. http://www.hp.com/cgi-bin/hpsupport/index.pl. There may be other solutions that could work for you.
    I hope this information helps.
    Advance 23
    I work on behalf of HP

  • Simple preloader problem

    hey, Im new to actionscript 3 and I am trying to make a a simple preloader for a game. the game is a SWF file located in the same directory as the preloader. the premise is very simple but I cant seem to understand my error problems. I have a MC called "preloader_mc" on stage (it says Instance of: preloader_mc in the properties panel, but theres also an empty field called '<instance name>'). Inside the preloader_mc is my dynamic text field which is named "txtLoad", and 1/4 circle line which is supposed to circle the percentage loaded in the text field. the circle is name "circle_mc" which an instance name of circle_mc.
    I have an external AS file called PreloaderAS and it contains:
    package {
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.events.Event;     
    import flash.events.ProgressEvent;
    public class PreloaderAS extends MovieClip {
    public var loader:Loader = new Loader();
    public function PreloaderAS(){
    loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loading);
    public function loading(ev:ProgressEvent):void {
    var pct:Number = ev.bytesLoaded/ev.bytesTotal;
    trace( ev.bytesLoaded + " / " + ev.bytesTotal + " = " + pct);
    circle_mc._rotation += 7;
    var strPct:String = Math.round( pct * 100).toString();
    preloader_mc_txtLoad.text = strPct + "% Loaded";
    The errors are:
    1119: Access of possibly undefined property _rotation through a reference with static type Class. (2x)
    1120: Access of undefined property preloader_mc_txtLoad.

    my files (.fla, .as, and the swf) are located here:
    http://www.speedyshare.com/files/27178512/download/preloader.zip

  • Why is "erase junk mail" de-highlighted in the drop down menus.  I'm not able to delete my junk mail box without doing each one individually.  Simple, but please someone help with an answer.  Thanks.

    why is "erase junk mail" de-highlighted in the drop down menus.  I'm not able to delete my junk mail box without doing each one individually.  Simple, but please someone help with an answer.  Thanks.

    My daughter has had her Razr for about 9 months now.  About two weeks ago she picked up her phone in the morning on her way to school when she noticed two cracks, both starting at the camera lens. One goes completely to the bottom and the other goes sharply to the side. She has never dropped it and me and my husband went over it with a fine tooth comb. We looked under a magnifying glass and could no find any reason for the glass to crack. Not one ding, scratch or bang. Our daughter really takes good care of her stuff, but we still wanted to make sure before we sent it in for repairs. Well we did and we got a reply from Motorola with a picture of the cracks saying this was customer abuse and that it is not covered under warranty. Even though they did not find any physical damage to back it up. Well I e-mailed them back and told them I did a little research and found pages of people having the same problems. Well I did not hear from them until I received a notice from Fed Ex that they were sending the phone back. NOT FIXED!!! I went to look up why and guess what there is no case open any more for the phone. It has been wiped clean. I put in the RMA # it comes back not found, I put in the ID #, the SN# and all comes back not found. Yet a day earlier all the info was there. I know there is a lot more people like me and all of you, but they just don't want to be bothered so they pay to have it fix, just to have it do it again. Unless they have found the problem and only fixing it on a customer pay only set up. I am furious and will not be recommending this phone to anyone. And to think I was considering this phone for my next up grade! NOT!!!!

  • I don't understand why a person who has been with a company for 6 years cant get a simple upgrade can anyone help figure that out?

    I don't understand why a person who has been with a company for 6 years cant get a simple upgrade can anyone help figure that out?

    Are you trying to get an upgrade before you're actually eligible? If that is the case, it doesn't matter if you've been a customer for 6 years or 6 days...if you're not eligible then you're not eligible. Some of your possible options are to pay full retail, do an early edge up (if you are eligible for that option), or buying a phone from some other source to use.
    If your situation is something different then it might help to share that. The options may still be the same but it helps to know what exactly the issue is.

  • Much like a wall timer, how do I program labview to simply flip a switch at a certain time? Simple to you but HELP asap!

    I've got a case structure going here...  I can control it with boolean (on/off) and I'm controlling an 1160 switch module successfully.
    The question is, and this is dauntingly difficult to me, how do I set it so that boolean changes at a specific time?
    I need to activate that 1160 switch to shut off an extrernal relay at 8:00PM tonight.  How can I use the date/time strings and whatnot to get me where I need to be?
    I've looked at Scheduler.vi and can't make heads or tails of it...  HELP...
    Dirt simple VI attached.
    Still confused after 8 years.
    Attachments:
    Timed shutdown.vi ‏18 KB

    Hello:
    This is a quick simple VI that may help you, I made it ASAP.
    Compares a target hour versus the output of the Format Date Time String, which receives the current time.
    If they're the same, it means it's time to shutdown, and stops the While Loop.
    Pretty simple, hope this helps you, or if I misunderstood your problem, please let me know.
    Robst.
    Robst - CLD
    Using LabVIEW since version 7.0
    Attachments:
    Timed stop.vi ‏9 KB

  • Help with a preloader in AS3

    Hi,
    I upload a website and I have problems with the preloader did it in AS3. It starts after two or three minutes. I have a MC with an animation of 100 frames and the dynamic text of the percent. The preloader is located in the 1 frame to the 10, I mean, first frame with the actions and the other three layers (text, MC and background) with a lenght of 10. The movie has 525 frames. Here is the code:
    stop();
    addEventListener(Event.ENTER_FRAME, lodeando);
    function lodeando(event:Event):void
              var bytesTotales = stage.loaderInfo.bytesTotal;
              var bytesCargados = stage.loaderInfo.bytesLoaded;
              var porcentaje = Math.round(bytesCargados * 100 / bytesTotales);
              textoPorcentaje.text = porcentaje + "% Cargados";
              cargaAnimada_mc.gotoAndStop(porcentaje);
              if (bytesCargados == bytesTotales)
                        removeEventListener(Event.ENTER_FRAME, lodeando);
                        gotoAndPlay(2);
                        textoPorcentaje.text = "";
                        removeChild(textoPorcentaje);
                        removeChild(cargaAnimada_mc);
    Please, Could you help me?.

    These screen captures show the library of the movie. As you can see I export the most of them. However I have doubts about if I must convert to symbol the graphics. I have the preloader in the "presentación" folder without any exportation.
    Please, Could you correct the website?. Please, tell me an e-mail address and I send you the website via WeTransfer.

  • Flash rookie needs help with error messages when making simple calculator in AS3.

    I am trying to make a simple calculator I have been following this guide:
    http://www.youtube.com/watch?v=5k3h37YKZJI
    this is my code.
    var Hnum:String;
    var PCnum:String;
    var calc:Number = 25;
    var Total:String;
    num1.restrict = "0-9";
    num2.restrict = "0-9";
    Est_btn.addEventListener(MouseEvent.CLICK, calculate);
    function calculate(event:MouseEvent):void{
        Hnum = num1.txt;
        PCnum = num2.txt;
        Total = parseInt(Hnum) * calc;
        Total.toString();
        Total_txt.text = String(Total);
    I am getting these 3 errors:
    Scene 1, Layer 'Actions', Frame 1, Line 14
    1067: Implicit coercion of a value of type flash.text:TextField to an unrelated type String.
    Scene 1, Layer 'Actions', Frame 1, Line 15
    1067: Implicit coercion of a value of type flash.text:TextField to an unrelated type String.
    Scene 1, Layer 'Actions', Frame 1, Line 16
    1067: Implicit coercion of a value of type Number to an unrelated type String.
    I have two input text boxs named num1 and num2 and then one dynamic text box named Total_txt.
    This should be so simple I really don't know what im doing wrong?
    Any help would be really appreciated.
    MrB

    If you look at the tutorial I think you will see that you are using "txt"  where "text" is required.  "text" is a property of a textfield, identifying the text that the textfield holds.  I don't know if you are doing something where the num1 object contains another object named txt, but I think my first sentence catches the problem.

  • A good simple preloader.

    I've asked some questions regarding this before on a project I had to put on the backburner.  But I'm back to that project now and am looking at it with new fresh eyes so I thought I'd bring it up again in a new discussion.  I'm working on a Flash website, using Actionscript 3 in Flash cs5.5.  I need a preloader...one that loads and opens a seperate swf.  I got some help putting some code together to make a preloader like this and it works but I'd like to make one more visually pleasing. 
    Can anybody either give me advice or possibly point me towards a tutorial that will teach me to make a preloader with a some sort of loading graphic, like a status bar or something(doesn't have to be anything too crazy) that will load and open another swf?  I've found tutorials in the passed that show how to make status bars and stuff but they're all coded to load another frame within the same swf, which isn't what I want and I don't know my way around as3 well enough to modify it for what I need.
    The key here really is I want it to be simple.  I'm not an actionscript whiz by any stretch. 
    thanks guys!

    If you look at the loop function in the code he provides, that is what you will use to control things like a loading bar... the key being to understand and make use of the perc value that is being calculated. 
    You can use the perc value to control the scaleX of something, such as a status bar...
    yourStatusBar.scaleX = 0;  // a starting value for your status bar
    function loop(e:ProgressEvent):void
        var perc:Number = e.bytesLoaded / e.bytesTotal;
        percent.text = Math.ceil(perc*100).toString();
        yourstatusBar.scaleX = perc;

  • Rotating knob from AS2 -- AS3 help please

    I'm trying to create a rotating knob that a User can turn
    with the mouse. The initial code worked in AS2 but the rest of my
    project is in AS3. so I started to convert it over (with help) Can
    anybody help make it work in AS3?
    I'm sure the "update Advent" is incorrect. also i would like
    to have the knob only able to rotate 180 deg from initial position.
    I'm thinking i need to fid the initial x,y position and the final
    x, y position and use those as bounderies but not sure if there is
    a way to do it with rotation<180 type of thing. thank you in
    advance for any help, or direction.

    kglad
    can you help me with something so simple that im embarrised
    to mention it :) i can't figure out what i'm doing wrong i have a
    button in a child movie clip and im trying to control another movie
    movie clip, that is also a child of the same main moive clip with
    no luck, i use the "insert target path" but when i try to run test
    the flash it gives me a error " the Toggle_up button was clicked
    TypeError: Error #1010: A term is undefined and has no
    properties.
    at controlpanel_demo_fla::Switch_Air_18/clickButton()"
    any ideas sorry to bother you again

Maybe you are looking for

  • How to convert Chineese script O/P into PDF?

    Hi, I have a requirement like "Irrespective of login language i need to send both english as well as chineese PDF's to multiple recepients.I m using CONVERT_OTF FM to do so.So when i login into EN and run the script english PDF comes fine but in chin

  • What is the proper procedure to backup to multiple external hard drives if one wishes to rotate drives such that you may store one in a fire safe?

    Description:  If I want to back up to two external hard drives using Time Machine, what is the proper procedure to follow such that I could keep one attached to Time Machine for daily backups, and one that I attach monthly such that I can back it up

  • ORDER_PARTNER BAPI_SALESORDER_CREATEFROMDAT2

    Dear everyone,   I tried different approach of filling the order partner parameter for the BAPI_SALESORDER_CREATEFROMDAT2 function. Unfortunately, i encounter the following error: When calling the function module "BAPI_SALESORDER_CREATEFROMDAT2", one

  • Want to Hide smthing for particular user

    hi everyone i had created one application and in that application if my end user='A' then he only able to access application pages 2,3,4. And if user =B then he will be able to access pages 1,3,4,5 .In short how u gonna hide for one user and display

  • Date Changes

    Don't know if this is in the right forum. Since Monday all documents changed dates back to 1985/01/01, this includes all MS Office doc's as well as all jpg's, BMP and even Application executables. We are running the following on the Novell servers NW