View Full Version : fading mc, with image inside it.
rtnylw
08-11-2008, 06:53 PM
I have image inside movie clip, both have white background. When I set mc alpha to 50, mc looks more faded that the image, I can see image's white background, it's only lightly transparent. Is there any way to prevent this? Thanks!
andrew444
08-12-2008, 05:49 PM
1. Nest the graphic in the MC and make sure it is converted to a symbol; either a Graphic symbol with its behavior as a Movie, or just converted to a MC.
2. Give the symbol an instance name within the parent MC.
3. Now you can adjust the _alpha settings (or any other property) with an event of your choice.
In the attached example, I have placed a button that when pressed, sets the alpha of the nested graphic to 50.
The code is placed on the button:
//mc1 is the parent MC.
//graphic is the nested object to be adjusted when the button is pressed.
on (press) {
_root.mc1.graphic._alpha = 50;
}
Hope this helps. :cool:
Andrew444
xdeath
08-16-2008, 12:39 AM
well you can change the value.
also andrew444 you should explain how to action make it fade out as in doing the animation in code instead of setting a value.
there are two ways of making the animation one you usde the tween funstion and use that to make your animation or you could make a custom function and do something like this:
/* this is my personal script i use for fading it works well and has two arguments.
1 is the instance name of movieclip your fading, and two is the speed that it will
fade out. now that is for action script 2.0 it should work in 3.0 but incase it doesn't
try removing the "_" part behind the alpha fuction.*/
MovieClip.prototype.fadeOut = function(target:MovieClip,fadeValue:Number){
this.onEnterFrame = function(){
target._alpha-=fadeValue;
if(target._alpha <= 0) {delete this.onEnterFrame;
gotoAndStop(4)}
}}
fadeOut(mCircle,6) // calls the function so it will work.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.