Difference between libs and src folder - actionscript-3

What's the difference between libs and src folders?

The source folder is for ActionScript and Flex source files, mostly with .mxml or .as extensions. Anything you code you put in the src folder, though if you create your own library of reusable code, you might keep it in a second source folder (with another name, of course).
The libs folder is a special folder in Flash Builder, that you can put .swc files in. These SWCs (pronounce 'swicks') contain compiled code already. 3rdparty frameworks (or libraries) are easy to use by downloading their SWCs, and you can also create SWCs with assets from the Flash IDE, for easy access to your asset library. Hence, I guess, the naming of the folder 'libs'. The SWCs in the libs folder are automatically added to the classpath of your project, so you can access the classes therein.
Cheers,
EP.
P.S. Worth noting is that in other development IDE's like FDT or FlashDevelop, SWCs in the 'libs' folder are not neccessarily added to the classpath automatically and might need a little manual configuration.

src should contain your source code. lib contains the librairies that you reference and use in your code (.jar files for example).
EDIT : For Flex projects, you put in lib the .swc files that you load from your source code.

Related

How does Cocos2d-x keep code (C++ file) safe from decompilation?

I just decompiled APK using dex2jar and JD-GUI to access the source code, but I could not find any .h or .cpp files in classes.dex folder. I want to know how does Cocos2d-x take care of that issue and where are all these files stored?
the c++ files are compiled into a dynamic library, in lib/armeabi/, like libxxx.so

How to open a Flash project with some existing code?

I am a Java developer and have no experience in Flash, so sorry in advance if some of my questions will look stupid :)
I got some source code in this hierarchy and structure:
-sources flash builder
-com
-greensock
-deng
-fzip
-utils
-org
-flintparticles
ALAccessibility.as
ALEvent.as
ALImage.as
ALVideo.as
ALVideoOld.as
Project.as
Project-app.xml
Folders are marked with - sign. I didn't write in details what is inside of every folder (they have a lot of .as files)
How to open these files and folders as a Flash (I don't know exactly as an Action Script or Flex or something else) project? I also have project.swf file.
I have the Adobe Flash Builder 4.7.
I think you might be doing the import one folder too "high".
Usually the file structures you posted here are within a /src directory which is inside a project directory. There should be an Eclipse project file (.project) in the folder you're targeting for the import.
I don't think it works any differently from importing a Java project into Eclipse.
If that's not available, you'll have to create a new project and copy everything you have into that project structure - it's possible you've lost some project config (build path, compiler settings, etc) if the raw source is all you have...
In Flash Builder. File -> Import Flash Builder Project. Select "Project Folder" and Browse to the folder. Follow any instructions that may appear afterward.

How To Reconfigure Class File Paths In a FLA File?

I have a lot of library assets linked to external as3 classes. I would like to change the structure of the packages containing the linked classes, but if I do so, all links will get broken.
Is there any way to automatically or at least easily tell the FLA file where to get the new class files from? Could a FLA file be configured to read this sort of information from a configuration file?
You can add a folder to the source paths in ActionScript Settings. So if you had linked all your classes relative to the 'myClasses' folder, and then you moved everything to a different folder, you'd just have to update that one source path and it would find all the classes again.
Also, maybe this obvious, but I didn't realize it for a long time:
You can edit the class linkage right in the Library panel (without having to open the Properties for each symbol). Just double-click the linkage path.

Compiling as3 project to swc file in flashbuilder

i have a question and i'm hoping to find an answer here,
i created a flashbuilder project that contains some classes with functions that i use often,
i have around 6 classes, would it be possible to compile these classes to a swc file so i just have to add the swc in a new project to access them?
Or isnt it possible to create swc's with flashbuilder?
Maybe i could do it in flash but dont have any idea how to compile multiple classes into 1 swc. file.
Sorry if this is a stupid question but ive never used it before and couldnt find much about is.
Inside FlashBuilder create a new "Flex Library Project".
It will take you through a new project wizard that is similar to an Actionscript Project. Once it is created, you can add your .AS classes to the source folder. As long as Project->Build Automatically is checked, it will automatically create (and update) a SWC file in your designated output folder, usually (/bin).
If you want to pick and choose particular classes or include external libraries, SWFs, or other SWCs, select Project->Properties->Flex Library Build Path there is a tab called "Classes" where you can select which classes you want exported into the SWC.
You can just create a library project for this.
Move all of your code into this project and build the project.
The output will be a .swc file in the bin directory.
You can also do this from the command line using the compc (short for component compiler) and incorporate it into an ANT task or a Maven build.
Cheers

How does the Gaia Flash Framework access the scaffold.as file?

In the Gaia Flash Framework, a file called 'Scaffold.as' is used to make each page a scaffold page. This is accessed by the code,
new Scaffold(this);
But the class itself does not appear to be imported. Am I missing something about the way flash handles external classes? Or is there something else pulling it in?
Any help appreciated.
This all depends on how you are compiling. I'll assume you are using Flash IDE to compile. Flash has a source path lookup mechanism. This can be accesed through the fla (under File->Publish Settings->Flash (tab)->ActionScript). If the file Scaffold lives at the root level of a class path then there is no need to import it. The default class path includes the directory the Flash file resides in and some Adobe directories. There is a mechanism for managing class packages ... I think it was the old Macromedia Extension Manager. It would copy classes into the default class paths when the package was installed - so that could be the case. I have no familiarity with Gaia itself.
So there are 3 options. First the file Scaffold.as is in the same directory as your fla. Second the file Scaffold.as is in a default Adobe include directory. Finally the file is in a directory referenced in the fla's class path.