Cammm
New Member
- Nov 18, 2018
- 18
- 10
Prerequisites:
IntelliJ (Community but preferably Ultimate)
FlexSDK
Open Source SWF.
Downloads:
Okay, so for starters, you want to open your Open Source SWF inside of IntelliJ as an existing project, like so:
I recommend downloading the version by Harmonic due to it containing the compiler, which is essential for well.. compiling your SWF.
Once you open the project and it has fully loaded, it should look something like this:
So, we actually want to completely ignore this, and go straight to IntelliJ preferences (This can be done with CMD + , on macOS and CTRL + , on windows):
You then want to Open the Tools submenu, and then click on External Tools. This is where you will be setting up your compiler.
Upon Clicking the + you will be greeted with this screen:
You want to fill out these fields as follows:
Name: SWF Compiler
Description: Compiles your SWF
For macOS:
Program: /usr/bin/java
For Windows:
Program: java
Arguments:
Now, I am aware those Arguments may be confusing so I am going to break down the important bits:
"-Xmx2g" Is the amount of memory allocated to your compiler, so for 2G of RAM, you do "-Xmx2G" as I have. But if you wanted to allocate, let's say 4G of RAM, you'd do this instead. "-Xmx4g".
"-jar compiler/flexsdk/4.6.0/lib/mxmlc.jar" is where "mxmlc.jar" is located inside your Flex SDK. If you downloaded the OpenSource SWF I linked, this should just, work.
"+flexlib= compiler/flexsdk/4.6.0/frameworks" Is the same deal, you'll only need to change this if you aren't using the linked OpenSource SWF.
"-load-config+=obj/HabboConfig.xml" This is where your Config is located, it's highly unlikely you'll need to change this.
And finally...
"o build/Habbo.swf" Is where your Habbo.SWF is exported to. You could potentially export directly to a local environment, but that's your choice. This can be modified to any path on your drive providing you use the full path.
So, you should have everything filled out like so:
You can now press Ok and Apply. Now, we need to make that tool we have just created easily accessible.
If you have used IntelliJ in the past, you may be familliar with the "Toolbar". It is no longer enabled by default, but is still a tool I frequently use, and a tool we are going to be using to allow this compiler to be a one click tool.
In order to enable the Toolbar, you want to go to your IntelliJ View button on the top, and go to Appearance then click Toolbar.
This will enable the toolbar, but it isn't quite as cut and go as that. We now need to add our own button. In order to do this, we need to access the modification menu. Accessing this is simple, right click in any empty space on the toolbar, and click "Customize Menus and Toolbars"
Opening this will greet you with the following window.:
You want to open the "Main Toolbar" dropdown, and click the "Search Anywhere" entry. Once you have this selected, you want to click the + and click "Add Separator":
Then you want to open that very same menu with the + and click "Add Action...". It will open the following window.
Open the dropdown "External Tools" followed by the next one, then click "SWF Compiler", which is the tool we created earlier. Once done, click "Ok", and "Ok" again.
If all is well, this new button should now be present on your toolbar:
However, that's not QUITE all. Now, we need to open your "HabboConfig.xml" in your favourite code editor, and edit the following values:
Replace the following:
With your OpenSWF Folder's Location, so for me it's the following:
And now that's basically it.
Go ahead and click your new shiny button, and it should; if all has gone right, you should get a nice compiled SWF!
Now, I want to say I apologise in advance if this tutorial isn't very formal, I haven't done this very often, and it's my first attempt, so be nice!
If you have any questions, I relatively active, and i'll check back semi-regularly. But I hope this gives you a basic idea at minimum of how to Setup IntelliJ for SWF Editing / Developing.
Thanks for Reading, and I hope this is useful.
IntelliJ (Community but preferably Ultimate)
FlexSDK
Open Source SWF.
Downloads:
You must be registered for see links
You must be registered for see links
Okay, so for starters, you want to open your Open Source SWF inside of IntelliJ as an existing project, like so:
You must be registered for see images attach
You must be registered for see images attach
I recommend downloading the version by Harmonic due to it containing the compiler, which is essential for well.. compiling your SWF.
Once you open the project and it has fully loaded, it should look something like this:
You must be registered for see images attach
So, we actually want to completely ignore this, and go straight to IntelliJ preferences (This can be done with CMD + , on macOS and CTRL + , on windows):
You must be registered for see images attach
You then want to Open the Tools submenu, and then click on External Tools. This is where you will be setting up your compiler.
Upon Clicking the + you will be greeted with this screen:
You must be registered for see images attach
You want to fill out these fields as follows:
Name: SWF Compiler
Description: Compiles your SWF
For macOS:
Program: /usr/bin/java
For Windows:
Program: java
Arguments:
Code:
-Xmx2G -Dsun.io.useCanonCaches=false -Duser.language=en -Duser.region=US -Djava.util.Arrays.useLegacyMergeSort=true -jar compiler/flexsdk/4.6.0/lib/mxmlc.jar +flexlib=compiler/flexsdk/4.6.0/frameworks -compiler.compress=true -load-config+=obj/HabboConfig.xml -debug=true -o build/Habbo.swf
Now, I am aware those Arguments may be confusing so I am going to break down the important bits:
"-Xmx2g" Is the amount of memory allocated to your compiler, so for 2G of RAM, you do "-Xmx2G" as I have. But if you wanted to allocate, let's say 4G of RAM, you'd do this instead. "-Xmx4g".
"-jar compiler/flexsdk/4.6.0/lib/mxmlc.jar" is where "mxmlc.jar" is located inside your Flex SDK. If you downloaded the OpenSource SWF I linked, this should just, work.
"+flexlib= compiler/flexsdk/4.6.0/frameworks" Is the same deal, you'll only need to change this if you aren't using the linked OpenSource SWF.
"-load-config+=obj/HabboConfig.xml" This is where your Config is located, it's highly unlikely you'll need to change this.
And finally...
"o build/Habbo.swf" Is where your Habbo.SWF is exported to. You could potentially export directly to a local environment, but that's your choice. This can be modified to any path on your drive providing you use the full path.
So, you should have everything filled out like so:
You must be registered for see images attach
You can now press Ok and Apply. Now, we need to make that tool we have just created easily accessible.
If you have used IntelliJ in the past, you may be familliar with the "Toolbar". It is no longer enabled by default, but is still a tool I frequently use, and a tool we are going to be using to allow this compiler to be a one click tool.
In order to enable the Toolbar, you want to go to your IntelliJ View button on the top, and go to Appearance then click Toolbar.
You must be registered for see images attach
This will enable the toolbar, but it isn't quite as cut and go as that. We now need to add our own button. In order to do this, we need to access the modification menu. Accessing this is simple, right click in any empty space on the toolbar, and click "Customize Menus and Toolbars"
You must be registered for see images attach
Opening this will greet you with the following window.:
You must be registered for see images attach
You want to open the "Main Toolbar" dropdown, and click the "Search Anywhere" entry. Once you have this selected, you want to click the + and click "Add Separator":
You must be registered for see images attach
Then you want to open that very same menu with the + and click "Add Action...". It will open the following window.
You must be registered for see images attach
Open the dropdown "External Tools" followed by the next one, then click "SWF Compiler", which is the tool we created earlier. Once done, click "Ok", and "Ok" again.
If all is well, this new button should now be present on your toolbar:
You must be registered for see images attach
However, that's not QUITE all. Now, we need to open your "HabboConfig.xml" in your favourite code editor, and edit the following values:
You must be registered for see images attach
Replace the following:
XML:
<path-element>C:\Users\John\Desktop\HabboAS3\src</path-element>
<path-element>C:\Users\John\Desktop\HabboAS3\compiler\Library\AS3\classes</path-element>
<path-element>C:\Users\John\Desktop\HabboAS3\src\Habbo.as</path-element>
With your OpenSWF Folder's Location, so for me it's the following:
XML:
<path-element>/Users/cam/Documents/SWFdev/one/src</path-element>
<path-element>/Users/cam/Documents/SWFdev/one/compiler/Library/AS3/classes</path-element>
<path-element>/Users/cam/Documents/SWFdev/one/src/Habbo.as</path-element>
And now that's basically it.
Go ahead and click your new shiny button, and it should; if all has gone right, you should get a nice compiled SWF!
You must be registered for see images attach
Now, I want to say I apologise in advance if this tutorial isn't very formal, I haven't done this very often, and it's my first attempt, so be nice!
If you have any questions, I relatively active, and i'll check back semi-regularly. But I hope this gives you a basic idea at minimum of how to Setup IntelliJ for SWF Editing / Developing.
Thanks for Reading, and I hope this is useful.