Preload External Jpgs

What is the easiest way to preload external jpgs? The client
wants to update these frequently so they should be external, but I
want them to show up instantly like the rest of the site once the
preloading is done.
Any advice? I had thought about loading them into the
preloader (at 0% alpha), so that they'd be loaded into the cache
during preload, so that when the home page comes up, they'd be all
ready to go? But if it's a different instance of the movieclip,
will it reload the jpg? Or any time i use that external jpg in the
flash file will it already be in the cache?
Thanks. I've heard a few different things and would love your
advice.
Jeremy

There are two different things here. pre-caching (I don't
know what else to call it) and pre-loading.
It is possible to pre-cache files off the same server. If you
load into different instances then it should get it from the cache,
so yes that would speed things up. But... results are dependent on
an unknown factor: the user's cache settings. If its set to never
cache you could end up downloading 'to the cache' and just wasting
bandwidth.
You can read about that approach here.
http://www.actionscript.com/Article/tabid/54/ArticleID/Preloading-Files-into-the-Browser-s -Cache/Default.aspx
Then there's the regular preload approach where you preload
into movieclips (perhaps with ._visible=false or 0% ._alpha etc).
You can find a lot of info relevant to that here:
http://www.quip.net/blog/2007/flash/actionscript-20/tracking-multiple-files-part1
http://www.quip.net/blog/2007/flash/actionscript-20/tracking-multiple-files-part2

Similar Messages

  • Flash MX Preloader for external JPGs

    Hey all! Any help would be greatly appreciated. In all
    honesty, I have searched and studied and worked to get this myself,
    which I do alot with code, etc. BUT I am going to admit I'm a "make
    it pretty on the outside" kind of guy, and coding makes my eyeballs
    fall out and well, honestly, I just don't get it. My brain can not
    wrap itself around this. Sigh! So I could use your help a little.
    This is what I'm wanting to do. I have a website,
    www.luxeillustrato.com, and if you go to the portfolio area, and
    click on any of the sections (take fine art for example); it will
    showcase my works by loading external jpg files each time you click
    the forward arrow button.
    You can see I have preloaders on the site, that work fine. My
    main page has a movie target with the instance name of photoM. You
    click "artist", and it loads a new swf file into the photoM target.
    IF you click on "portfolio", "fine art", it loads the fine art swf
    file into photoM, using a preloader. THEN, if you click on the
    forward arrow button, a new jpg image of my work is loaded into the
    fine art movie target with the instance name of just
    photo. As you can see, you have to wait until the jpg image
    loads (and you start to wonder if it's doing anything.)
    The problem is, it is not preloading the external jpgs, it's
    just preloading the fine art swf. My preload code is currently:
    stop();
    onEnterFrame = function () {
    totalBytes = _parent.getBytesTotal();
    loadedBytes = _parent.getBytesLoaded();
    percent = Math.ceil((loadedBytes/totalBytes)*100);
    gotoAndStop(percent);
    info_txt.text = percent+" %";
    if (percent>=100) {
    _parent.gotoAndPlay("inter");
    I already have the preload animation bar created (as you can
    see on the site.) What do I need to do to alter the code above (or
    replace it) in order to have the external jpgs be preloaded as
    well? For example's sake, let's just say I have four jpgs, titled
    "door.jpg", "orange.jpg", "boyfriend.jpg", and "untitled.jpg" (in
    case these are needed for the code. They may not be.)
    I hope this is easy to understand. If NOT, just tell me. I'll
    simplify. And seriously, thanks!

    put a stop() on the first frame of your external swf in an otherwise empty first frame.  when preloading is complete apply a play() to your loader's content cast as a movieclip:
    function contentLoaded(evt:Event):void {
        //Optionally change to a clip holder and set progressbar visibility.
        addChild(contentLoader);
    MovieClip(contentLoader.content).play();

  • Preloader whilst loading external .jpg

    This is the script I use to load external .jpgs into a site
    btn1.onRelease = function (){
    loadMovie("Bike.jpg", _root.photo.empty);
    _root.stick.gotoAndStop(80);
    How would I create script so that it creates a sepaprate
    preloader whilst each image is loading.

    for something like this it's best to use the MovieClipLoader
    class, rather than loadMovie() - doing so will allow you to use the
    onLoadPrgress handler to update the preloader while it's being
    loaded. it would go something like this:

  • External JPG preloader

    Hey all! I could use any help you can give me pertaining to
    the need for an external JPG preloader.
    Check out my site at www.nathanaaron.com - go to
    menu/portfolio/print (for example.) As you can see as you scroll
    through the images, they take a bit of time to load, making you
    think nothing is happening. I have a preloader in the movie file;
    but it's calling external JPG files, so it is not preloading those.
    I'm a bit of a simpleton when it comes to actionscripting, so any
    help would be GREAT! And yes, I have searched and searched online,
    but just honestly can't understand what I'm trying to do here.
    Thanks!

    The overall preloader I'm using for loading the portfolio swf
    is:
    stop();
    onEnterFrame = function () {
    totalBytes = _parent.getBytesTotal();
    loadedBytes = _parent.getBytesLoaded();
    percent = Math.ceil((loadedBytes/totalBytes)*100);
    gotoAndStop(percent);
    info_txt.text = percent+" %";
    if (percent>=100) {
    _parent.gotoAndPlay("illus");
    But again, this doesn't load the external JPGS. The code I
    have that is loading the JPGS (one at a time) is:
    this.pathToPics = "";
    this.pArray = ["Port_SP_Illustration.jpg",
    "ILL_TPMC_Elf.jpg", "Ill_wine.swf", "Ill_red.jpg",
    "IL_art_cake.jpg", "Ill_satisfaction.swf", "Ill_mrproperty.jpg",
    "Ill_child.swf", "IL_art_asbig_fade.swf", "IL_art_asbig_02.jpg",
    "IL_art_asbig_03.jpg", "IL_art_asbig_04.jpg", "Ill_chorus.jpg",
    "Ill_baby.swf", "Ill_father.swf"];
    this.fadeSpeed = 10;
    this.pIndex = 0;
    loadMovie(this.pathToPics+this.pArray[0], _root.photo);
    MovieClip.prototype.changePhoto = function(d) {
    this.pIndex = (this.pIndex+d)%this.pArray.length;
    if (this.pIndex<0) {
    this.pIndex += this.pArray.length;
    this.onEnterFrame = fadeOut;
    MovieClip.prototype.fadeOut = function() {
    if (this.photo._alpha>this.fadeSpeed) {
    this.photo._alpha -= this.fadeSpeed;
    } else {
    this.loadPhoto();
    MovieClip.prototype.loadPhoto = function() {
    // specify the movieclip to load images into
    var p = _root.photo;
    p._alpha = 0;
    p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
    this.onEnterFrame = loadMeter;
    MovieClip.prototype.loadMeter = function() {
    var i, l, t;
    l = this.photo.getBytesLoaded();
    t = this.photo.getBytesTotal();
    if (t>0 && t == l) {
    this.onEnterFrame = fadeIn;
    } else {
    trace(l/t);
    MovieClip.prototype.fadeIn = function() {
    if (this.photo._alpha<100-this.fadeSpeed) {
    this.photo._alpha += this.fadeSpeed;
    } else {
    this.photo._alpha = 100;
    this.onEnterFrame = null;
    with the forward button coded as:
    on (release) {
    _root.changePhoto(1);
    (and back as:)
    on (release) {
    _root.changePhoto(-1);
    MY issue is, I know coders hate designers; because I know I
    could use the movie clip loader class; but you know, honestly, I
    start reading about class and listeners and my brain pops! I just
    don't get it. I'm good at tweaking code, but creating it is another
    story all together.

  • Load a  external jpg in BitmapData

    Hello Everybody,
    I search a way to load a external jpg from my server in my
    swf to use
    it with the BitmapData-Class.
    The Method loadBitmap only works with images from my internal
    library.
    What do you think is the best way to solve this problem.
    For me it seems to be a little bit stupid to load the image
    in a MovieClip.
    Then Scan the Mc to write it in a BitmapData-Object.
    To Filter it. And then write it back to an MC.
    Do you know a way, where I can load it directly to and
    BitmapData-Object
    like this:
    1) load Image in BitmapData-Object
    2) Filter - Image
    3) attachBitmap to MovieClip
    I am a noob with Flash 8 and my english is very bad.
    So sorry and thanks for you help
    jm

    //import BitmapData
    import flash.display.BitmapData;
    //stop movie so it doesn't repeat over and over
    stop();
    //load a pic into an mc on the stage
    content_mc.loadMovie("flash.jpg", 1);
    //create a function that runs every frame (only for this
    example, it keeps running and you won't want that
    _root.onEnterFrame = function() {
    //this is the interesting bit, basically the next line is
    your preloader 100% action, the pic has to actually have been fully
    loaded before we can do this
    if (_root.content_mc.getBytesLoaded() ==
    _root.content_mc.getBytesTotal()) {
    //create a variable to hold the bitmapdata info
    myBitmapData = new
    flash.display.BitmapData(content_mc._width, content_mc._height,
    true, 0x00FFFFFF);
    //copy the bitmap into the bitmapdata variable we just
    created
    myBitmapData.draw(_root.content_mc);
    //now attach it to a different mc for the sake of example
    _root.content_mc2.attachBitmap(myBitmapData, 1, "auto",
    true);
    //rotate both movieclips so you can see the difference
    _root.content_mc._rotation = 30;
    _root.content_mc2._rotation = 30;
    supplied by myFlash83

  • External jpg not loading when slideshow is live.

    When testing locally the slideshow works fine. When i upload
    the swf the external jpg do not show up. Anything graphic embedded
    in the swf shows up. The external jpg don't :/
    The jpgs are uploaded and all.
    i use different syntax that work ok when testing locally but
    no cigar when uploaded.
    I can send the simple fla and jpg upon request.
    Tks for your help

    are you using preloader code or the onLoadInit() method of
    the moviecliploader class to ensure your images are loaded before
    starting the countdown to the next image load?

  • Vista problem with loading external JPGs?

    I'm really pulling my hair out on this one. I did a quick
    flash piece for a preschool's web site and have tried several
    different Flash components inside of a larger FLA file that load
    external JPG files in a predefined area. With each component, I
    have received complaints (so far only from Vista users) that the
    user sees nothing in the area where photos are supposed to be
    loading. Instead they just see a white or black box.
    Is there any known issue with this? They can see everything
    else in the SWF file (the swinging girl and the text), but not any
    of the loaded JPG photos. Can anyone else out there with Vista tell
    me that they have the same problem? I'd like to track down what the
    common denominator is.
    I've asked two of the users to completely uninstall the Flash
    player and reinstall it, but to no avail. Deactivating Norton
    Antirvirus also didn't seem to do anything.
    Here is the URL:
    http://www.countryvillageps.com
    -- the flash item is the top banner.

    As Ned said the problem might be with the file structure on the server. Other problems may be with spelling. You computer may not be case sensitive to the names of the .swf files that you are loading, but your server might. So, on your computer when you are testing, second.swf is the same as Second.swf, or even second.SWF. But, on the server each of these variations is seen as a different file. Another problem is that when you are loading files from the same computer in testing, those files are close and so they load very quickly from your computer. When the files have to travel from the server, there will likely be a measurable period of time before the file is ready to be shown. This is particularly problematic with video that is embedded into an .swf. The whole file will need to be downloaded and uncompressed before it is available to play. If you stream the video as an external file, you can shorten the wait considerably.

  • Creating an Array of external JPGs, please help.

    So what I want to do is load up external JPGs into an Array of MovieClips, and then go to the main onEnterFrame function. My code is below:
    var imageLoader:Loader = new Loader();
    var imageArray:Array = new Array();
    function loadImage():void {
        for (i = 0; i < 9; i++) {
            imageLoader.load(new URLRequest("image" + String(i) + ".jpg"));   
            imageArray[i] = new MovieClip();
            imageArray[i].addChild(imageLoader);
        addEventListener(Event.ENTER_FRAME,onEnterFrame);
    I tried adding an Event.COMPLETE function I found:
    imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
    function imageLoaded(e:Event):void {
         var image:Bitmap = (Bitmap)(e.target.content);
         imageArray[i] = new MovieClip();
         imageArray[i].addChild(image);
    Unfortunately, I usually only ended up with 1 or 0 images, and errors. I can't seem to properly pass the i
    value, so that's a big problem because the order the images go is key to my program.
    Please help me get this working so my image gallery can work, thanks!

    So the problem is that you want them in the array in the same sequence am I right on this?
    See the updated code:
    var imageArray:Array = new Array();
    var imageLoader:Array = new Array();
    function loadImage():void {
        for (i = 0; i < 9; i++) {
            var imageLoader[i] = new Loader();
            imageArray[i] = new MovieClip();
            imageLoader.load(new URLRequest("image" + String(i) + ".jpg"));   
            imageArray[i].addChild(imageLoader[i]);
            //imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
        addEventListener(Event.ENTER_FRAME,onEnterFrame);
    /* function imageLoaded(e:Event):void {
         var image:Bitmap = (Bitmap)(e.target.content);
         imageArray[index].addChild(image);
    In this case you can not track whether an image is loaded or not. It is the most simplest way of doing this. If your images are not coming from dynamic sources and are fixed in number and position you can use this method also.

  • Need to load external jpgs at once

    I am using loadMovie to load all my external jpgs at once. On
    start I have thumbnails which animates, and using loadMovie load
    jpgs into that thumbnails. Offline it works fine, but online it
    only loads few jpgs first with animation and rest loads without
    animation just blink and loads. can you help me out for this.
    this is my sample page link:
    http://suewong.yourdemowebsite.com/editorial.htm

    Look at MovieClipLoader instead - images take time to load.
    You have to wait
    until your files have loaded before trying to use them - MCL
    is best for
    that, with its onLoadInit method.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Loading external JPGs

    I'm building a generic slideshow. The slideshow displays NINE
    buttons. Each button, when clicked, will load a corresponding
    external JPG. For example, if I click BUTTON THREE then JPG THREE
    is loaded. BUTTON TWO loads JPG TWO, etc.. I'm looking for a way to
    "recognize" if there are FEWER available JPGs than the NINE BUTTONS
    in my slideshow. For example, if I have just FIVE JPGs available
    and I click on button number SEVEN, I want nothing to happen. At
    the moment I get an error message that JPG SEVEN does not
    exist.

    that error message won't be seen outside the authoring
    environment. once you publish, pressing button 7 will result in
    nothing happening.

  • External jpgs

    I am building a webpage and have my dynamic text loading from
    a text file, it loads whwnever the page loads. I also have a jpg
    loading through a blank movie clip which currently loads only when
    the button is clicked, my button code looks like this:
    on (release) {
    about.loadMovie("about.jpg");
    How can I get this to load whenever the page loads, and still
    load it as an external jpg?

    Thanks guys I had tried some script on the same frame, but
    everything didn't load the same, maybe it was the way I did it. So
    after a while of playing around I think I got it.
    I put a blank movie clip on the stage, gave it an instamce
    name, then added a loader into the movie, which was fairly easy all
    I had to do was use the component inspector and put the jpgs name
    in. After that everything loaded pretty good. now if can only
    figure out how to make transitions work.

  • [Q] Loading one external JPG file into different MCs & Downloading

    Hi, I was wondering if I set few MCs to load the same
    external JPG file, would users need to download thme few times?
    Or only need to download once?
    I am having trouble loading long 700*8000 jpg files due to
    limited pixel size of 2300(?).
    I was thking of making them into 2000 * 2000 square pictures
    by cutting long picture into short sigments and putting them side
    by side.
    and using AS to make them appear as single long picture by
    using 2 MCs with same image but at different x position of loaded
    square Picture.
    Anyone have better idea?
    I am bit hesitated to make jpg to swf files cuz I have too
    many pictures
    Plz spare some time for me..
    Thank you for your time~!!!!

    thank you, kglad..
    I was thking of making 700 * 8000 image into 2800*2800 image
    this square picture works as four (700*2800) images.
    So that i can use 2 set of same jpg MC with differnt Masking
    to make them
    appears as continuously long images
    eg. 1st Mc will be showing _x: 0-700
    at the bottom of the first MC, 2nd MC will be showing _x:
    700-1400
    and so on so on..
    so..when user is scrolling down..these MCs will makeing
    sqaure image
    as long portrait image..
    I dont beleve myself it is a good solution..
    Probably most suitable way would be what you just suggested
    me..
    Its just that it will be quite a time consuming job to make
    jpgs into swfs...
    Thank you again for your kindness..:)

  • Linkage to external JPG-File does not work

    Hello,
    I am using Doc-To-Help as an authoring tool to create a JavaHelp target from an user manual written in WORD.
    When I try to create a link to an external JPG-image the image is not shown correctly when following the link.
    Instead of that I see a a lot of hieroglyphics. The image seems not to be interpreted as an image.
    When opening the created HTML-Files with the Internet Explorer the image is shown fine when clicking on the link.
    It seems to be a JavaHelp specific issue.
    Any thoughts?
    Thanks

    Hard to say.
    What's the encoding (standard/progressive)?
    Have you tried to see that image offline within a JLabel or some other Swing component, maybe it's swing related?
    Have you checked what Content-Type is actually set in the response when getting that JPEG?
    Bye.

  • Load external jpg

    I cannot load external jpg, they're not progresive.... the
    jpg files are inside a folder, and I write the next code:
    this.createEmptyMovieClip("mc", 100);
    mc.loadMovie("flash/photo1.jpg");
    but it doesn't work...
    Thanks

    use trace(mc) to confirm "this" refers to a movieclip, make
    sure there's nothing at a greater depth preventing you from seeing
    your image, double check your spelling of flash/photo1.jpg (and
    case counts) and make sure your html file is in a super folder of
    the flash folder, if you're testing in a browser.

  • Can you load external jpg files

    Is there a way to load external .jpg files on the fly or do
    they have to reside in the swf file?

    Hi Persons,
    macrofireball is correct as always, but I'll just add a
    thought to this thread because I suspect "rfull" isn't actually
    asking what he/she
    appears to be asking.
    No photo can ever be displayed "by itself". That is, image
    files are always "opened" in some sort of vehicle. It might be an
    image editor, or it might be a document like a *.DOC or a *.HTM ...
    but
    something must "contain" the image.
    So you can access a photo at any time you wish by putting it
    on a web page, then linking to the web page (for instance). Is
    something like that what you really had in mind?
    Have a good 'un folks!
    .

Maybe you are looking for

  • TS1702 When I add something to Notes and go back a few days later the info I put in is gone.  How do I save it??

    Can someone please help me with the above question.  Anything I input inot NOTES disappears after a day or so.  How can I save it?  I really need to use this app that came with my iPhone 4S

  • How do I 'uninstall' Firefox sync?

    I tried the Firefox sync today...not only did my smart phone NOT sync, but my computer internet has been frozen all afternoon! And now that its back, SUPER SLOW!!! I want to get rid of the sync now and go back to the Firefox I had this morning, but i

  • Software Apple MacBooK Air OS to install Tata Indicom Huawei Accees Manager

    I understand there are softwares available with Mac OS including that for MacBook Air which can help install Tata Indicom's Huawei Access Manager Data Card Only if that happens, one may use this data card to connect to the Internet Apprise me please

  • Mirror ipad mini

    Is there a way to mirror a ipad mini to a mac osx 10.9.1 without third party software ? Thanks.

  • IC Manager

    My Client is Implementing IC MANAGER POrtal. Can any help me in completing the pre - requisites for IC Manager from implemeting roles,authorizations and also the configuration needed in CRM. Thanks a Lot Amar Reddy