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
system
July 12, 2004, 6:18pm
2
Are you cheking for height and width somewhere during the loading?
scotty(-:
system
July 12, 2004, 7:35pm
3
Yes I am. Check out the fla, I attached it
Sandman9
system
July 12, 2004, 7:47pm
4
Where? I only see a html page…
scotty(-:
system
July 12, 2004, 8:27pm
5
system
July 12, 2004, 8:32pm
6
no hard feelings;)
I’ll have a look.
scotty(-:
system
July 12, 2004, 8:40pm
7
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
system
July 12, 2004, 8:41pm
8
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(-:
system
July 12, 2004, 9:06pm
9
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(-:
system
July 12, 2004, 11:48pm
10
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
system
July 13, 2004, 8:33am
11
no problem:)
I’ve checked and it worked=)
scotty(-:
system
July 13, 2004, 5:34pm
12
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
Thanks
Sandman9
system
July 13, 2004, 5:54pm
13
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(-: