Saturday, 4 June 2016

MAIN CLASS AS3



--------------------------------------------------------------------------------------------------------------
1) MAKE FOLDER ON DESKTOP
2) SAVE FLASH AS3 FLA FILE AND CLASS IN THIS FOLDER
3)MAKE CLASS WITH PENCIL ICON AND TRACE VARIABLE
https://youtu.be/Ofm-bAGvIEk
https://www.youtube.com/watch?v=o-RY3TbCuJ0

IMPORT CLASS IN FRAME ACTION PANEL AS3 - YouTube

https://www.youtube.com/watch?v=sZef829wHEQ
8 Feb 2015 - Uploaded by SAVE MONEY
IMPORT CLASS IN FRAME ACTION PANEL AS3 FLASH CUSTOM ... Flash AS3 Form Components Tutorial ...

IMPORT CLASS FILE AS3 - YouTube

https://www.youtube.com/watch?v=o-RY3TbCuJ0
5 Jun 2016 - Uploaded by SAVE MONEY
IMPORT CLASS FILE AS3 ... Introduction to Actionscript 3 Classes in Flash - Part 1 of 2 (by Nils Millahn ...
--------------------------------------------------------------------------------------------------------------
CODE:
--------------------------------------------------------------------------------------------------------------

//AS3 CLASS CODE
package{
import flash.display.MovieClip;
public class MAIN extends MovieClip {
public function MAIN() {
var V0:Number = 100
trace(V0);
}
}
}
--------------------------------------------------------------------------------------------------------------
IMPORT CLASS FILE FROM PACKAGE FOLDER
https://www.youtube.com/watch?v=sZef829wHEQ
http://davidseah.com/2012/10/as3-and-flash-document-class/
http://www.slicepages.com/2012/07/creating-simple-class-actionscript-3/
--------------------------------------------------------------------------------------------------------------
IMPORT CLASS FILE FROM PACKAGE FOLDER

--------------------------------------------------------------------------------------------------------------
METHOD :1
JUST TYPE IN CLASS BOX
FOLDER.MAIN
---------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------
OR USE THIS METHOD
METHOD :2
IMAPORT PACKAGE FOLDER  CLASS FILE BY CODE
---------------------------------------------------------------------------------------------------------------

MAIN CLASS AS3

--------------------------------------------------------------------------------------------------------------- AS3 CLASS FILE CODE: --------------------------------------------------------------------------------------------------------------- //SAVE THIS FILE IN FOLDER AS A MAIN.as package FOLDER{ import flash.display.MovieClip; public class MAIN extends MovieClip{ public function MAIN(){ trace ('Hello World'); } } }
----------------------------------------------------------------------------------------------------------------------
OR USE THIS CODE FOR TRACE SIMPLE VARIABLE:
-----------------------------------------------------------------------------------------------------------------------

package FOLDER{ 
import flash.display.MovieClip; 
public class MAIN extends MovieClip{ 
public function MAIN(){ 
var V0:Number = 100
trace(V0);
}

}
----------------------------------------------------------------------------------------------------------------------
OR USE THIS CODE:
-----------------------------------------------------------------------------------------------------------------------
//SAVE THIS FILE IN FOLDER AS A MAIN.as
package FOLDER{ public class MAIN { trace ('Hello World'); } }

----------------------------------------------------------------------------------------------------------------------
OR USE THIS CODE FOR TRACE PUBLIC STATIC CONST VARIABLE:
-----------------------------------------------------------------------------------------------------------------------
package FOLDER{ public class MAIN { public static const V0:Number = 100; trace(V0); } }
---------------------------------------------------------------------------------------------------------------
CODE:
---------------------------------------------------------------------------------------------------------------
//FLA AS3 CODE
//HERE FOLDER FOLDER NAME
//HERE MAIN CLASS NAME
//http://davidseah.com/2012/10/as3-and-flash-document-class/
//http://www.slicepages.com/2012/07/creating-simple-class-actionscript-3/
import FOLDER.MAIN;
var Num1:MAIN = new MAIN();
-----------------------------------------------------------------------------------------------------------------
OR USE ASTERISK * SYMBOL METHOD TO CALL CLASS FILE
----------------------------------------------------------------------------------------------------------
HOW public static const TRACE IN APPLE CATCHING GAME AS3
-----------------------------------------------------------------------------------------------------------------

//SAVE THIS CODE IN MAIN.as IN FOLDER FOLDER
package FOLDER{
public class MAIN
public static const GRAVITY:Number = 3;
trace(GRAVITY);
}
}
-------------------------------------------------------------------------------------------------------------------
//FLA AS3 CODE
import FOLDER.*;
var Num1:Number;
Num1 = MAIN.GRAVITY;

-----------------------------------------------------------------------------------------------------------
OR USE THIS CODE:
-----------------------------------------------------------------------------------------------------------
//SAVE THIS CODE IN MAIN.as IN FOLDER FOLDER

package FOLDER{
public class MAIN
public static const ClassNum1:Number = 1;
trace("Public Static Const ClassNum1:" + ClassNum1);
//trace("Public Static Const ClassNum1 = " + "" + MAIN.ClassNum1);
}
}
-----------------------------------------------------------------------------------------------------------
//FLA AS3 CODE
import FOLDER.*;
var FlaNum1:Number;
FlaNum1 = MAIN.ClassNum1;
TextBox1.text = "Public Static Const ClassNum1 = " + "" + MAIN.ClassNum1 .toString();
-----------------------------------------------------------------------------------------------------------------
OR USE ASTERISK * SYMBOL METHOD TO CALL CLASS FILE
----------------------------------------------------------------------------------------------------------
HOW public static const TRACE IN APPLE CATCHING GAME AS3
http://flashcollege.blogspot.co.uk/2016/06/apple-catching-game-as3.html
-----------------------------------------------------------------------------------------------------------------

//SAVE THIS CODE IN C.as IN Game FOLDER
package Game{
public class C
public static const GRAVITY:Number = 3;
trace(GRAVITY);
}
}
-------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------
//FLA AS3 CODE

//HERE Game FOLDER NAME
//HERE CLASS NAME
import Game.*;
var gravity:Number;
gravity = C.GRAVITY;


-------------------------------------------------------------------------------------------------------------------











EmoticonEmoticon