If i have small thumbnail pictures in a scene, if the user clicks on it, is it possible to enlarge and show
you can dynamically load it by changing the thumbnail into a button and putting this actionscript to the button:
on (press) {
_root.createEmptyMovieClip(“clip”, 0);
_root.clip.loadMovie(“your.jpg”);
_root.clip._y = 105.2;
_root.clip._x = 150.4;
_root.clip._xscale = 48.6;
_root.clip._yscale = 43.2;
}
The _y&_x position is changed on depending where you want it to load, also your scale would be for the size.
You also have to put the picture of the thumbnail into the same folder as where you saved your movie.
This is my first time helping anyone so I hope this helps.
Thanks a lot !!!
Let me try !!!
Its blows up, but how do i close that and go back to the thumbnail
please let me know
this fla is very similar to what you want except that the picture enlarges on mouse over. it also uses inertia fade. if you want it to enlarge on mouse click then it’ll be a little tougher…
if you don’t want to download the fla then just put this code in your actions layer in the main timeline…
[AS]maxscale = 300;
fadeSpeed = 4;
sizeChange = function () {
if (this.hitTest(_xmouse, _ymouse)) {
this._xscale = (this._xscale-(this._xscale-maxscale)/fadeSpeed);
this._yscale = (this._yscale-(this._yscale-maxscale)/fadeSpeed);
} else {
this._xscale = (this._xscale-(this._xscale-100)/fadeSpeed);
this._yscale = (this._yscale-(this._yscale-100)/fadeSpeed);
}
};
pic1.onEnterFrame = sizeChange;
pic2.onEnterFrame = sizeChange;
pic3.onEnterFrame = sizeChange;
[/AS]
and istead of pic1.onEnterFrame = sizeChange put your pictures name where ‘pic1’ is
hope that helped:)
the fla…
Thanks so much zylum !!!
It works well.
it works good for a single picture in a scene. I i need to have multiple pictures. It blows up couple of times for a single mouse over, any sugesstions
you mean something like this? (except a little more orginized;))
How did u attach the file in the forum
*Originally posted by baamtu *
**How did u attach the file in the forum **
i already showed you how :-\
This is how it looks
what exactly do you want to fix or what do you want the script to do?
during the mouse over the pictures blows up couple of times ( like jump). I just want to do only once.
And also during the page load , it blows up. I don’t want to do that.
Only during the mouse over , only once i would like to do
is the pic1 is the movie clip or just graphic in your example?
first, the pics seem to jump because you offset the origin so the MCs grow side ways which causes the mouse to be off the MC and the MC stops growing, secondly, they grow when the page loads because you resized the pic to 54% and in the script, it tells the pic to be 100% if the mouse is not ove the pic so the pic needs to be at 100% when it loads. laslty, i don’t understand what you meant in the last sentence, please be more clear. i gotta go for half an hour so please reply before i get back
thanks for your reply. I understood that resize problem. How do i change the offset.
the registration point of the movie clip should be in the center so that when the pic enlarges, it doesn’t slide to the left and leave the mouse.
I understood the problem
thanks a lot
Is there a way to tell , preserve the same size during load.
And blow up only on mouse over
just change the size of the pic before you import it therefore you wont have to resize in flash
If i chage the size ( ie if i mak eit small) and import it, when it blows up the picture looks pixalated
to solve this, change the size of the images to 200% before you import them to flash. then import them, hit CTRL+t and transform them to your desired size which will most likely be 50% because you made them twice the size before you imported them(make sure you transorm them to the same percent ie 50% and 50%) then change the else statement to reflect the new percent of the pictures. change the ‘100’ to the new percentage ie ‘50’
was:
[AS] } else {
this._xscale = (this._xscale-(this._xscale-[COLOR=red]100[/COLOR] )/fadeSpeed);
this._yscale = (this._yscale-(this._yscale-[COLOR=red]100[/COLOR] )/fadeSpeed);
}[/AS]
is:
[AS] } else {
this._xscale = (this._xscale-(this._xscale-[COLOR=red]50[/COLOR] )/fadeSpeed);
this._yscale = (this._yscale-(this._yscale-[COLOR=red]50[/COLOR] )/fadeSpeed);
}[/AS]
hope that helped