How to run ActionScript in Sublime Text? - actionscript-3

I am using a package that provides multiple features for working with Actionscript 3 projects in Sublime Text 2. And while it's working perfect, I can't run the code in the Sublime Text.
I saw in some places that you need to go to Tools > Build System > choose your build (here would appear the action script).
But it doesn't appear, and I can't run the code, giving me the follow error :
No Build System
How can I make this work ?

Use the existing Action Script 3 package for Sublime Text, or create your own custom build system.
Example:
{
"selector": "source.actionscript",
"cmd": [
"mxmlc",
"${file}",
"-library-path+=${project_path}/libs",
"-output", "${project_path}/bin/${project_base_name}.swf",
"-debug=false",
"-static-link-runtime-shared-libraries=true"
],
"file_regex": "^(.+?)\\(([0-9]+)\\): col: (([0-9]+))(.*)$"
}
Make sure you got Adobe Flex SDK (or Apache Flex SDK) installed and that mxmlc is in your PATH environmental variable. Alternatively, you can provide its path in the build file (see the documentation for details).

Related

ExtendScript plugin for Webstorm or PhPstorm?

when scripting for after effects I often use ExtendScript.
There is an extendscript package available for sublime text out there.
https://sublime.wbond.net/packages/ExtendScript
(this makes it possible to run your script directly from sublime text into after effects)
I was wondering if there is also something like this out there for any JetBrains IDEs (like WebStorm or PhpStorm etc.). I do know it has several plugins in it, but i don't know if there was ever one made for Expendscript like the one for sublime text.
I'm not aware of any... Please see http://devnet.jetbrains.com/message/5496889#5496889 for some hints
To be able to run adobe scripts from WebStorm, you can use external tools (Settings/External tools):
create a new external tool
specify a full path to Adobe tool capable of executing .jsx ("C:\Program Files (x86)\Adobe\Adobe Photoshop CS5\Photoshop.exe", for example) as a 'Program'
add $FileName$ as parameters
set a working directory to $FileDir$
make sure to check Show in/Project views and Editor menu to be able to run your tool from file right-click menu in Project view/Editor
then you'll be able to run your tool from a right-click menu of your .jsx file - the file will be passed to Photoshop as an argument

Where is the module sublime_api?

Some ST2 plugins have references to module sublime_api in their Python files. I've found such text in several github.com projects.
What is this sublime_api module? Where can I see it and/or where does it come from? Maybe it's somehow sitting in memory only. What is background of this module, seems it's important for ST2 plugins.
So far I found info only about sublime and sublime_plugin modules.
sublime_api is hard-coded into the Sublime text executable - it's not a separate Python file. However, you can find an API reference on sublimetext.com (replace the 2 with a 3 in the URL for ST3) and a broader ST2 reference here contained within the "unofficial documentation", both with some info about the API.

Sublime - how to strip extension in build file?

I have the following build file for scss:
{
"cmd": ["C:/bin/ruby193/bin/ruby.exe", "C:/bin/ruby193/bin/sass", "$file", "$file.css", "--precision", "5"],
"selector": "source.scss"
}
Which works great for people who like building sass in sublime and outputs files of the format Home.scss.css. Some of our team however uses visual studio's mindscape workbench for compilation, which from a recent update doesn't honor custom conventions and always outputs Home.css.
How do I adjust my sublime build file so that it strips the extension and always outputs Home.css?
I've tried "$file".strip('.scss') but I guess the file isn't interpreted using the full python interpreter.
https://www.sublimetext.com/docs/3/build_systems.html
What you're searching for is $file_path\$file_base_name.css (or /).

How do I use phalcon-devtools\ide\phpstorm in phpstorm?

