# Align center in actionscript

**URL:** <https://forum.kirupa.com/t/align-center-in-actionscript/289181>\
**Category:** Uncategorized\
**Created:** [May 27, 2009, 9:50am UTC](https://forum.kirupa.com/t/align-center-in-actionscript/289181 "2009-05-27T09:50:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahalo74](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@mahalo74](https://forum.kirupa.com/u/mahalo74)\
**Post date:** [May 27, 2009, 9:50am UTC](https://forum.kirupa.com/t/align-center-in-actionscript/289181/1 "2009-05-27T09:50:54Z")

</div>

Hey,  
I’m very new to actionscript and I’m wondering if anyone can help me out.  
I’m creating a menu like this one [http://actionscriptnotes.com/showcase/macmenu/Main.html](http://actionscriptnotes.com/showcase/macmenu/Main.html)

However I only have 5 icons so I need to align them center and also make the box behind smaller.

I attached the actionscript file (that came with the tutorial) and this is the actionscript from the fla file where I have my icons:

this.dockActions = function(label) {  
switch(label) {  
case ‘Preferences’:  
trace(‘This is how you open a URL in a new window.’);  
getURL(‘[http://aftonbladet.se/](http://aftonbladet.se/)’, ‘\_blank’);  
break;  
case ‘Blog’:  
trace(‘This is how you open a URL in a new window.’);  
getURL(‘[http://expressen.se/](http://expressen.se/)’, ‘\_blank’);  
break;  
case ‘Forum’:  
trace(‘This is how you open a URL in a new window.’);  
getURL(‘[http://webmind.se/](http://webmind.se/)’, ‘\_blank’);  
break;  
case ‘Shop’:  
trace(‘This is how you open a URL in a new window.’);  
getURL(‘[http://minaformer.se/](http://minaformer.se/)’, ‘\_blank’);  
break;

default:  
trace(‘This is how you open a URL in a new window.’);  
getURL(‘[http://google.com/](http://google.com/)’, ‘\_blank’);  
}  
}  
// Dock description  
var dockTemplate = {  
layout: 0, /\* top | right | bottom | left | _rotation_ \*/  
icon\_size: 156,  
icon\_min: 80,  
icon\_max: 156,  
icon\_spacing: 8,  
items: [  
{ id: ‘settings’, label: ‘Preferences’},  
{ id: ‘blog’, label: ‘Blog’ },  
{ id: ‘forum’,label: ‘Forum’ },  
{ id: ‘shop’, label: ‘Shop’ },  
{ id: ‘support’, label: ‘support’ },  
{ id: ‘search’, label: ‘Search Archives’ },  
{ id: ‘contact’, label: ‘Contact Us’ },  
{ id: ‘trash’, label: ‘Trash’ }  
],  
span: null,  
amplitude: null,  
callback: this.dockActions  
}  
this.attachMovie(‘Dock’, ‘menu\_mc’, 1, dockTemplate);  
this.menu\_mc.\_x = Stage.width / 2;  
this.menu\_mc.\_y = 232;

I appriciate all answers I can get.

Thanks
