hi guys,
i’ve seen this stunning transition effect of resizing a MC when a button is pressed. www.svizra.com. does someone know how this can be done? i’m totally curious about this effect!
thanks! lookupthere :pir:
hi guys,
i’ve seen this stunning transition effect of resizing a MC when a button is pressed. www.svizra.com. does someone know how this can be done? i’m totally curious about this effect!
thanks! lookupthere :pir:
This is just the thread I have been searching for.
Scotty, you helped me with my site that loaded in jpgs and it worked great. I just looked at the site that lookupthere has posted and i notice that instead of loading in jpg images, it looks as though it is loading in swf files because there are buttons within the pages.
I will look at the script in my fla’s that load in the jpg images I will see if it works with a .swf extension instead of .jpg
Thanks
in fact i shall post the script I have here and hope someone will recue me. As you will see I have replaced the jpg extension with swf but I notice other bits of script that refers to pics and loadpic. When i test my movie the first swf called one.swf does load in but the border doesnt work and none of the buttons work, So I feel this could work eventually with tweaking.
Anyway, here is the script on the timeline:
// array for your pictures
picArray = new Array();
picArray = [“one.swf”, “two.swf”, “three.swf”];
spacing = 5;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic) {
this._alpha = 0;
this.loadMovie(pic);
this._parent.onEnterFrame = function() {
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
var percent = Math.round((l/t)*100);
// added checking for height and width
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);
// set your loadbar width to 0 again
loadbar._xscale = 0;
delete this.onEnterFrame;
} else {
// show loadprogress
loadbar._xscale = percent;
}
};
};
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 checking for height in case the pic has the same width
// (statement would allwaybe true then)
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
containerMC._x = this._x-this._width/2+spacing/2;
containerMC._y = this._y-this._height/2+spacing/2;
// fade the pics in
containerMC._alpha += 5;
if (containerMC._alpha>95) {
containerMC._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
// amount is nr of buttons
var amount = 3;
// loop for your buttons
for (i=1; i<=amount; i++) {
but = this[“bt”+i];
but.i = i;
but.onRelease = function() {
containerMC.loadPic(picArray[this.i-1]);
};
}
// load the first picture in the array, change 0 if you want to start with another picture
containerMC.loadPic(picArray[0]);
stop();
Thank you. I wish I understood scripting
Do your swf’s have a solid (transparent) background?
Are you sure the instancenames/paths are right?
If so, post your .fla’s:)
scotty(-:
scotty, I didnt use a transparent background.
The first swf now loads in fine as the page opens, all thats wrong now is that the buttons dont work.
Here is the fla files - very simple stuff - this is just an experimental file
Thank you very much for your time and help.
There was a little mistake about the buttons. In the original code the instancenames were bt1, bt2, etc… Your instancenames are btn1, btn2, etc.
This is how code should be:
for (i=1; i<=amount; i++) {
but = this["btn"+i];//here you had ["bt"+i]
but.i = i;
but.onRelease = function() {
containerMC.loadPic(picArray[this.i-1]);
};
}
scotty(-:
Ah yes scotty. I’m so used to just automatically putting btn instead of bt
Thank you. It works perfect
welcome:thumb:
newbeeeeeee here ! Just got something similar to this. http://www.twinphotographie.com/
:: Copyright KIRUPA 2024 //--