View Full Version : Problem with pop-up image script rollout
asfortech
09-22-2006, 07:25 AM
Hello all,
i'm helping a friend fix the pop up image script on this site:
www.humanited.nl
the pop up gallery is exactly what he wants, but the problem is the if you move your mouse too quickly over the pictures, the pictures will get stuck and not rollout. He customized a script from flashkit, popuppicturegallery.fla
This code is on an image.mc :
onClipEvent (load) {
xscale = 100;
yscale = 100;
sX = 0;
sY = 0;
multiplicator = .3;
ratio = .5;
this.swapDepths(2);
}
onClipEvent (enterFrame) {
if (!jump) {
sX = Number(sX*multiplicator)+Number((xscale-_xscale)*ratio);
sY = Number(sY*multiplicator)+Number((yscale-_yscale)*ratio);
_xscale += sX;
_yscale += sY;
}
}
and this code is on a button within the image.mc :
on (rollOver, dragOver) {
this.swapDepths(9);
xscale *= 10;
yscale *= 10;
gotoAndStop(2);
}
with various swapdepths for each picture. Thanks for any advice in advance.
Kenzilla
09-22-2006, 12:25 PM
Not what you're looking for, but try it out in a new flash movie and see if it's something you can use.
Place this code on an MC:
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
trace("within");
} else {
trace("not within");
}
}
The logo reminds me a little about Disturbed, www.disturbed1.com :)
asfortech
09-22-2006, 06:36 PM
so, you're suggesting that a trace whether the mouse is over or not? Thanks for the advice, but it seems like that will just constantly blurt "not within" into the output. It doesn't seem useful, unless you can tell me something i'm missing. I'm more or less looking for a piece of code that will just make sure that if the mouse is not over the button, then this picture will just stay rolledout. I'm at a loss as to how to do this. There's gotta be something simple i can do to make this script work... it's not that complicated of a script. I really can't understand why the rollout event is only functioning intermittently.. why it's not registering a rollout when you rollover it fast... ? Help... thanks
asfortech
09-23-2006, 10:53 AM
just to clarify...
sorry, i forgot to post that there is a rollOut. It's within the MC. Each MC has 2 frames with stop actions. On a Button layer, the first frame has
on (rollOver, dragOver) {
this.swapDepths(9);
xscale *= 10;
yscale *= 10;
gotoAndStop(2);
}
and the second frame has
on (rollOut, dragOut) {
this.swapDepths(1);
xscale = 100;
yscale = 100;
gotoAndStop(1);
}
take a look at the attachment:
popup_pi-david_wa-9682.zip (http://flash-forum.flashdevils.com/attachment.php?s=&postid=193019)
this is the original flashkit script that has the same problem... if you roll over the pictures too fast, the picture will get stuck..
oldnewbie
09-23-2006, 01:39 PM
This site uses the exact same script (except swapping to depth 5 rather than 9...), and I can't get it to stick on a rollout?
http://jamesbareham.com/index_content.html
asfortech
09-23-2006, 01:45 PM
yeah, i believe it's a problem with overlapping specifically.. because the original fla does overlap pictures, and so does the humanited site (only on rollOver). So, i'm thinking this problem is complexified by overlapping, perhaps in relation to swapdepths (which shouldn't be the case), perhaps not.
oldnewbie
09-23-2006, 02:51 PM
You mean the thumbnails' overlapping when scaling out?
asfortech
09-23-2006, 02:53 PM
yes, that what it seems like... if you test it on the site http://humanited.nl you'll see the the images scale properly, but if you move your mouse over the images fast, the rollOut may not function depending on whether their registration got overlapped (I believe)
Kenzilla
09-25-2006, 07:30 AM
so, you're suggesting that a trace whether the mouse is over or not? Thanks for the advice, but it seems like that will just constantly blurt "not within" into the output.
Not really, that was just a advice you could try to see if it worked, and then change the statements for you needs.
onClipEvent(load) {
_xscale = 100;
_yscale = 100;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_xscale = 150;
_yscale = 150;
} else {
_xscale = 100;
_yscale = 100;
}
}
asfortech
09-25-2006, 07:41 AM
Brilliant!!! It worked... You're a champ, and I'm sorry I doubted you... I'm still learning as well... Cheers.. :)
Kenzilla
09-25-2006, 07:53 AM
I'm still learning as well... Cheers.. :)
Same here :)
asfortech
09-25-2006, 08:00 AM
Yeah, sorry for doubting you because of the trace statements. I guess I had to see it implemented to really understand that it wasn't a test. It confused me, but now i'm happier than this guy ->>>:D
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.