# Help with "\_Alpha" tween code below

**URL:** <https://forum.kirupa.com/t/help-with--alpha-tween-code-below/223433>\
**Category:** Uncategorized\
**Created:** [April 22, 2007, 7:37pm UTC](https://forum.kirupa.com/t/help-with--alpha-tween-code-below/223433 "2007-04-22T19:37:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daveg92656](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@daveg92656](https://forum.kirupa.com/u/daveg92656)\
**Post date:** [April 22, 2007, 7:37pm UTC](https://forum.kirupa.com/t/help-with--alpha-tween-code-below/223433/1 "2007-04-22T19:37:00Z")

</div>

Using Flash 8;

Howdy All,

I have some code below which creates a background and buttons for a basic website. The site consists of 8 sections, with photos, text, etc.

I am trying to “\_Alpha” fade the entire page upon page Load. I want each page to have the “\_Alpha” effect. So I need a function or a correct call to place on each page’s code.

For some reason, my code below works for the entire page and one button, but the rest of the buttons, still show up instantly.

Notice a few lines below where I actually do my tween call, “//Alpha Ease-In”. I am using “this” for my tween, but I have tried “\_root”, and even each button “\_root.but1”, etc. but it still seems to give me partial results. Anyone know how to correctly tween the entire page upon load?

Any help please!! I know it can be done and I just have something screwed up! Please!

//StageSetup

//Imports  
import flash.geom._;  
import mx.transitions.Tween;  
import mx.transitions.easing._;

////////////stage  
stageWidth = Stage.width; //720  
stageHeight = Stage.height; //480  
//-----------------------

//create background Gradient  
wSize = Stage.width;  
hSize = Stage.height;  
fillType = “linear”;  
colors = [0x000000, 0xC8D0D4];  
//colors = [0x333333, 0xC8D0D4];  
alphas = [80, 80];  
ratios = [216, 255];  
matrix = {matrixType:“box”, x:0, y:0, w:wSize, h:hSize, r:90/180\*Math.PI};  
\_root.lineStyle(1, 0xFFFFFF, 0);  
\_root.beginGradientFill(fillType, colors, alphas, ratios, matrix);  
\_root.lineTo(stageWidth, 0);  
\_root.lineTo(stageWidth, stageHeight);  
\_root.lineTo(0, stageHeight);  
\_root.lineTo(0, 0);  
\_root.endFill();  
////////////////

//////////////////////////////////  
//Alpha Ease-In  
var AlphaTweenIn:Tween = new Tween(this, “\_alpha”, Strong.easeIn, 0, 100, 2, true);  
tween\_handler.onMotionFinished = function() {  
trace(“onMotionFinished triggered”);  
};  
///////////////--------------------------------------

/\*  
//\*\*box with DropFilter  
import flash.filters.DropShadowFilter;  
var art:MovieClip = createRectangle(420, 380, 0x666666, “gradientGlowFilterBG”);  
var distance:Number = 10;  
var angleInDegrees:Number = 60;  
var color:Number = 0x000000;  
var alpha:Number = .8;  
var blurX:Number = 12;  
var blurY:Number = 12;  
var strength:Number = 1;  
var quality:Number = 3;  
var inner:Boolean = false;  
var knockout:Boolean = false;  
var hideObject:Boolean = false;

var filter:DropShadowFilter = new DropShadowFilter(distance,  
angleInDegrees,  
color,  
alpha,  
blurX,  
blurY,  
strength,  
quality,  
inner,  
knockout,  
hideObject);  
var filterArray:Array = new Array();  
filterArray.push(filter);  
art.filters = filterArray;  
\*////////////////////////////////

//blue background  
var bgColorMC:MovieClip = createRectangle(720, 360, 0xB1C1C9, “bluebgMC”);  
bluebgMC.\_y = 70;

//Bounce  
//var xPosWin1:Tween = new Tween(gradientGlowFilterBG, “\_y”, Bounce.easeOut, -400, 80, 1, true);

/////Top Border  
drawRoundedRectangle(“rectangle\_mc”, 680, 12, 2, 0x444444, 100);  
\_root.rectangle\_mc.\_x = 20;  
\_root.rectangle\_mc.\_y = 26;

//////////////////Top Border Text  
//Container  
var headerTextHolder:MovieClip = \_root.createEmptyMovieClip(“headerTextMC”,\_root.getNextHighestDepth());  
//textfield  
var copyLabel:TextField = \_root.headerTextMC.createTextField(“copyLabel”, \_root.getNextHighestDepth(), 6, 2, 60, 30);  
copyLabel.text = “DentalCare”;  
copyLabel.border = True;  
copyLabel.selectable = false;  
copyLabel.html = true;  
copyLabel.autoSize = true;

var item1:TextFormat = new TextFormat();  
item1.color = 0xFFFFFF;  
item1.bold = True;  
item1.font = “tahoma”;  
item1.size = 18;  
copyLabel.setTextFormat(item1);

////////////////////// End Top Border Text

//////////////////Copyright TextField  
//Container  
var copyHolder:MovieClip = \_root.createEmptyMovieClip(“copyMC”,\_root.getNextHighestDepth());  
//textfield  
var copyLabel:TextField = \_root.copyMC.createTextField(“copyLabel”, \_root.getNextHighestDepth(), 480, 440, 60, 30);  
copyLabel.text = “Copyright @ 2006 DentalCare”;  
copyLabel.border = True;  
copyLabel.selectable = false;  
copyLabel.html = true;  
copyLabel.autoSize = true;

var item1:TextFormat = new TextFormat();  
item1.color = 0xFFFFFF;  
item1.bold = True;  
item1.font = “tahoma”;  
item1.size = 14;  
copyLabel.setTextFormat(item1);

////////////////////// End CopyRight

//////////////////phoneTextfield  
//Container  
var phoneHolder:MovieClip = \_root.createEmptyMovieClip(“phoneMC”,\_root.getNextHighestDepth());  
//textfield  
var copyLabel:TextField = \_root.phoneMC.createTextField(“copyLabel”, \_root.getNextHighestDepth(), 420, 4, 60, 30);  
copyLabel.text = “T:BBB-426-9111 |”;  
copyLabel.border = True;  
copyLabel.selectable = false;  
copyLabel.html = true;  
copyLabel.autoSize = true;

var item1:TextFormat = new TextFormat();  
item1.color = 0xFFFFFF;  
item1.bold = True;  
item1.font = “tahoma”;  
item1.size = 14;  
copyLabel.setTextFormat(item1);

////////////////////// End phone

//////////////////Email Textfield  
//Container  
var emailHolder:MovieClip = \_root.createEmptyMovieClip(“emailMC”,\_root.getNextHighestDepth());  
//textfield  
var copyLabel:TextField = \_root.emailMC.createTextField(“copyLabel”, \_root.getNextHighestDepth(), 536, 4, 60, 30);  
copyLabel.text = “E: [email@care.com](mailto:email@care.com)”;  
copyLabel.border = True;  
copyLabel.selectable = false;  
copyLabel.html = true;  
copyLabel.autoSize = true;

var item1:TextFormat = new TextFormat();  
item1.color = 0xFFFFFF;  
item1.bold = True;  
item1.font = “tahoma”;  
item1.size = 14;  
copyLabel.setTextFormat(item1);

emailMC.onRollOver = function() {  
var colorful = new Color(this);  
colorful.setRGB(0xD4D0C8);

```
var emailMCRO:TextFormat = new TextFormat();
emailMCRO.font = "tahoma";
emailMCRO.bold = True;
emailMCRO.size = 14;
emailMCRO.color = 0xFFFFFF;
emailMCRO.align = "left";
copyLbel.setTextFormat(emailMCRO);

```

}

emailMC.onRollOut = function() {  
var colorful = new Color(this);  
colorful.setRGB(0xFFFFFF);

```
var emailMCROut:TextFormat= new TextFormat();
emailMCROut.font = "tahoma";
emailMCROut.bold = False;
emailMCROut.size = 14;
copyLabel.setTextFormat(emailMCROut);	

```

}

emailMC.onRelease = function(){  
this.getURL(“mailto:dentist.com”, \_blank);  
} //end on(Release)

////////////////////// End phone

/////////////////////////////////////////////////////////////END PAGE

Thanks guys, Dave.
