Do you need the linked AS files after publishing .fla into .swf in flash professional? - actionscript-3

I want to link external ActionScript file with my current fla project file so I can get the advantage of using classes in Adobe Flash professional CS6 in ActionScript 3.0.
But I am wondering if I can delete the AS file once the fla file has been published into swf?
Or even better would be if somebody could suggest me how to create classes in Flash CS6 without creating external files.
Thanks

When you publish a SWF file - all the source code (.as class files, library objects) are embedded into the SWF. (With the exceptions of Runtime Shared Libraries or any other assets you load at runtime).
This means that your SWF is not dependent on those .as files to run.
However, if you want to be able to re-publish or edit your project, you'll definitely need those .as files for that.
In regards to FlashPro, you cannot create class files that embedded in the .fla, they have to be separate .as files. You can however edit the .as class files in FlashPro.

Related

Adobe Flash Professional CS5 edit

I am new to Flash and I need to edit some files that are used in a flash project. The files I need to edit are in actionscript. What is the relation to the file types .as(actionscript), .fla (flash?), and .swf Also, do I need to recompile after any changes I make to an actionscript file.
Most likely, the .fla file is the main project file (what ties everything together). The .swf files are likely the final output from said project file. The .as files are code files that are likely attached to various items in the .fla file.
Here is an example:
You create a project in FlashPro/AdobeAnimate, you import some graphics, animate them on a timeline, and then want to add some code to those graphics to make them do something dynamic, so you create a class file (.as) and write some code, then link that class file to a timeline or object in FlashPro. When you are all done, you publish your application. This creates a .swf file which is then used on the web (legacy) or loaded by another application (Adobe Air, Visual Studio etc.).
Now, .swf files can also be used by other .swf files when a program runs. So some assets like graphics (.png, gif, jpeg, .swf) could be used by the application at run-time. The .fla & the .as file(s) though are only used for authoring and are not needed for running the published application.
You DO need to re-publish your .fla after any changes to an Actionscript (.as) file - this will generate a new .swf file.

Creating and Using a SWC File - Flash AS3

So I'm really confused on how to create, and use, a SWC file. I understand that a SWC file can be created to hold multiple assets. Basically, my code setup is the following:
c_Test.as - all testing of classes/fla files is done here
c_Test.fla - contains a few visual objects used/tested in c_Test.as
Class.as - class referenced multiple times in c_Test.as
Class1.fla - contains an important bitmap that is loaded into c_Test.as
So what I need to do is create a SWC file to be used in other projects; this is going to be the base of a multitude of other large projects, and I don't want to have to continuously copy and paste code into different folders. I am using Flash Builder 4.
So far, I went to publish settings in Flash CS6 in my c_Test.fla file and checked off Export SWF and Export SWC. What does this do? Has this created my SWC file?
I need to be able to access, from any random project, both Class.as, and Class1.fla.
Edit
So to clarify, cw_Test.fla is just a testing copy of the actual main fla file. I don't need this included in my swc. I just Exported my Class1.fla to SWf and SWC, and set a library path to the folder containing Class.as. Is this all I need to do to access both of these files from any project? (Besides importing them into any file I need them in).

How does one import symbols from a .fla file to an AIR project in FlashDevelop?

This is my first time working with AIR. In previous AS3 projects in FlashDevelop, I would create a .fla file with Flash Professional in the same directory as my source files and link my main class as the document class. I used Flash to create symbols and export them for actionscript and then wrote the definitions in FlashDevelop. That isn't working with AIR.
I have the .fla file in the same directory with all of my source files. FlashDevelop AIR Mobile compiles the project fine, but the application is a white screen. Compiling the same project with the same compiler in Flash Professional works perfectly, showing all of the symbols.
How do I access the symbols in my .fla file if I am compiling from FlashDevelop?
Try the following.
In Flash Professional, go to your publish settings. Check the .swc box to export a swc when you publish (and make sure the export location is in one of your flash develop project sub folders. A subfolder called 'lib' is common practice). Also, if desired, uncheck other outputs in your publish settings.
Publish your .fla.
In Flash Develop, find the .swc in the project panel directory tree, right click it, and choose "Add to Library" You may also need to right-click again and choose "options" and tell it to "Include completely".
Now all the symbols from your .fla are available to your FlashDevelop project.

Recomplie a swf file of a flash project that come without as3proj file

I have a folder of flash source code and what I would like to do is modify a action script file and recompile the swf again.
Unfortuneatly , I found that the source code do not have as3proj file . What I have is like this
FlashProject:
org/as2lib
project.fla
as files
And I tried to create a new project and what I saw is rsc, bin and lib folder, Then I tried to put the file like this:
lib/org/as2lib
rsc/as files
project.fla
What it generate is a white swf without any content, what should i do to compile it ? I am using flashDevelop ,Thanks
You have to create a new project, dismantle your FLA in Adobe Flash (trial will do) via exporting an SWF, then you grab resources out of that SWF within FlashDevelop, and use them accordingly. Migrating from Adobe Flash into FD is no simple task.
That FLA you have is an Adobe Flash project file, which FlashDevelop cannot read. So you have to start a new project, and embed your existing assets in FlashDevelop's way.

Flash directories

Is it possible to make code in actionscript-3 to parse the virtual directories that are constructed in the flash library?
I mean that if i add a folder on the library of CS4 called 'graphics' can i write code that parse the elements of that folder in order to fill an array with folder's elements(which are BitmapData classes) ?
No, not as far as I know.
One way of looking at it is that the library is part of the fla file, the source document, and not of the compiled swf. Assets in the library that are not "exported for ActionScript" are not included in the swf. ActionScript doesn't have access to the library as such, there is no object in ActionScript for it.