in Tutorials

New video tutorial on ActionScript 3 preloading

I just finished uploading a new tutorial that shows you the cleanest, most reliable way of preloading your ActionScript 3 movies. Like most things in Flash, there a many different ways of preloading your main content file. This approach takes a lot of the guesswork out of it and instead lets you focus more time on actually creating your movie, rather than worrying how it will preload. Check it out at


Write a Comment



  1. @zedia Basically I only remove event listeners when I want an object to be garbage collected. The Loader instance actually contains the main movie. So if I wanted the loader to be picked up by the GC I would remove listners, references, etc. This of course will all be easier once we have Loader.unloadAndStop in Flash Player 10.

  2. I might be wrong but I tought having a lot of listeners in your flash movie could make it play slow, and since those listeners(PROGRESS and COMPLETE) are never going to be used again, I tought removing them would be the cleanest way to do it.

  3. @zedia Yes you’re absolutely right. You always want to remove event listeners for objects you are no longer using so they can be properly garbage collected. In this case you could remove the progress and complete events but it wouldn’t be necessary from a GC perspective unless you wanted to remove the Loader.

  4. nice job–definitely the easiest way to deal with this stuff. Another minor point, however, you might include a cache buster…considering you’ll be changing that content.swf a lot–you want to look at the latest… something like:

    var url:String = “content.swf”;

    if ( stage.loaderInfo.url.substr(0,4) != “file” ) {
    var d:Date = new Date();
    url += “?cachebuster=” + d.getTime();

    l.load( new URLRequest( url) )

  5. @Phillip Great point! Forgot all about the cache aspect.

    @michaelwilson Basically you would load a series of Loaders on after the other and wait until the last one loads before adding to the display list. So in the complete event for the first Loader you could then start the second one, etc.

  6. OK, let’s say we don’t care about GC, like in this case, we don’t want the loader to be garbage collected. On the CPU level, is it better to remove listeners after they have been used (like in this case they will never be used again) or it doesn’t make much difference and you can just leave them as is?

  7. Nice tut lee. I actually did that same kind of thing but separated them on frames. This way is much better though. Maybe a tut on loading fonts would be nice for flash since it is quite hard to find out how on the web.

    Also wanted to ask what software you use for creating these tutorials. I’m looking to create some video tuts to teach people how to use my classes.

    Keep up the good work. =)

  8. @zedia If you’re sure that you won’t be loading anything again with it, it can’t hurt to remove those listeners. How much this will affect performance I’m not sure of though.

  9. “how would you modify this to load a sequence of swfs rather than just one, while displaying the aggregate percentage of all swfs? not looking for code, just theory.”

    Michael what I would do, is set up a new Array(); that’s empty, then list all of my swifs in strings. I dont do timeline coding so , I would also use a document class, Lee got a good tutorial on that. Anyway so in the constructor I would basiclly set up some Strings containg URL to my swiffs and do a init() function wich does this.

    Push each into the array.

    Then just itterate trought the array,

    for each ( string in myArray)

    and maybe have a iteration var, called i. and when that iteration var is equal to the arrays length we know we preloaded all, then we can starta adding the content in the array to display list.

    and i would prolly do that the same way as i loaded it,
    for each ( swiff in myArray)
    add to display list

    and keep an iteration var there also.

    thats pretty just theory, but lets say your preloader is a fullscreen swif, and you’r swifs are all different dimensiones and maybe you got a sketch of it in photoshop and figure out that ,.. hey this swif is 200 by 100 and goes i top right corner.

    in my init() function where i push the strings to the array. I would rather push objects into the array.

    And what I/we want into these objects are the url path to the swif, x and y position.

    so just push the array

    myArray is a new Array wich contains {object} and it gots url: x: and y:
    and those are specific for each swif so….

    well that’s how i would go about it, and I think it would work. Did I make any sense ?

  10. ah forgot to mention with objects in the array before you add to display list, you set the position stored in each object as x, and y. So you have to iterate trough the array and “configurate” before you add to display list so, they turn up in the right spots.

  11. I think there is an easy way to do it “internal preloader”:
    convert all the components on the stage to a moiveClip and movie it to second frame
    in the library uncheck “export in first frame ” for all components
    go to file-publish setting -setting – on “export frame for classes” change it to 2
    then you can do internal preloader in first frame…

    by the way is it possible to load just the first frame until the user click to load the rest of frames is that possible in flash 10?

  12. Nice to see this in tutorial form (it’s the way I’ve been doing it for a year now!) but I just wanted to add one thing: The moment you add the loaded SWF to the stage it will start running.

    This isn’t always desirable. For example say you want to “fade out” your pre-loader or play a little “It’s loaded” animation before the main SWF starts, then you need to be a bit more careful when adding to the stage.

    You could cast the to a LoaderInfo and then get the content from that (which is in effect your entire SWF). You’ve then a bit more control over when it’s added to the stage. Alternatively I usually do this but also make sure I have nothing in my main SWF documentClass constructor, but moving my constructor code to a “go” function. Then when my pre-loader is done, and the SWF is added properly, I call go() on it. But this is AS3, there are a hundred ways to skin this cat :) That’s just my preference.

  13. When preloading AS3 movies, I often find it’s good practice to have Event.ADDED_TO_STAGE in the Constructor of the Document Class within the movie you are loading, to avoid problems with referencing objects that may not exist on the Stage yet, due to loading.

    Does this sound right? Or is it just not needed?

  14. Personally I think the Frame metadata and AS 3.0 projects are the cleanest way to go. i.e. all content is within one swf, no need for loading external swf’s.

    @Marcus Andersson – this is the approach used in Flex.

    Its feasible this approach can be done with Flash by just throwing all the assets on frame 2 of your movie, with only the assets used for preloading on frame 1, then uncheck ‘Export of frame 1’ for the library assets.

    Wonder if this approach (and something that is relatively simple in an AS 3.0 project), has been resolved in the new Flash IDE.

    i.e. a “create preloader” button that enables u to pick the library assets you want to preload and takes care of this stuff for u.

  15. Just out of curiosity; why removeChildAt(0) instead of just removeChild(percent)?

    Also, agree about a tutorial on fonts in Flash, both embedding the right subset, using them in code and how to deal with the never ending annoyance of Flash’ inadequacy when it comes to calculating the dimentions of text in custom fonts. I get text fields with fonts that are cropped by the text field in some way all the time. Especially with the norwegian letter Ã…. it is an A with a ring above it, but very often it displays as A.

  16. This approach seems really well suited if you’re able to work with multiple files, but what is the best approach for adding a preloader in AS3 if you want one self contained .swf. With the artwork, animation, audio and code all inside the same file? Say for a self contained game that needs to only be one file.

    Great tutorial, thanks for sharing.

  17. @Martin Lindelöf

    Take a look at our Library and LibraryManager

    @Ben, see my previous comment (i.e. stick all your assets on frame 2 that you want to preload).

    It will be disappointing if Adobe haven’t built something into the IDE for the next version of Flash, when it is such an easy solution.

  18. I have a class i’ve been working on called Prequel that simplifies and organizes preloading in AS3. its located on google code at:

    I’m currently at a .95 release, i believe it to be stable but I have just made modifications this week and have not had an opportunity to publicly test this release.

    Prequel features:

    loading of the container SWF

    loading of external files of any type, including those not handled by flash directly (like PDF’s for example)

    Aggregate percentage information for all files being loaded

    option to buffer media files to a specified to percentage

    return of objects loaded (XML, URLVars) in a ready to retrieve state at completion of the load

    Lightweight(under 4k)

    XML and URLVariables can be preloaded directly into objects ready for parsing when the COMPLETE event is fired.

    A custom ‘PROGRESS’ event returns data on the file being loaded, percentages, data values, and more.

    Please feel free to try this out and submit bugs or feature requests, hopefully that’ll get this to a 1.0 release.

    sample implementation:

    import com.jeffdePascale.prequel.*;

    var preload:Prequel = new Prequel();
    preload.addEventListener(Event.COMPLETE, eCompleteHandler);
    preload.addEventListener(PrequelEvent.PROGRESS, eProgressHandler);
    preload.preload([this, “file.swf”, “test.mp3”]);

    function eCompleteHandler(e:Event):void{

    function eProgressHandler(e:PrequelEvent):void{

  19. @Ben Just make sure that your document class doesn’t reference things that you don’t want to load on frame 1. This includes any symbols on a any layer that has an instance name. This is precisely why IMO it is better to just use a preloader SWF. This way you don’t have to think about any of this nonsense. If you absolutely must have only one SWF then follow Colin’s recommendations in Essential ActionScript 3.

  20. So just to sum up based on the great comments so far. Here are the recommended approaches based on environment.

    Flash CS3 with no custom classes or components
    This can be done old school by simply moving your main assets off of frame 1. See my Basic Flash Preloader tutorial for this.

    Flash CS3 with custom classes or components
    Use the method that I showed in this tutorial if you want the cleanest approach. You can also use Colin’s approach if you need a single SWF file.

    Pure ActionScript project compiling with MXMLC
    Check out Tink’s approach in comment 19. Sounds like that is the best way to go.

    Flex Framework project
    The framework takes care of everything for you.

  21. @lee
    Thanks for the insight on using the onComplete event fired by the loader class to start the next… i kinda figured that one… my real concern was how to aggregate the bytes loaded content.

    @Jeff dePascale
    Thanks for your prequel code. I’ll look to see how you handled the aggregate total bytes loaded info… that’s exactly what i’m looking for.

  22. @michael

    The way it works is a two pass approach – first it goes through and checks the bytesTotal for each file being loaded, calculates in the mediaBuffer if necessary, adds the value to the multidimensional array for each item and to the overall total, then goes back and does the actual load from step one of the file array again. Hope that helps.

  23. Lee,
    Thanks for all this and the summing up
    Flash CS3 with custom classes or components
    Use the method that I showed in this tutorial if you want the cleanest approach. You can also use Colin’s approach if you need a single SWF file.
    I can’t help thinking that this has got a whole lot more complicated in the move from AS2 to AS3. Is this something which has happened “by design” for good reasons or is it just a by-product of fitting the AS3 VM into the existing IDE? If its a by-product does that mean we can look forward to it being simpler in future versions of the IDE?
    Given how frequently you need to make a preloader I like Tinks idea of a “Make this SWF preload itself” button. Failing that I would settle for a return the old school “put everything in frame 2” which is guaranteed to work every time.

    Anyway cheers for clarifying it all


  24. @ Phillip Kerman in post 5

    There kan be some problems with adding the cache-buster as you suggests. If you create a projector file and run it local it won’t be able to get the file if you add an ‘?’ in the file name.

    Then off course it might not be necessary to add the cache buster. But still you might want to use the same swf for both online and offline.

  25. Hello Lee,

    I am a great fan of yours. Your all tutorials are really good. I just want to request you, please try to upload tutorials for carousel, dynamic addition of items if carousel, etc in AS3. I am really having tough time while converting as2 to AS3.

    I am new to flash and started with AS3 only so every time I go through the tutorials, I find difficulty with the actionscript.

    Thanks, your tutorials are great for new learners.


  26. Hey, thanks for the video it was so helpful.

    I have been trying to put the preloader.swf into a web page, and it doesn’t seem to run at all, although it works fine when I run it normally.

    Can anyone help me out with this at all?

    Thanks a lot :)

  27. wot happens if you need to tranfer parameters from the preloader to the loaded swf, doesn’t that make this cake taste a little bit different.
    and anyway its just way to complicated dealing with two files instead of only one as it should be

  28. Flash CS3 with custom classes or components

    This can ALSO be done old school by simply moving your main assets off of frame 1 and exporting your classes and library assets on frame 2.

  29. @Fernand

    function onDone(e:Event)
    var loadedSwf:* =;//or l.content
    loadedSwf.param = “someParam”;

    You can also call methods too.


    Collins method is good too, but I’ve been using the technique described by lee @ work, but through a class, and this doesn’t cause harm. And there is nothing complicated about it.

    Nice one again lee.

  30. Hi Lee,
    nice Tutorial! But I have much the same problem as Mattias (post 40). I always get this error when trying to access the stage properties in the loader.swf:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at initStage()
    Any idea?


  31. Thanks for this tutorial. Very helpful.

    However, I’m having the same stage access issues as Marcus and Mattias.
    A tip from anyone on how to enable that would be greatly appreciated!

    Thank you!

  32. Found a solution to the stage access issue.

    In the Document class of the swf being loaded, empty the contents of the constructor function into another ( I called mine “init” ). In the constructor use

    addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);

    to call the init function when the loaded swf has been added to the stage (and therefore “stage” is accessible).
    Then init looks something like:

    function init(e:Event): void {
    // remove event listener if that is your thing
    // all the code that used to be in the Document class constructor

    Hopefully this will help someone out!

  33. Hey thanks Kirk for the solution but I am new to Actionscript 3.0 and I have a few questions about your solution. I have a swf and the document class is empty so would I just enter your code at the beginning of my script?

  34. hi all,
    again i like the teachings of lee, but i use document class in most of my projects cause i think the use of sprite is much nicer and less heavier that the old way of doing thing in flash and i clearly think that everybody should start using flex3. So i do use this technique anymore.

  35. Anyone have an answer for Jared’s question at comment #27? (Flashvars) I want to load in a movie that uses flash vars from the page but it doesnt like the method outlined in the tut.


  36. Great simple movie.

    I get an error with this, I’m using “full screen” flash on my “content.swf”

    I read somewhere that it’s due to using :

    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.dispatchEvent(new Event(Event.RESIZE));

    When the stage is not instantiated. Any workarounds?

    I get the error :
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at content_fla::MainTimeline/content_fla::frame1()

  37. Are there any settings that I should be aware of for the swf file that is getting loaded?

    I have tried a number of preloaders but with all of them, including this one, the file being loaded starts playing at about 45% (you can hear the music) and by the time the preloader finishes the movie has already played the first 8 seconds or so.

    Any suggestions?

  38. So here is the problem. I have started a AS Project in Flex 3 and with the as the loader and as the content. They are both extending the Sprite class and both are being compiled to SWFs with the Main.swf loading in the Content.swf. The problem is that if I reference ‘stage.whatever’ in the on runtime it throws a ‘Error #1009: Cannot access a property or method of a null object reference.’ I am setting the stage properties in the like so;

    stage.frameRate = 30;
    stage.align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.NO_SCALE;

    I am pretty new to AS so I know it is probably and easy fix or maybe not. Help!

  39. Hi,

    thanks for the tutorial. I’m having a strange problem with on Mac though, especially Safari.

    After loading all the bytes (I traced the exact numbers), the onComplete function doesn’t fire. The swf basically just stops. Check it out here: The main application should appear when the block is filled with the brighter color, but on Safari nothing happens. On Windows it works fine.

    Any ideas? I’m basically using exactly the same construct shown in the video, except for the loading graphics.

    Would highly appreciate any help. Thanks.

  40. @Kirk
    Thanks for the solution! you made my day!

    Thanks as always, i’m happy to know what the cleanest and easiest way for preloading is.

  41. James O’Reilly his tutorial
    does not work with this preloader.

    The preloader does not count the percentage and it tells in the Output panel that there is a TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at index_fla::MainTimeline/index_fla::frame1()

    How can I make this so that it will work ? Could the cause be that
    inside the preloader is a part saying: PERCENT = null;
    and that there is a part in James his code saying: resizeHandler (null); ?

    Well thanks in advance.

  42. In response to Jared (#27) here is a workaround to get flashvars working:
    On the load complete part, put:
    newsrc = src.loader.getChildAt(0);
    var flashvars:Object = {};
    for (var prop in root.loaderInfo.parameters) {
    flashvars[prop] = root.loaderInfo.parameters[prop];

    Just make sure you have a function called flashVars in the SWF you are loading in, and that it takes an object. Then you can play with them through there.

  43. In response to a lot of the questions about the null reference errors with the stage, it appears that if you set stage parameters in the preloader, (scale mode etc) your loaded movie will not have any troubles.

    In my loaded movie I still set stage listeners and they don’t give me any grief.

    Here is what I do in my preloader (i like the preloader text to be centered so that is where the extra code comes in):

    stage.showDefaultContextMenu = false;
    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.align = StageAlign.TOP_LEFT;
    stage.addEventListener(Event.RESIZE, loaderResizeHandler,false,0,true);

    var _midStageX:uint = stage.stageWidth / 2;
    var _midStageY:uint = stage.stageHeight / 2;

    var l:Loader = new Loader();
    l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
    l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
    l.load(new URLRequest(“MainMovieToLoad.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
    percent = null;
    stage.removeEventListener(Event.RESIZE, loaderResizeHandler);

    function loaderResizeHandler(event:Event):void {
    _midStageX = stage.stageWidth / 2;
    _midStageY = stage.stageHeight / 2;

    percent.x = _midStageX – (percent.width / 2);
    percent.y = _midStageY – (percent.height / 2);

  44. Very nice tutorial lee.

    I have two questions to ask you.
    The first one is about if i can have the preloader in scene one and the main project in scene 2 of the same fla.
    The second question i would like to ask you is about the below issue:
    I made a document with four layers. In the fourth layer (at the first frame), i have a mc container in which i load data from a mysql database through amfphp. Everything works fine, but i don’t know how to make a preloader for this container, in order while the user is waiting the loading of the data, the container to display smth (as an animation clip).
    Could you please help me ?

  45. Thanks for the excellent tutorial!
    My maincontent file contains external F4V files.
    Is there a way to get the preloader to preload those too?

  46. Hey guys!

    Yeh thnx Lee for the great tutes!!
    However, am having a similar problem to george (posted above). It’s very weird. When I test the movie (no simulation), it works all fine and the loaded SWf shows and everything, but when I simulate download, the loaded SWF doesn’t show… How can that be?… And when I upload and test online, it also doesn’t work. The “percent” text increases and you can see that the SWF is downloading but when it’s complete, it gets stuck there and the SWF doesn’t show (as if the “addChild” wasn’t working).

    any idea what’s happening? =[



  47. @KL:

    Your solution for “transfering” FlashVars to the loaded SWF does not work like so:

    function onDone(e:Event)
    var loadedSwf:* =;//or l.content
    loadedSwf.param = “someParam”;

    Use this code instead, it’s more universal also:

    for ( var prop:String in stage.loaderInfo.parameters ) {
    var loadedSwf:* = l.content;
    loadedSwf.loaderInfo.parameters[prop] = stage.loaderInfo.parameters[prop];

    Best regards,

  48. I could not get it to preload a swf that uses a document class.

    For example, copy the preload.swf into a folder containing Lee’s Carousel 10 example. Rename Carousel.swf to content.swf and try running preload.swf

    I get “TypeError: Error #1009: Cannot access a property or method of a null object reference. at Carousel()”

    I can’t quite tell, but I dont think this is related to the problem Marcus etc had (post 49 etc).

  49. So in summary, it seems to me that if you do one of the following three things, then its less hassle to just use Colin Mook’s all-in-one-swf method:

    1) Preload a swf that uses the document class.
    2) Pass FlashVars from the preloading swf to the main SWF.
    3) Access the stage from within the loaded swf. E.g. Reacting to stage resize.

    That’s me on all 3 counts, so I guess I have wasted the last 3 hours of my life. Sigh.

  50. @Jeff dePascale

    How are you getting the actual loaded movie to be displayed? This is the method I call to handle prequel on completion:

    function loaderDone(e:Event):void
    finishedLoad = true;
    var loadedObjects:Array = prequel.objects;

  51. Hi, same problem as #57 Fraser:
    The swf seems to be playing while beeing loaded (and not beeind added to the display list yet) and starts somewhere not on frame one.

    How to prevent that inside the preloader?

  52. This solution works just fine in the flash environment, when testing with Simulate Download, however it does not work when deployed to a web server….there’s a long wait while the main movie loads and you only see the pre-loader for a split second just before the main clip shows….
    …at least that’s how it is for me.

    so the conclusion I have come to is that you DO have to worry about library linkage being set to load on first frame…

  53. Lee
    your tutorial had helped a great deal previously i used to do the two frame method but this thing had saved my neck & my sanity and Boosted my confidence in working in Flash

    God Bless you
    :::: ThankYou :::

  54. Great stuff. Together with Kirks method in post 49 it helped me a lot, first by showing an easy and versatile way of preloading just about anything, and secondly (#49) by getting rid of any “null object” errors cased by trying to add stuff to a stage that is not there yet.

  55. thx lee, a great tut. makes a lot of sense.

    as for the repeated issues with error 1009 while trying to load file that access stage:
    add this in your loaded swf

    function onAddedToStage(evt:Event):void
    // Access the stage properties here
    trace (stage.stageWidth);
    trace (stage.stageHeight);
    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.align = StageAlign.TOP_LEFT;
    trace(“end of func”);

    thx nebutch

    its 2:05 night night

  56. Hi, Im just experimenting with as3 but I’m stuck on this preloader.
    I get it to work perfectly when I run it locally. It loads to a 100% and then loads the main swf. However when I upload this to the webserver the percentage jumps to ‘infinite’ instead. I dont understand why it should behave differently. Does anyone have a clue?

    var l:Loader = new Loader();
    l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
    l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
    l.load(new URLRequest(“index.swf”));
    var copy:String = ”;
    function loop(e:ProgressEvent):void
    var perc:Number = e.bytesLoaded / e.bytesTotal;
    var loadProg = Math.ceil(perc*100).toString();
    loader.width = loadProg * 5;

    percent.text = loadProg+’%’;

  57. plz reply lee
    i did all u said but i think my flash cs3 is set different to everyone
    else it says this to me when i press ctrl+Enter: Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.


  58. Hello Lee, great tutorial
    Im having the same issue as Fraser and ventu, while the external.swf is loading it also plays in the background, so I put a stop(); in the first frame of the external .swf. it would be nice if once the external file was loaded, the loader could do a gotoAndPlay into the loaded .swf

  59. got it:

    var l:Loader = new Loader();
    l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
    l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
    l.load(new URLRequest(“external.swf”));

    function loop(e:ProgressEvent):void {
    var perc:Number=e.bytesLoaded/e.bytesTotal;

    function done(event:Event):void {
    var loadedName:Object=event.currentTarget.content;

  60. Mold

    I had the same problem as you and posts #57 and #75.
    Thanks for your solution. You’re a legend.

    I understand the fix but I don’t understand why the problem occurs in the first place.

    Does anyone have any ideas why the external movie would start playing early? (i.e before the done() method fires) ?

  61. What is the best solution for this scenario:

    – loader.swf loads main.swf
    – main.swf also loads xml and images
    – you want to display the progress of main.swf xml and images into loader.swf progress bar.

  62. Hi, I’m having a similar problem to sean(post 81),
    It all works perfect locally, then when it on my webserver,
    it loads to 100%, a stops, Doesn’t move on to show the swf,

    any help would be much appreciated,

  63. I’m going to post the solution to my problem, just incase anyone has the same,

    My preloader.swf and content.swf are in the same folder, so I assumed when published in it’s html wrapper preloader.swf loading path would be from the same folder it’s in.

    However it actually take the path from where the swfObject is in the html,

    so instead of:
    l.load(new URLRequest(“content.swf”));

    l.load(new URLRequest(“assets/flash/content.swf”));

    hope this helps anyone who is as novice as i am,

  64. Hi, does anyone know if it’s possible to make a external preloader that loads the main content outside of the preloaded .swf file and has the main content in a completely separate file?

    I’m trying to achieve this because I’m want my flash preloader to load in a different div tag than my main content.

    PLEASE any help would be appreciated. Thanks in advance.


  65. This tutorial really helped, a lot! I was wondering how I could use this code and preload all the swf files on my site? I am putting together a web design portfolio now, so i could really use this on other site I am doing as well.

    Thank you!

    Thomas Bryant

  66. Add me to the list of people who think comment #49 kicks ass! I had a preloader that was showering me with 2068 and 1009 errors for days, but it works fine now. Thanks, Kirk!

  67. I am trying this preloader and when I export as swf it works fine and loads the swf but when I upload it to a webserver on firefox it just shows “100” and on IE it says Infinity and does not load in the external swf. Both the preloader and the external swf are on the webserver. I have tried seeing if it was due to case sensitivity or anything but nothing is working. HELP PLEASE

  68. I use this preloader quite a bit and have run into a bug. If you try to preload an .swf with a filename that contains more than one “-” it will fail. Example: “myMainFile.swf” and “my-MainFile.swf” work, but “my-Main-File.swf” does not. Try it out and see for yourself.

  69. I’m using this for preloading an swf with papervision in it. I keep getting:

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at something()

  70. Hello any body can help me please with this
    I’m using Lee’s preloader but I face a real problem

    my main content has a button in the first frame
    I call it (wright_btn)
    when u click on it, u suppose to go to next frame
    this is a part of the code in the first frame:

    wright_btn.addEventListener(MouseEvent.CLICK, wrightAnswer);
    function wrightAnswer(event:MouseEvent):void
    myScore.text= String(scoreValue+=5);

    var myYes:MovieClip = new YES();
    myYes.x = 275;
    myYes.y = 175;

    var myFlash:MovieClip = new ScoreFlash();
    myFlash.x = 71.5;
    myFlash.y = 26.05;


    it works perfectly

    but the problem is
    when the main content is loaded as an external swf
    the button doesn’t respond at all!

    what do I suppose to do?
    any idea ,please?

    I think that happened because the Scene has changed
    so I think I need a way to tell the flash to only play my main content not the preloader Scene content ..

    sorry for my weak English
    I’m French