Skip to main content
Participant
February 28, 2014
질문

After I select a movie from a button, how do I make the movie invisible after it plays?

  • February 28, 2014
  • 1 답변
  • 206 조회

I'm making a GUI that has three buttons on the stage.  The buttons may be selected at random.  Each button activates a short animation (movie clip).  The movie takes up the entire stage.  After the clip plays, I want it to disappear from the stage, allowing the user to select any other (or the same) button/movie clip.  So far I have this script.  There are no compiler errors nor any syntax errors.  However, it still dosn't do what I want.  What am I missing?  Thanks

movieOne_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);

function mouseDownHandler(event:MouseEvent):void
{
navigateTo.MovieOne.mc;
gotoAndPlay(1);
}
if (MovieOne.mc.complete)
{
gotoAndStop(15);
}

loader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfIn);
function swfIn(e:Event):void
{
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, swfIn);
mcExternal = loader.content = MovieClip;

MovieOne.mc.visible = false;
}

이 주제는 답변이 닫혔습니다.

1 답변

Ned Murphy
Legend
February 28, 2014

I don't know if the code you show is supposed to be trying to make the movieclip invisible, but it is doubtful it will if it is involved with that conditional you show.  How are the movieclips invisible to begin with?  If there is some frame that they sit at that makes them invisible, then when the movieclip reach the last frame you can tell it to go to that frame.  Otherwise, what you can probably do is put a command in the last frame of each movieclip that tells it to become invisible...

this.visible = false;