Talk: Write with Sublime Text 2 ACTIONSCRIPT3

Source: Internet
Author: User

Sublime text This is the programmer's favorite editor, said under Win7 use Sublime text to write as files and compile and run the SWF.

  Preparation       1, Sublime Text 2     2, Java JDK (Jdk-8u31-windows-i586.exe official website download 32-bit latest version)      3, Flex SDK (flex_sdk_4.6)      4, Flash Player debug     ok, download Java JDK and install, configure JDK method very simple network has a lot of, configuration is OK, It's important to note that if the Flex SDK is 32-bit, then Java's JDK will also use 32-bit, and 64-bit will be identical, otherwise "cound not find a JVM" error will occur.       In the extracted Flex_sdk_4.6/bin folder there is a Jvm.config file, which corresponds to Mxmlc.exe. Modify the Java.home, the path is the location of the JDK where Java is installed, and note the direction of "/".    configuration MXMLC environment variable        new environment variable mxmlc_home, pointing to the path of Flex SDK. and add mxmlc_home to the system path variable.    after configuring the environment variable to save and run the cmd console, enter MXMLC carriage return to see if it is as successful, if not then check the environment configuration.    Sublime Text Install plug-in        Install plug-in step: ctrl+shift+p Open the plug-in installation list and enter the package Control:install package   then installs the plug-ins ActionScript 3 and plug-in converttoutf8   IV, creating sublime Text build file       tools->build System-a New Build system...   not write the information, save the file to the plug-in folder    here in order to make it easier for me to write a batch file, Executes sublime text in compiling asThe processing that occurs when a file is created. Continue creating a new Runflash.bat file in the above directory, write   @ECHO compiling%~nx1...... 

E:\flex_sdk_4.6\bin\mxmlc.exe%~nx1-debug

Start%~n1.swf ("-debug" is the record that logs log on is used to detect trace information) and writes in ActionScript 3.sublime-build file {
"cmd": ["C:\\Program Files (x86) \\Sublime Text 2\\data\\packages\\actionscript 3\\runflash.bat", "${file}"],
"Encoding": "GBK"
}  set Flex-config.xml, under the E:\flex_sdk_4.6\frameworks folder, put the XML inside <static-link-runtime-shared-libraries> false</static-link-runtime-shared-libraries> Change to <static-link-runtime-shared-libraries>true</ static-link-runtime-shared-libraries>  otherwise reported: Warning: This compilation unit does not contain the factoryclass specified in the Frame metadata and cannot load the configured runtime shared library. To compile without a run-time shared library, set the-static-link-runtime-shared-libraries option to true, or remove the-runtime-shared-libraries option.   Run swf       NOTE: Use UTF-8 encoding to save files when writing as files. Because trace prints in as in utf-8 encoded, so in order to avoid garbled, after installing the ConvertToUTF8 plugin, save the file to Utf-8 format.    Select Build System  ctrl+b Run the following file:    ok, so far, has been able to run successfully! If there is a problem with the code, the console prompts below.   See trace print information for ACTIONSCRIPT3      sublime text console does not display print information for Flash Player. So do you want to see if our print position is executed to change? Well, in fact, we can see a file under the C:\Users\Administrator\AppData\Roaming\Macromedia\Flash player\logs folder flashlog.txt  This file is the output of trace    Note: When the new flash starts, the Flashlog.txt file will be re-emptied! The content inside will be deleted. If a SWF is running, the Flashlog.txt file size is 0KB, and the message begins to print, FLASHLThe Og.txt file grows. Another SWF is running, when two SWF runs, the Flashlog.txt file will be emptied to 0KB, and two SWF's print information will be present in the Flashlog.txt file.   If you are playing a page tour, the SWF in the browser will also be shown here ...... 

Talk: Write ActionScript3 with Sublime Text 2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.