Hi,
Can anyone tell me please how to do the following using actionscript:
I want a movie clip to be initially invisiable, then at the click of a button appear. I know how to program the button to make it appear, but dont know how to make the clip invisible beforehand!! I would also like to know how to control alpha fade through actionscript.
Any help welcome!
Thanks!!
Hide Movieclip initially in FlashHide Movieclip initially in Flash
Page 1 of 1
2 Replies - 16557 Views - Last Post: 16 June 2009 - 03:05 PM
Replies To: Hide Movieclip initially in Flash
#2
Re: Hide Movieclip initially in Flash
Posted 18 June 2007 - 08:27 PM
AS2: movieClipName._visibility = false;
AS3: movieClipName.visibility = false;
AS2: movieClipName._alpha = 92; // value between 0 and 100
AS3: movieClipName.alpha = .92; // value between 0 and 1
AS3: movieClipName.visibility = false;
AS2: movieClipName._alpha = 92; // value between 0 and 100
AS3: movieClipName.alpha = .92; // value between 0 and 1
#3
Re: Hide Movieclip initially in Flash
Posted 16 June 2009 - 03:05 PM
Working on a similar quest...
The fading works for me (NUMPAD_5) is my trigger in the code below... easily converted to a mouse event. Note that I do not use the easing parameter in the TransitionManager code line.
Let me know if you find the trick to hiding a movieclip when the movie starts. If you manually set the alpha to 0% it overrides the transition code. The transition still works, but the movieclip is hidden.
Good luck
The fading works for me (NUMPAD_5) is my trigger in the code below... easily converted to a mouse event. Note that I do not use the easing parameter in the TransitionManager code line.
Let me know if you find the trick to hiding a movieclip when the movie starts. If you manually set the alpha to 0% it overrides the transition code. The transition still works, but the movieclip is hidden.
Mouse.hide();
var a:int = 0;
import fl.transitions.*;
import fl.transitions.easing.*;
function fadeIn() {
TransitionManager.start(br_mc, {type:Fade, direction:Transition.IN, duration: 2});
trace("fadeIn");
}
function fadeOut() {
TransitionManager.start(br_mc, {type:Fade, direction:Transition.OUT, duration: 2});
trace("fadeOut");
}
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyStroke);
function keyStroke(event:KeyboardEvent):void {
if (event.keyCode == Keyboard.NUMPAD_5 && a == 0) {
trace("5 press in");
fadeIn();
a = 10;
} else if (event.keyCode == Keyboard.NUMPAD_5 && a == 10) {
trace("5 press out");
fadeOut();
a = 0;
}
}
Good luck
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|