Configuring IntelliJ for SWF Modifications

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:

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.
 

Pollak

Active Member
Oct 12, 2017
161
51
Great tutorial! Amazing bro!! Congrats haha, i only have one question. Works only with the production swfopensouce (2016 where have on devbest) or i can pick one habbo.swf and modificate (like: other production and with them i stay with the source?
 

Cammm

New Member
Nov 18, 2018
18
10
Great tutorial! Amazing bro!! Congrats haha, i only have one question. Works only with the production swfopensouce (2016 where have on devbest) or i can pick one habbo.swf and modificate (like: other production and with them i stay with the source?

No, it only works with OpenSource SWFs. Ones that have been released, such as Beny's or Harmonic's Version.
I recommend Harmonic's versiom due to it containing the compiler.
 

Pollak

Active Member
Oct 12, 2017
161
51
No, it only works with OpenSource SWFs. Ones that have been released, such as Beny's or Harmonic's Version.
I recommend Harmonic's versiom due to it containing the compiler.
Ahh okey thanks! I dont like the production 2016 so :/
 

Users who are viewing this thread

Top