-
[F8] Newbie help. Best way to fade everything out?
Hi
What the most CPU efficient way to fade out everything (to black) on stage, just leaving some text?
I could select every movieclip/ object and use alpha keyframes.
Or fade in (using alpha) a black rectangle over everything, but I think this will be quite CPU intensive.
Is there a better way?
Many thanks
M
-
FK'n_dog
fading one black rectangle is more efficient than fading multiple objects
when the fade is complete, remove all objects from the stage ( blank frame )
to ease the CPU load,
hth
-
Thanks Modified Dog
I was afraid of that.
I quickly tried it and it eats CPU for afternoon snacks.
I was hoping there would be a more efficient way, maybe with actionscript?
How about if I turned down the brightness to -100% for each object/ mc?
Would that be more efficient than trying to do it with transparency?
Or tint 100% black?
Thanks
M
-
FK'n_dog
as long as all objects are movieclip instances, this method will set all clips to black -
Code:
Color.prototype.setBrightOffset = function(offset){
var trans = new Object();
trans.rb = trans.gb = trans.bb = offset;
this.setTransform(trans);
};
MovieClip.prototype.setBrightness = function(offset){
var c = new Color(this);
c.setBrightOffset(offset);
};
function Brightness(){
for(p in this)
if(typeof (this[p]) == "movieclip") this[p].setBrightness(-255);
};
b1.onRelease = function(){
Brightness();
}
-
Great, thanks for the code Modified Dog!
Will it fade over a certain a mount of frames, or just jump to black?
And is it more CPU efficient than keyframing tints/ brightness or alpha?
Many thanks!
M
-
FK'n_dog
that code will jump to black,
for a fade, try this code -
Code:
Color.prototype.setBrightOffset = function(offset){
var trans = new Object();
trans.rb = trans.gb = trans.bb = offset;
this.setTransform(trans);
};
MovieClip.prototype.setBrightness = function(offset){
var c = new Color(this);
c.setBrightOffset(offset);
};
function Brightness(val){
for(p in this)
if(typeof (this[p]) == "movieclip") this[p].setBrightness(val);
};
var iv = 0;
function fader(){
iv <= -255 ? clearInterval(fade) : iv -= 5;
trace("fading - "+iv);
Brightness(iv);
};
fade = setInterval(fader,100);
-
Hi Modified Dog
Great, thanks for the code!
M
-
FK'n_dog
you're welcome
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|