Hide Movieclip initially in Flash

Hide Movieclip initially in Flash

Page 1 of 1

2 Replies - 17578 Views - Last Post: 16 June 2009 - 03:05 PM

#1 bronya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-June 07

Hide Movieclip initially in Flash

Posted 18 June 2007 - 02:52 PM

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!!
Is This A Good Question/Topic? 0
  • +

Replies To: Hide Movieclip initially in Flash

#2 DilutedImage  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 14
  • View blog
  • Posts: 646
  • Joined: 20-November 06

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
Was This Post Helpful? 0
  • +
  • -

#3 DigitalMonk  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 16-June 09

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.

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
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1