Monday, 2 February 2015

STAR RESTART GAME BUTTON AS2 AS3

STAR RESTART GAME BUTTON AS2 AS3

---------------------------------------------------------------------------------------------------------
COPY AND PASTE BELOW CODE AND FOLLOW METHOD

-------------------------------------------------------------------------------------------------------------
INSTANCE NAME FOR BUTTONS:
Start_btn , ReStart_btn 

Download Source
http://bit.ly/1Klg97z

READ MORE
https://www.youtube.com/watch?v=YZVwxKtkTlI
https://www.youtube.com/watch?v=ob4uqdqFndU
------------------------------------------------------------------------------------------------------------

//https://www.youtube.com/watch?v=ob4uqdqFndU
//MAKE TWO LAYER "CONTENT" & " STOP "
// MAKE STAR AND RESTAR BUTTON FOR CONTENT LAYER WITH TWO FRAMES
//AND GIVE INSTANCE NAME "Start_btn" "ReStart_btn"
// WRITE "STOP" IN STOP LAYER FRAME 1
stop();

//CONTNET LAYER FRAME NO:1 CODE
Start_btn.onPress = function() {
gotoAndStop(2)              
}
//CONTNET LAYER FRAME NO:2 CODE
ReStart_btn.onPress = function() {
gotoAndStop(1)
}

------------------------------------------------------------------------------------------------------------------
YOU CAN USE UPPER CODE FOR AS3 JUST CHANGE BUTTON FUNCTION
-----------------------------------------------------------------------------------------------------------------

//https://www.youtube.com/watch?v=ob4uqdqFndU
//MAKE TWO LAYER "CONTENT" & " STOP "
// MAKE STAR AND RESTAR BUTTON FOR CONTENT LAYER WITH TWO FRAMES
//AND GIVE INSTANCE NAME "Start_btn" "ReStart_btn"
// WRITE "STOP" IN STOP LAYER FRAME 1
stop();

//CONTNET LAYER FRAME NO:1 CODE

Start_btn.addEventListener(MouseEvent.CLICK, Start);
function Start(event:MouseEvent):void{
gotoAndStop(2)              
}
//CONTNET LAYER FRAME NO:2 CODE
ReStart_btn.addEventListener(MouseEvent.CLICK, ReStart);
function ReStart(event:MouseEvent):void{
gotoAndStop(1)
}


--------------------------------------------------------------------------------------------------------------
USE UPPER CODE AS3 WITH FRAME LABELS LAYER


----------------------------------------------------------------------------------------------------------------
COPY AND PASTE BELOW CODE AND FOLLOW METHOD
-----------------------------------------------------------------------------------------------------------------

//https://www.youtube.com/watch?v=ob4uqdqFndU
//MAKE TWO LAYER "CONTENT" & " STOP "
// MAKE STAR AND RESTAR BUTTON FOR CONTENT LAYER WITH TWO FRAMES
//AND GIVE INSTANCE NAME "Start_btn" "ReStart_btn"
// WRITE "STOP" IN STOP LAYER FRAME 1
stop();

//CONTNET LAYER FRAME NO:1 CODE

Start_btn.addEventListener(MouseEvent.CLICK, Start);
function Start(event:MouseEvent):void{
gotoAndStop("ReStart")              
}
//CONTNET LAYER FRAME NO:2 CODE
ReStart_btn.addEventListener(MouseEvent.CLICK, ReStart);
function ReStart(event:MouseEvent):void{
gotoAndStop("Start")
}








EmoticonEmoticon