Results 1 to 7 of 7

Thread: Preloading External JPG

  1. #1
    Join Date
    May 2007
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Preloading External JPG

    I am trying to use the following tutorial for preloading external images into my gallery but in the example they don't explain how to get the actual preloader to work? I tried using the preload tutorial they recommended but I can't get it to work how I want.

    I would prefer something similar to exactly what they have in the example. A preloader that tweens both down and fades out and a fade in tween on the jpg that has been just loaded.

    I don't understand the trace command and what it is outputting to? In their example how is the load bar being targeted with that trace command?

    Here is the link:
    http://www.oman3d.com/tutorials/flash/moviecliploader/

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Well, basically you make a preloader. turn that into a movie clip all it's own. ten place it in the image movie you are making. Use the code to load the image and "turn on" the preloaderMC.

    trace is only for debugging and will never ever been seen in the finished project. When you are inside Flash and click "control">>"test movie" a little window will come up with errors and script miscues and anything in "trace" command. this is the only time you will see a trace executed.

    It is being targeted in this line:

    Code:
    preload.onLoadComplete = function(target){
    trace ("Finished Loading!");
    }
    This says: Movie Clip named "preload" are you done yet? "Yes I am done!" Okay, then we will show the text "Finished Loading!" in the debug window now.

    I can give you a few examples of how to do the animations, but I fear Medyman will come in and jump all over me because I like to tween and be in control of my movies instead of relying on code (kidding)
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by BLiZZaRD View Post
    I can give you a few examples of how to do the animations, but I fear Medyman will come in and jump all over me because I like to tween and be in control of my movies instead of relying on code (kidding)
    LOL.
    Don't be scared Blizzard. Feel free to post your examples.
    Timeline tweens just aren't my preferred way, that's all. Both ways work...both have their places/uses.

  4. #4
    Join Date
    May 2007
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I would appreciate an example. I still can not get the preloader to work properly, I created a preloader and made it into its own movieclip which also contains my image_loader empty movieclip. I also can not figure out how to alpha tween the image_loader movieclip to fade in once the .jpg has finished loading.

  5. #5
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    There are two amazing video tutorials on preloading at www.gotoandlearn.com, if you want to learn more.

    They might be of use.

  6. #6
    Join Date
    May 2007
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    After checking out the tutorial on preloading an external swf I still can not get my preloader to work correctly...

    My dynamic text box is not displaying at all?

    Code:
    var mcl:MovieClipLoader = new MovieClipLoader();
    
    var mclL:Object = new Object();
    
    mclL.onLoadProgress = function (target, loaded, total) {
    	loader.percent.text = Math.round((loaded/total) * 100) + "%";
    	loader.bar_mc._xscale = Math.round((loaded/total) * 100);
    }
    
    mclL.onLoadInit = function() {
    	loader._visible = false;
    	loader.percent.text = "";
    }
    
    mcl.addListener(mclL);
    
    loader._visible = true;
    mcl.loadClip("photos/weddings_big_1.jpg",img_container);
    I have all my instance names correct, but still nothing?

    Also I still need to figure out how to alpha tween fade in the jpg img once it has been loaded.

  7. #7
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    It's hard to diagnose the problem without the actual source files. At first glance, your code looks fine.

    My first guess as to why the dynamic text field is not showing up would be the font. Try embedding the font and see if that helps.

    For the alpha tween, use mcTween.

    Code:
    #include "mc_tween2.as"
    
    MC.alphaTo(alpha%, time in seconds, "linear")

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •