# Quick test please

**URL:** https://forum.kirupa.com/t/quick-test-please/264799
**Category:** Uncategorized
**Created:** [June 30, 2008, 6:11pm UTC](https://forum.kirupa.com/t/quick-test-please/264799 "2008-06-30T18:11:43Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jibble](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jibble/32/2265_2.png) [@jibble](https://forum.kirupa.com/u/jibble)
#### Post date: [June 30, 2008, 6:11pm UTC](https://forum.kirupa.com/t/quick-test-please/264799/1 "2008-06-30T18:11:43Z")

</div>

check this out and let me know if it loads fast/slow or if you can get it to mess up. I know the initial screen is blank except for the buttons. Ideally the load will be little to nothing, a quick flash.

[[SIZE=7]LINK[/SIZE]](http://www.brainsqueezecreative.com/testfolder/main.html)

-edit-  
maybe i should explain a bit better. Its a full screen image test and im trying to see if it’s loading good/bad to others. Each image is ~80-100k

---

<div class="post-metadata">

### Author: ![pantas](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pantas](https://forum.kirupa.com/u/pantas)
#### Post date: [July 1, 2008, 4:21pm UTC](https://forum.kirupa.com/t/quick-test-please/264799/2 "2008-07-01T16:21:33Z")

</div>

not sure you’re in the correct forum…

it was fast

---

<div class="post-metadata">

### Author: ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)
#### Post date: [July 2, 2008, 8:35am UTC](https://forum.kirupa.com/t/quick-test-please/264799/3 "2008-07-02T08:35:09Z")

</div>

seems fairly quick, the 3rd image took a little longer

---

<div class="post-metadata">

### Author: ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)
#### Post date: [July 2, 2008, 9:53am UTC](https://forum.kirupa.com/t/quick-test-please/264799/4 "2008-07-02T09:53:18Z")

</div>

if this is an actual project, you might want to store the images as a BitmapData object after they’ve loaded once, so you dont need to reload them and see the preloader again, even though it’s just a glimpse, it’s not very attractive 🙂

---

<div class="post-metadata">

### Author: ![jibble](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jibble/32/2265_2.png) [@jibble](https://forum.kirupa.com/u/jibble)
#### Post date: [July 2, 2008, 4:48pm UTC](https://forum.kirupa.com/t/quick-test-please/264799/5 "2008-07-02T16:48:31Z")

</div>

ooOOOoo! good idea nathan. Any idea how i go about that? The current code is a bit different at this point.

Here it is…

```auto
stop();
#include "mc_tween2.as"
Stage.scaleMode ="noScale";
Stage.align = "LT";

import flash.display.*;

function loadBitmapSmoothed(url:String, target:MovieClip) {

    var bmc:MovieClip = target.createEmptyMovieClip(
        "bmc",
        target.getNextHighestDepth()
    );
    
    var listener:Object = new Object();
    listener.tmc = target;
    
    listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
        percent = Math.round((bytesLoaded/bytesTotal)*100);
        pText.text = percent+"%";
 
    }
    
    listener.onLoadInit = function(mc:MovieClip) {
        mc._visible = false;

        var bitmap:BitmapData = new BitmapData(
               mc._width,
            mc._height,
            true
        );

         this.tmc.attachBitmap(
            bitmap, 
            this.tmc.getNextHighestDepth(),
            "auto", 
            true
        );
         bitmap.draw(mc);        
         
        // set size and position on load
        if(Stage.height/Stage.width > target._height/target._width) {
            img_prop = target._width/target._height;
            target._height = Stage.height;
            target._width = Stage.height*img_prop;
            target._y = (Stage.height/2)-(target._height/2);
            target._x = (Stage.width/2)-(target._width/2);
        } else {
            img_prop = target._height/target._width;
            target._width = Stage.width;
            target._height = Stage.width*img_prop;
            target._y = (Stage.height/2)-(target._height/2);
            target._x = (Stage.width/2)-(target._width/2);
        }
    };
 
    var loader:MovieClipLoader = new MovieClipLoader();
    loader.addListener(listener);
    loader.loadClip(url, bmc);
}

loadBitmapSmoothed("images/bg4.jpg", bg_con);

btn1.onRelease = function(){
loadBitmapSmoothed("images/bg4.jpg", bg_con);
}
btn2.onRelease = function(){
loadBitmapSmoothed("images/bg5.jpg", bg_con);
}
btn3.onRelease = function(){
loadBitmapSmoothed("images/bg3.jpg", bg_con);
}

// set size and position on resize

var stage_listener:Object = new Object();

stage_listener.onResize = function():Void {
        if(Stage.height/Stage.width > bg_con._height/bg_con._width) {
            img_prop = bg_con._width/bg_con._height;
            bg_con._height = Stage.height;
            bg_con._width = Stage.height*img_prop;
            bg_con._y = (Stage.height/2)-(bg_con._height/2);
            bg_con._x = (Stage.width/2)-(bg_con._width/2);
        } else {
            img_prop = bg_con._height/bg_con._width;
            bg_con._width = Stage.width;
            bg_con._height = Stage.width*img_prop;
            bg_con._y = (Stage.height/2)-(bg_con._height/2);
            bg_con._x = (Stage.width/2)-(bg_con._width/2);
        }
}

Stage.addListener(stage_listener);

```

---

<div class="post-metadata">

### Author: ![gigaboost](https://avatars.discourse-cdn.com/v4/letter/g/58956e/32.png) [@gigaboost](https://forum.kirupa.com/u/gigaboost)
#### Post date: [July 2, 2008, 7:52pm UTC](https://forum.kirupa.com/t/quick-test-please/264799/6 "2008-07-02T19:52:51Z")

</div>

3-7 seconds load time on each image.

1-2 seconds before the preloader appeared, another 2-5 seconds before the image appeared. (after fading to complete white)
