Problem 1) your if statments are a bit wrong. if (_root.picsize = 0) should be if (_root.picsize <B>==</B> 0).
= sets a value to something
== checks to see if the value is equal to something. returns a boolean value of true or false.
Nextup… You are looking for a variable called picsize, that is defined on the _root. I personally couldn’t find that variable, and the variable needs to be defined to be checked.
Since you are using a movie clip for a button you can define the variable inside the button.
[AS]onClipEvent(load){
picsize = 0;
}[/AS]
And then in the rest of the script you could change _root.picsize to just picsize.
And lastly, your targeting is wrong. You target as this.zoomer, but then that is looking for a clip called zoomer that is INSIDE of your movieclip button. Instead it should just be this.gotoAndStop(1).
That leaves us with…
[AS]onClipEvent (load) {
picsize = 0;
}
on (press) {
if (picsize == 0) {
this.gotoAndStop(2);
picsize = 1;
} else if (picsize == 1) {
this.gotoAndStop(1);
picsize = 0;
}
}[/AS]
As for easing. Check the easing the tutorials on this site. Although those tutorials are for easing motion, you can change the property to _width and _height or _xscale and _yscale and it will work.
Just make sure the endX and endY variables are the final width and height you want your clip to be (you may understand if you read the tutorials)
here’s the script incase you don’t want to download the file
this.createEmptyMovieClip("preloader", 1000);
this.createEmptyMovieClip("container", 1001);
if (_root.picsize == 0){
with (container) {
unloadMovie (_root.picture);
loadMovie(_root.picture);
_x = 225;
_y = -46;
_xscale = 25;
_yscale = 25;
_visible = false;
}
if (_root.picsize == 1) {
with (container) {
unloadMovie (_root.picture);
loadMovie(_root.picture);
_x = 20;
_y = 20;
_xscale = 100;
_yscale = 100;
_visible = false;
}
}
}
preloader.onEnterFrame = function() {
var l = container.getBytesLoaded();
var t = container.getBytesTotal();
var getPercent = l/t;
loadText = Math.round(getPercent*100)+"%";
loadBar._width = getPercent*160.5;
if (l>0 && l>=t) {
container._visible = 1;
delete loadText;
loadBar._visible = 0;
delete this.onEnterFrame;
}
}
as for the easing, i’ve read and understand (i think) those tutorials but i don’t understand how to apply them to this funciton that checks for a 0 or 1 value and then performs an action based on that value
how do i move it too … b/c when it scales, it does so from the center and then it will scale outside the bounds of the move so i will need to move it to different x, y coords … can i put those in the function too?
i’m going to go try to apply this to my container clip so it will scale the loaded graphic using the bottom right corner as it’s anchor point