Wednesday, 19 September 2012

Flash codeing


//*********BEGINNING STUFF**************/     = creates a movie clip called end screen, false means wont be seen intill this point,
endScreen.visible = false;



//**************VARIABLES**************/
var gameState:String;
                                                                                               Creates a string variable of characters , has no value



//**************INTRO SCREEN**************/                                            
introScreen.play_btn.addEventListener (MouseEvent.CLICK, clickAway);         
function clickAway (event:MouseEvent):void {
      moveScreenOff (introScreen);                                                            (
}
function moveScreenOff (screen:MovieClip):void {
      screen.x = (screen.width)*-1;
      gameState = "INITGAME";
      addEventListener (Event.ENTER_FRAME, gameLoop);
}


(intro is movieclip with mouseevent, play button, making it clickable called clickaway which is a mouseevent , the child play button which finds he function clickaway when it is clicked,

 function moveScreenOff- makes the movie clip move off screen

  screen.x - is the axis which it is on x,y = (screen width) *-1, the hole value moves off screen by the width of the screen)

gamestate - event.enter_frame, gameloop) creates an enterframe of which it will be a tempoary value = startplayer 



No comments:

Post a Comment