Solved

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

Posted on 2006-07-14
4
1,009 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

762 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

21 Experts available now in Live!

Get 1:1 Help Now