Solved

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

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SWF won't scale? 4 528
IE 11 Flash Player issue 7 244
Converting an Adobe Flash file from Actionscript 2.0 to Actionscript 3.0 in Adobe Flash CC 3 974
Running Mp4 or Flash Video 1 128
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. …
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

821 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