Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-26-2003, 09:08 PM   #1
Registered User
Join Date: Mar 2001
Posts: 166
Question actionscripted MC fade?

Hey All,
I want to make an MC's alpha fade from 100 to 0 using actionscript (instead of using in-betweens and keyframing it).... can someone help me out?

In my _root frame 1 actionscript, I used createEmptyMovieClip (to make an empty MC) and then attachMovie to attach an MC that I exported from my Library.
(The exported MC has a basic 10x10pixel graphic /* 0xFFFFFF */ inside.)

So i want to resize the exported MC to fit whatever the current Stage.width and Stage.height.
set its alpha to 100
then fade its alpha from 100 to 0 (so it looks like all of the elements in my movie are becoming visible or fading in)

I hope that makes more sense.. any help would be really appreciated.
Liquid is offline   Reply With Quote
Old 03-26-2003, 09:40 PM   #2
Registered User
Join Date: Jan 2003
Location: NYC
Posts: 58

Don't need to export a symbol at all. Try:

this.createEmptyMovieClip("fader", 1000);
fader.beginFill(0xFFFFFF, 100);
fader.lineTo(Stage.width, 0);
fader.lineTo(Stage.width, Stage.height);
fader.lineTo(0, Stage.height);
fader.onEnterFrame = function() {
	this._alpha -= 2;
	if (this._alpha <= 0) this.removeMovieClip();
* Note that the Stage properties might be erroneous in the testing environment, but will work when published*
tyard is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 01:25 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.