PDA

View Full Version : Dock menu



kafir
December 23rd, 2005, 05:11 AM
I have a dockmenu where I want to have different pictures presented instead of the graphic buttons. Could some one help we by telling the AS - take a look at the code in the attached file.

Thansk for your help in advance.

kafir
December 23rd, 2005, 05:18 AM
Here is the code.
So far i have a graphic icon which i loaded 15 time. I want the script to load pictures pic1, pic2, pic3, and os on.



align = bottom;
centerx = Stage.width/2;
centery = Stage.height/2;
menuholder = createEmptyMovieClip("menuholder", -1);
menuholder._y = centery;
menucount = 15;
menuitems = [];
miwidth = 20;
miborder = 1;
startx = centerx-((menucount-1)*(miwidth+miborder))/2;
trace(startx);
for (var i = 0; i<menucount; i++) {
var menuitem = menuholder.attachMovie("menuitem", "menu"+i, i);
menuitem._x = startx+i*(miwidth+miborder);
menuitem.id = i;
menuitem.onRollOver = function() {
_root.selected = this;
};
menuitems.push(menuitem);
}
onEnterFrame = function () { var width = 0;for (var i = 0; i<menucount; i++) {var xxm = menuitems[i]._xmouse;var yym = menuitems[i]._ymouse;var xm = Math.sqrt(xxm*xxm+yym*yym);if (xm<50) {menuitems[i]._xscale = menuitems[i]._yscale += ((200-xm)-menuitems[i]._yscale)/3;} else {menuitems[i]._xscale = menuitems[i]._yscale += (100-menuitems[i]._yscale)/3;}width += menuitems[i]._width;}width += (menucount-1)*miborder;var xpos = Math.round(centerx-width/2);for (var i = 0; i<menucount; i++) {xpos += menuitems[i-1]._width/2+miborder+menuitems[i]._width/2;menuitems[i]._x = xpos;}};

TheCanadian
December 23rd, 2005, 05:20 AM
You can use the loadMovie method to load external jpg's or swf's.

kafir
December 23rd, 2005, 05:23 AM
Ok, thanks but where would you insert that in the present code? how would you have the script load different pic according to the dock menu structure?