# \[F8\] Can not figure out how to maintain shape and position

**URL:** <https://forum.kirupa.com/t/f8-can-not-figure-out-how-to-maintain-shape-and-position/244765>\
**Category:** Uncategorized\
**Created:** [November 21, 2007, 3:55pm UTC](https://forum.kirupa.com/t/f8-can-not-figure-out-how-to-maintain-shape-and-position/244765 "2007-11-21T15:55:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![themoon201](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@themoon201](https://forum.kirupa.com/u/themoon201)\
**Post date:** [November 21, 2007, 3:55pm UTC](https://forum.kirupa.com/t/f8-can-not-figure-out-how-to-maintain-shape-and-position/244765/1 "2007-11-21T15:55:13Z")

</div>

I am at a loss as to what to do here. I do not pretend to be an expert in actionscript, in fact I pretty much suck at it. So please speak plainly to me.

I have 6 MC’s on the stage that act like buttons. When one is clicked each “button” moves to a particular location on screen, resizes, and rotates. That works fine. What doesn’t work then is when I re-click the same button or a different button they jump back to their original location/original size and then move to their new location and shrink back down to the size needed. I want the buttons to move from where they currently are and to whatever location specified when they are clicked. Also want them to maintain their shape unless I specify they need to grow or shrink.

Below is the code I have on the first frame of my time-line. And yes… if you can please show me how to shorten it because I’m sure this is way too long I would appreciate it. I’m guessing I have to use var and getProperty’s… but I don’t know how. ☹

```php

import flash.filters.GlowFilter; 
// glow settings color,alpha,blur x, blur y, strength, quality, inner, knockout 
var myGlowFilter = new GlowFilter (0xDEBB90,0.8,6,10,6,3,false,false); 

//Operation code 
    operationBtn.onRollOver = function() { 
        logo1.attachMovie ("01_operation_txt", "o", 1, {_x:200, _y:-150}); 
        operationBtn.filters = [myGlowFilter]; 
    } 
    operationBtn.onRollOut = function() { 
        logo1.o.removeMovieClip(); 
        operationBtn.filters = null; 
         operationBtn.filters = [myBevelFilter]; 
    } 
     
    operationBtn.onRelease = function() { 
        new mx.transitions.Tween (operationBtn, "_x",mx.transitions.easing.Strong.easeOut,operationBtn._x,80,80,false); 
        new mx.transitions.Tween (operationBtn, "_y",mx.transitions.easing.Elastic.easeOut,operationBtn._y,100,80,false); 
        new mx.transitions.Tween (operationBtn, "_rotation",mx.transitions.easing.Regular.easeOut,operationBtn._rotation,90,100,false); 
        new mx.transitions.Tween (operationBtn, "_xscale",mx.transitions.easing.Regular.easeOut,operationBtn._x,50,50,false); 
        new mx.transitions.Tween (operationBtn, "_yscale",mx.transitions.easing.Regular.easeOut,operationBtn._y,50,50,false); 
         
        new mx.transitions.Tween (programBtn, "_x",mx.transitions.easing.Strong.easeOut,programBtn._x,75,100,false); 
        new mx.transitions.Tween (programBtn, "_y",mx.transitions.easing.Bounce.easeOut,programBtn._y,390,100,false); 
        new mx.transitions.Tween (programBtn, "_rotation",mx.transitions.easing.Regular.easeOut,programBtn._rotation,31,100,false); 
        new mx.transitions.Tween (programBtn, "_xscale",mx.transitions.easing.Regular.easeOut,programBtn._x,30,50,false); 
        new mx.transitions.Tween (programBtn, "_yscale",mx.transitions.easing.Regular.easeOut,programBtn._y,30,50,false); 
         
        new mx.transitions.Tween (conceptualBtn, "_x",mx.transitions.easing.Strong.easeOut,conceptualBtn._x,130,100,false); 
        new mx.transitions.Tween (conceptualBtn, "_y",mx.transitions.easing.Bounce.easeOut,conceptualBtn._y,390,100,false); 
        new mx.transitions.Tween (conceptualBtn, "_rotation",mx.transitions.easing.Regular.easeOut,conceptualBtn._rotation,-29,100,false); 
        new mx.transitions.Tween (conceptualBtn, "_xscale",mx.transitions.easing.Regular.easeOut,conceptualBtn._x,30,50,false); 
        new mx.transitions.Tween (conceptualBtn, "_yscale",mx.transitions.easing.Regular.easeOut,conceptualBtn._y,30,50,false); 
         
        new mx.transitions.Tween (engineeringBtn, "_x",mx.transitions.easing.Strong.easeOut,engineeringBtn._x,185,100,false); 
        new mx.transitions.Tween (engineeringBtn, "_y",mx.transitions.easing.Bounce.easeOut,engineeringBtn._y,390,100,false); 
        new mx.transitions.Tween (engineeringBtn, "_rotation",mx.transitions.easing.Regular.easeOut,engineeringBtn._rotation,-89,100,false); 
        new mx.transitions.Tween (engineeringBtn, "_xscale",mx.transitions.easing.Regular.easeOut,engineeringBtn._x,30,50,false); 
        new mx.transitions.Tween (engineeringBtn, "_yscale",mx.transitions.easing.Regular.easeOut,engineeringBtn._y,30,50,false); 
         
        new mx.transitions.Tween (procurementBtn, "_x",mx.transitions.easing.Strong.easeOut,procurementBtn._x,240,100,false); 
        new mx.transitions.Tween (procurementBtn, "_y",mx.transitions.easing.Bounce.easeOut,procurementBtn._y,390,100,false); 
        new mx.transitions.Tween (procurementBtn, "_rotation",mx.transitions.easing.Regular.easeOut,procurementBtn._rotation,-150,100,false); 
        new mx.transitions.Tween (procurementBtn, "_xscale",mx.transitions.easing.Regular.easeOut,procurementBtn._x,30,50,false); 
        new mx.transitions.Tween (procurementBtn, "_yscale",mx.transitions.easing.Regular.easeOut,procurementBtn._y,30,50,false); 
         
        new mx.transitions.Tween (constructionBtn, "_x",mx.transitions.easing.Strong.easeOut,constructionBtn._x,295,100,false); 
        new mx.transitions.Tween (constructionBtn, "_y",mx.transitions.easing.Bounce.easeOut,constructionBtn._y,390,100,false); 
        new mx.transitions.Tween (constructionBtn, "_rotation",mx.transitions.easing.Regular.easeOut,constructionBtn._rotation,-210,100,false); 
        new mx.transitions.Tween (constructionBtn, "_xscale",mx.transitions.easing.Regular.easeOut,constructionBtn._x,30,50,false); 
        new mx.transitions.Tween (constructionBtn, "_yscale",mx.transitions.easing.Regular.easeOut,constructionBtn._y,30,50,false); 
         
    }  

```

btw… I have only included the script for the first “button”. Each “button” has it’s own huge chunk of code like this. I’ve just pasted the first one as I figure I can make the necessary changes to the others… unless you guys know how to shorten this? :cowboy:
