How to Add MX.Core Package ActionScript in SWF/FLA file? - actionscript-3

I'm trying to add ActionScript 3 in FLA file using Flash Professional, but I am getting error that Packages cannot be nested. I am completely new but It's necessary for me to add that code in FLA/SWF file, I guess it will work with Flash builder but again I have no idea to edit FLA or add ActionScript using Flash Builder.
Please Help!

Related

Cannot export swf file from flash cs5.5

I am creating an application using flash cs5.5 Here it is. Up to certain part of our work, we can not export the file into swf. There is no error provided. So i am clueless. Please help me im going to present this real soon.

Execution life cycle of MXML+actionScript files

I know that When we compile a Java class then it will convert it into .class file and then through this .class file we have been able to run our code
Now I am new to Flex4 and ActionScript3 and I want to know what happened when I create a MXML file in flex builder and run it.Is MXML file first convert to .as file and the able to run or some other conversions happen?
Is MXML file first convert to .as file and the able to run or some other conversions happen?
Yes, the mxml compiler will convert MXML files into Actionscript classes. The mxml compiler generates a lot of code, which by default is not saved in your project. You can, however, add the -keep-generated-actionscript option (or just -keep) to the compiler options of your project you can see the generated code.
Here is a reference to the various compiler options. Right click your project in Flash Builder, select "Properties", and select "Flex Compiler" to see/edit the compiler options.

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.

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

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.

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