# Help adding Buttons \[ AS 2 \]

**URL:** <https://forum.kirupa.com/t/help-adding-buttons-as-2/293980>\
**Category:** flash\
**Created:** [August 6, 2009, 12:06pm UTC](https://forum.kirupa.com/t/help-adding-buttons-as-2/293980 "2009-08-06T12:06:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eqwan](https://avatars.discourse-cdn.com/v4/letter/e/e19b73/32.png) [@eqwan](https://forum.kirupa.com/u/eqwan)\
**Post date:** [August 6, 2009, 12:06pm UTC](https://forum.kirupa.com/t/help-adding-buttons-as-2/293980/1 "2009-08-06T12:06:59Z")

</div>

How do I add a like e.g get URL or load movie without losing animation

I added this to test but it stops the animation

but1.onRelease = function(){  
getURL(“javascript:alert(‘you clicked me’)”);  
};

// This Class is required from www.laco.wz //  
#include “lmc\_tween.as”  
but1.bodyText = “Immigration Law”;  
but2.bodyText = “Employment Law”;  
but3.bodyText = “Property Law”;  
but4.bodyText = “Family Law”;  
but5.bodyText = “Corporate Law”;  
but6.bodyText = “Commercial Law”;  
but7.bodyText = “Oil & Gas Law”;  
but8.bodyText = “Tenancy Law”;  
but9.bodyText = “Criminal Law”;  
but5.bodyText = “Contact Us”;

this is contained inside the button

* * *

// Set parameters here //  
var rotateMax = 3  
var effectSpeed = 0.5;  
var offsetSpeed = 0.8;  
var textXChange = 10;  
var textBrightChange = -5;  
// Code you can modify /  
var textX = \_parent.textBox.\_x;  
var maxText = textX+textXChange;  
var textBright = textBrightChange;  
var boxMaxX = this.\_xscale;  
var boxMinX = boxMaxX-5;  
var boxMaxBright = 0;  
var boxMinBright = -15;  
var butSize = boxMaxX-30;  
\_parent.textBox.\_visible = false;  
this.\_xscale = butSize;  
this.\_alpha = 0;  
this.tween("\_xscale", boxMaxX, 3, “easeInOut”, 1);  
this.alphaTo(100, 2, “easeIn”, 1, onEnd);  
function onEnd() {  
\_parent.textBox.\_visible = true;  
}  
but.onRollOver = function() {  
this.rotateTo(rotateMax, 2, “easeInOut”);  
\_parent.textBox.rotateTo(rotateMax, 2, “easeInOut”);  
\_parent.textBox.tween("\_x", maxText, effectSpeed, “easeOut”);  
\_parent.textBox.brightnessTo(textBright, effectSpeed, “easeInOut”);  
this.tween("\_xscale", boxMinX, effectSpeed, “easeOut”);  
this.brightnessTo(boxMinBright, effectSpeed, “easeInOut”);  
};  
but.onRollOut = function() {  
this.rotateTo(0, 2, “easeOutElastic”);  
\_parent.textBox.rotateTo(0, 2, “easeInOut”);  
\_parent.textBox.brightnessTo(0, effectSpeed, “easeInOut”);  
\_parent.textBox.tween("\_x", textX, effectSpeed, “easeOut”);  
this.brightnessTo(boxMaxBright, effectSpeed, “easeInOut”);  
this.tween("\_xscale", boxMaxX, offsetSpeed, “easeOutElastic”);

};

file link

> **[MediaFire](https://www.mediafire.com/?sharekey=a1f5f54d12dd35571f8e0fff488e27e0e04e75f6e8ebb871)**
>
> MediaFire is a simple to use free service that lets you put all your photos, documents, music, and video in a single place so you can access them anywhere and share them everywhere.

thanks
