Solved

How to actionscript alpha fade in for graphic/mc in a scene

Posted on 2006-07-14
4
1,021 Views
Last Modified: 2012-06-27
Hi,

I am sure this is really easy I just can't get my head around it properly, all solutions I find are too complex.

I have different scenes, one image (at the moment as graphics, should maybe be MC) in each scene that I want to fade in. By using normal tween I get a flicker here and there and understand that if I use actionscript instead it should be smoother. So, what I need is

"at the beginning of this scene fade in item X and then stop." That's it. I just don't get what I write and where... ever so grateful for help!!

Thanks a million in advance,

Jzen
0
Comment
Question by:snowtrail
  • 2
4 Comments
 
LVL 23

Expert Comment

by:Zeffer
ID: 17106764
yes should be movieclips..more options for control .. and the flash player will thank you :)

made a sample for ya

www.redpearl.co.nz/ee/fadein_picture.zip

Z

0
 

Author Comment

by:snowtrail
ID: 17107071
That is great thanks, but I know how to do it the "create motion tween way", I would like to to it completely with actionscripting... I understand that will both make it smoother and the file size smaller? I'll do movieclips for sure - especially if it keeps the flash player happy...

Jzen
0
 
LVL 5

Accepted Solution

by:
lupuleine earned 125 total points
ID: 17109366
hi,

you could use something like this

easeType = mx.transitions.easing.None.easeNone; // ease type
var begin = 0;
var end = 100;
var frames = 20;
var mc = picture_mc; // the movieclip :)
var myTween = new mx.transitions.Tween(mc, "_alpha", easeType, begin, end, frames );

the Tween and all other trasition classes are undocumented ... but you can find some tutorials on the internet ... if you want more details

Lupuleine
0
 

Author Comment

by:snowtrail
ID: 17109614
Thanks, I'm sure that might help... I managed to find another solution though that works well

mc._alpha = 0;
mc.onEnterFrame = function() {
    if (this._alpha<100) {
        this._alpha++;
    } else {
        this._alpha = 100;
        delete this.onEnterFrame;
    }
};
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
YouTube Link 10 354
EMET 5.2 / Adobe Flash 2 229
How to convert image files to a movie file 6 108
Adobe Products Forum? 3 148
This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now