I am trying to integrate the Phalcon developer tools with phpstorm. There is a video here, but I am unable to view it due to my location.
I can't find any other usable reference in the documentation, how can I accomplish this?
Here are the steps.
Make sure you have the phalcon-devtools installed Instructions
Create a project using phalcon-devtools (unless you already have a project)
Launch PHPStorm and create the project there (unless you already did that).
Click File-Settings (Ctrl+Alt+S) (or PHPStorm-Preferences for Mac)
Click the second option "Command Line Tool Support"
Click the + icon and a new popup comes up. Make sure you have "Custom Framework" selected
In the new popup type:
Framework: Phalcon
Tool path: /Applications/MAMP/htdocs/phalcon-tools/ide/phpstorm/phalcon.sh
Alias: phalcon
Description: Phalcon Developer Tools
This assumes that your phalcon-tools have been installed under:
/Applications/MAMP/htdocs/phalcon-tools/
Also if you use a Windows environment, you should use phalcon.bat instead of phalcon.sh (see Tool Path line above)
Click Apply and then OK.
Click Tools - Run Command (Ctrl+Shift+X)
In the Commands output window, type:
phalcon commands
You should be able to see output. If there is an error check your path. Type any of the phalcon-tools commands to generate components for your project.
In PHPStorm you should see in the project explorer "External Libraries". Right mouse click and select "Configure PHP Include Paths"
In the new dialog click the + and navigate to the /Applications/MAMP/htdocs/phalcon-tools/ide/phpstorm/0.5.0 folder and click OK.
Now as you type code, the relevant helper popup will appear with all the relevant functions.
2012-09-07: There is a beta implementation of the Phalcon PHPStorm support for 0.5.0 here. In the upcoming weeks the code will become part of the framework and included with the 0.5.0 version.
I had some problems with the execution of the phalcon.bat file on my Windows Dev machine, no PHP installed, so i research a much simpler solution for phpstorm.
Simply do following:
click on "External Libraries"
click on "Configure PHP Includes Paths..."
click on add
add "phalcon-devtools\ide\[YOUR_VERSION_DIRECTORY]"
Than you have code completion for phalcon:-)
If you see the Phalcon module loaded in phpinfo page in your WAMP server, do the following to get loaded the module in CLI mode too.
Copy <WAMP INSTALATION >\bin\apache\<APACHE VERSION >\bin\php.ini to \bin\php\<PHP VERSION>\
Set php PATH to <WAMP INSTALATION>\bin\php\<PHP VERSION>\
That should solve the problem.
It has since been changed,
"As part of our restructuring and working towards a better more robust framework in terms of features as well as organization, we have removed the IDE stubs from the Phalcon DevTools repository and moved to its own repository."
The new instructions are located here:
https://blog.phalconphp.com/post/phalcon-ide-stubs-repository

"Definition mx.utils:Base64Encoder could not be found" in Flex Builder 3

I'm trying to edit an existing AS3 application (which was built using Flash Develop) in Flex Builder 3.
The application uses Base64Encoder (using "import mx.utils.Base64Encoder"). This compiles without problems in Flash Develop but trying to build it in Flex Builder 3 (Mac version) gives an error:
"Definition mx.utils:Base64Encoder could not be found"
Indeed when using code completion (ctrl + space) in flex, on "import mx.utils." only 4 utils are shown in the list.
I've tried this using the Flex 3.2.0 sdk that came with Flex Builder 3 and the Flex 3.5.0 sdk which I downloaded from the adobe website.
Does anyone know why this might be? and how I could resolve this?
Thanks.
I've fixed this by adding 'framework.swc' to my library build path.
Instructions:
Right-click project and select 'properties'
Select Actionscript Build Path
Select 'Library Path' tab
Click 'Add SWC...' button
Enter [path to your sdk]/frameworks/libs/framework.swc
Click 'OK' to add swc
Click 'OK' to close properties
Re-build your project
You need to include [SDK]/frameworks/libs/rpc.swc file from Flex SDK
It's probably borrowed from the Flash class lib rather than the Flex one. There are plenty of base64 implementations out there that you could substitute.