JPG loads funny once on server

In the link below you will notice that when you single click on any of the images in the banner it loads the JPG funny. If you click it again then it loads it properly. Although in my fla file it works perfectly on first click. Anyone had a similar problem where files load funny once uploaded to a FTP?

I’ve attached my fla in case

http://www.etmarketingsolutions.com/testing/newsite/works1.html

Sandman9

Are you cheking for height and width somewhere during the loading?

scotty(-:

Yes I am. Check out the fla, I attached it

Sandman9

Where? I only see a html page…

scotty(-:

sorry

www.sandmanmedia.com/et3.fla.zip

no hard feelings;)
I’ll have a look.

scotty(-:

here’s the code


spacing = 5;
containerMC._alpha = 0;

MovieClip.prototype.loadPic = function(pic){
	_root.containerMC._alpha = 0;
	this.loadMovie(pic);
	_root.onEnterFrame = function(){
		var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
		if (t != 0 && Math.round(l/t) == 1){
			var w = containerMC._width + spacing, h = containerMC._height + spacing;
			border.resizeMe(w, h);
			delete _root.onEnterFrame;
		}
	}
};
MovieClip.prototype.resizeMe = function(w, h){
	var speed = 3;
	this.onEnterFrame = function(){
		this._width += (w - this._width)/speed;
		this._height += (h - this._height)/speed;
		if( Math.abs(this._width-w)<1){
			this._width = w;
			this._height = h;
			_root.containerMC._x = this._x - this._width/2 + spacing/2;
			_root.containerMC._y = this._y - this._height/2 + spacing/2;
                         _root.containerMC._alpha += 5;
			if(_root.containerMC._alpha>90){
			_root.containerMC._alpha = 100;
			
			delete this.onEnterFrame;
		}
	}
	}
};

It seems to be loading into the border MC for some reason

Sandman9

This should work:

spacing = 10;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic) {
	_root.containerMC._alpha = 0;
	this.loadMovie(pic);
	this._parent.onEnterFrame = function() {
		var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
		//added checking for width and height 
		if (t != 0 && Math.round(l/t) == 1 && containerMC._width>0 && containerMC._height>0) {
			var w = containerMC._width+spacing, h = containerMC._height+spacing;
			border.resizeMe(w, h);
			delete this.onEnterFrame;
		}
	};
};
MovieClip.prototype.resizeMe = function(w, h) {
	var speed = 3;
	this.onEnterFrame = function() {
		this._width += (w-this._width)/speed;
		this._height += (h-this._height)/speed;
		//added height here in case only the height differs
		if (Math.abs(this._width-w)<1 && Math.abs(this.height-h)<1) {
			this._width = w;
			this._height = h;
			_root.containerMC._x = this._x-this._width/2+spacing/2;
			_root.containerMC._y = this._y-this._height/2+spacing/2;
			_root.containerMC._alpha += 5;
			if (_root.containerMC._alpha>90) {
				_root.containerMC._alpha = 100;
				delete this.onEnterFrame;
			}
		}
	};
};

The lines below the commented lines have been changed:)

scotty(-:

Oops, a little typo:stunned:

if (Math.abs(this._width-w)<1 && Math.abs(this.height-h)<1) {

should be

if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {

scotty(-:

Scotty you are good!!! Do you mind emptying out your cache and double checking if what you did worked?

http://www.etmarketingsolutions.com/testing/newsite/works1.html

Thanks!!
Sandman9

no problem:)

I’ve checked and it worked=)

scotty(-:

Hey Scotty

Why did you change _root.onEnterFrame… to this._parent.onEnterFrame… when it’s already on the main timeline?

What you did worked but I’m just trying to understand it now :slight_smile:

Thanks
Sandman9

Out of habit:)
In the original code _root was used, but then people started loading the gallery in a main movie, so it had to be changed, cause it gave problems.

scotty(-: