View Full Version : What am I doing wrong???
Suzs
January 13th, 2006, 05:06 PM
This is the site. http://drader1.sasktelwebsite.net/children.html
The pictures seem to not load in the box the first time they are clicked on but after that they work properly. I know it is probably something obvious but I am completly missing it. Here is the link for the code.
drader1.sasktelwebsite.net/child.fla
Any help is greatly appreciated! Thanks
Suzs
January 13th, 2006, 05:11 PM
K I admit to being really new to this but how do you post so that others can view the file?
Stratification
January 13th, 2006, 06:00 PM
I don't have time at the moment to look at the code, but it looks like you're trying to check the size before the pic is loaded (thus the second time after it's loaded it works.) So you need to be doing an onLoad for the movie and then test the size. You should also move the frame in front of the clip you're loading the pics into.
Suzs
January 13th, 2006, 07:37 PM
thanks so much I will try that!
Suzs
January 13th, 2006, 07:46 PM
So I found the code I need thanks to Scotty! But where do I put it? Sorry I am so clueless!
Suzs
January 14th, 2006, 01:28 PM
Here is the original code:
spacing = 10;
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 = 100;
delete this.onEnterFrame;
}
}
};
I relaced the top section with this of Scotty's
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 && containerMC._width != 0) {
var w = containerMC._width+spacing, h = containerMC._height+spacing;
border.resizeMe(w, h);
delete this.onEnterFrame;
}
};
};
But now when I look at the page online (http://drader1.sasktelwebsite.net/children3.html
it works on this computer but if I check it on my other computer not all of the pics work.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.