?
Solved

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

Posted on 2006-07-14
4
Medium Priority
?
1,047 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 250 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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. …
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

743 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