The Most Active and Friendliest
Affiliate Marketing Community Online!

“Adavice”/  “CPA

Tutorial>Advanced>AS to code tween...

crowebird

New Member
affiliate
Eariler I talked about using keyframes and tweens to change a objects size, color, alpha, etc. To make things simpler you can also use AS (or actionscript). Im going to talk about using AS to change the _alpha of an object.

°Create a circle and convert it to a movie clip. Name it whatever you would like. Now open up the actions for the circle. Add the following coding...

Code:
onClipEvent (load) {
rate = 10;
}
onClipEvent (enterFrame) {
if (_alpha>0) {
setProperty(this, _alpha, _alpha-rate);
} else {
_alpha(0);
}

When the movie is loaded this will make the _alpha decrease to 0% if it is not already at 0%

If you wanted the _alpha to increase to 100% if it was not already there you would add the following code...

Code:
onClipEvent (load) {
rate = 10;
}
onClipEvent (enterFrame) {
if (_alpha<100) {
setProperty(this, _alpha, _alpha+rate);
} else {
_alpha(100);
}
 
banners
Back