PDA

View Full Version : Mac OSX icon dock in Flash



Aneurin, Mark II
August 23rd, 2005, 05:24 PM
I know it's been done already, but I want to use a similar idea to that icon dock in Flash as my site navigation bar. My script for resizing items thus far:


onClipEvent (load) {
// Minimum and maximum scale (in percent) for this item
maxSize = 100;
minSize = 50;
// Speed of rescaling
scalespeed = 5;
// Set offset - the distance from which the object starts to grow
xoffset = 100;
}
onClipEvent (enterFrame) {
// Scale setting - don't mess with this! :P
if (_x>_parent._xmouse) {
scale = _parent._xmouse+xoffset+(-_x);
} else {
scale = _x+(xoffset-_parent._xmouse);
}
// Limiting to maximum size
if (scale>maxSize) {
scale = maxSize;
}
// Limiting to minimum size
if (scale<minSize) {
scale = minSize;
}
// resizing
_xscale += (scale-_xscale)/scalespeed;
_yscale = _xscale;
}

The FLA is attached... not that this is meant to be of any interest to anybody, I just want a backup in case I mess it up really. :)

deletedUser459
August 23rd, 2005, 06:09 PM
very nice!

electrikmonk
August 23rd, 2005, 06:27 PM
i've considered this before, but i have no real time unless it's billable. i want to check it out though.

kirupa
August 23rd, 2005, 06:41 PM
Hehe, I was about to create something similar! In the real OS X dock, don't the icons actually shift over to make room for the larger, hovered-over icons?

electrikmonk
August 23rd, 2005, 06:43 PM
yep

Aneurin, Mark II
August 23rd, 2005, 08:57 PM
Hehe, I was about to create something similar! In the real OS X dock, don't the icons actually shift over to make room for the larger, hovered-over icons?

Yeah, they do actually. I've decided only to use the "grow/shrink" script on my toolbar for now, with a rollover/out fade (you can see it under construction at my site (http://am-2.meinman.com/index.php)) although I think I'll have a crack at tweaking it to work like a proper icon dock. :)

I said it's been done already; here's a link (http://jrgraphix.net/research/flash-dock-mx-2004.php). Pretty good, that. I'm only trying to write my own as part of the learning process. ;)

mucho
August 24th, 2005, 09:51 AM
good job... very well done.

tpspoons
August 24th, 2005, 12:36 PM
http://laco.wz.cz/tween/?page=examples
second one down.