I had flex project with few action script files.
I want to make the project as swc file. So can i know how to create it as swc file.
Thanks,
Ravi
I you are using Flash Builder, create a Flex library project and add the code there as you would in a normal project. There will be an extra pane in the Build settings allowing you to choose which classes to include (it defaults to everything). When you compile you will get a .swc file.
You have to use Flex's component compiler. Check out compc.
Related
I have a custom component(eg. MyButton) used in several swfs. I'd like to share the component in runtime, thus once our designer change the button's visual effect, we need not publish all flas that uses this button.
In as2, I can put this button in an asset fla(eg. lib.swf) and check the "export for runtime share" in symbol property. Then copy the button to a fla(eg. main.swf) and check the "import for runtime share", this works fine. However in as3, after doing above, if I put a button instance on stage and modify its inspectable property, i'll get a compile error "1046:Type was not found or was not a compile-time constant".
I searched the web and found this http://www.kirupa.com/forum/showthread.php?317257-Runtime-Shared-Library-woes. Then I tried the swc approach, but it seems swc will be compiled into swf, it doesn't share at all.
the shared component must be put on the stage, because all fla will be modified by our designer while he knows nothing about programing.
we can not use flex, all operation must be done in Flash CS5.
1: Placed on Library all of your components to .fla as follows: my fla names BrushClip.fla the components wrapped a MovieClip. and be ActionScript Linking export to ActionScript Class.
2: File - Publish Settings check SWC format and publish as follows:
3: check, created swc file in your project. now you can using a swc other project you must linking to SWC library in File-ActionScript Settings-Library Path. and later if you change a components design, re-publish. and copy and paste swc file. automatically will change restart swf file. BrushClip.swc has a all components.
you can access as follows:
var brushClip0:MovieClip = new BrushClip0();
addChild(brushClip0);
var brushClip10:MovieClip = new BrushClip10();
addChild(brushClip10);
I've found the solution.
Give the Sprite that holds the imported components a binding class
Edit the class file, declare the components yourself regardless of whether checked the "auto declare instance on stage"
Can you debug and step through the code of a swc files in flash builder?
Let's say you even have access to source code (coming from flex library project or flash professional project)! If how?
Thanks
Yes you can, though there are some limitations (as FlashBuilder will tell you when you do it), but simple stepping is no problem.
If you have the source code in a project in FlashBuilder, FB should find the associated code automatically. If you don't you can associate the source code to the swc manually. Go to the Flex Build Path window; click on the arrow next to the swc; double click the row that says "Source attachment" and enter the path to the source code.
I have some flex/AS3 code (from a 3rd party) which I must alter to fit my needs. I am constrained to use FlashDevelop due to my budget - which means the 3rd party are unwilling to offer much support (they used FlashBuilder)
The solution is made of approximately 10 "sub" projects, most of which use the spark.swc and spark_rb.swc in their library
These 10 projects are compiled into .swc using the Export SWC plugin. Each "sub" project compiles succesfully.
I then in use those .swc files in a main project.
I have tried every combination of adding the spark.swc and the spark_rb.swc to the "sub" projects library ("include referenced classes", "include completely", "not included") and similarly every combination of adding the "sub" .swcs to the main - and still I get compile errors, when building the main project similar to:
Error: Symbol 'en_US$components_properties' is multiply defined in
C:\flex_sdk_4.1.0.16076A\frameworks\locale\en_US\spark_rb.swc$locale/en_US/components.properties
and C:\Path\To\Folder\SubProject1.swc(en_US$components_properties)
I have not included either spark.swc or spark_rb.swc in the library of the main project.
How should I be using .swc files that share .swc code? Or - am I asking the wrong question, and should be doing something different?
That setup is okay, what you need to do is avoid compiling into your library the classes that are already included in other libraries while exporting them.
I don't know how to do this in Export SWC thing for FlashDevelop, but in Ant it is pretty easy (or even command line if you prefer):
Generate a link-report (-link-report=report.xml) while compiling
your app: It will contain info on what is compiled in you main SFW.
Compile all sub projects with -load-externs=report.xml: this way
the classes already included in the main SFW will not be compiled in
sub export file.
You can read more about it here:
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d1f.html#WS2db454920e96a9e51e63e3d11c0bf64277-7ffa
Hope that helps.
I'm using Flash Builder 4.6 and in one of my ActionScript projects, I have a referenced .swc library file.
The way I added it was Project > Properties > Flex Library Build Path > Library Path tab > Add SWC...
Here a popup occurs and I must select a .swc file by browsing through my machine and selecting one. Once I do that, it'll display the added library like this:
somelibrary.swc - /Full/Path/to/the/swc/here/lib/somelibrary.swc
What I want to be able to do is use a relative path instead, like:
somelibrary.swc - ../../lib/somelibrary.swc
Does anyone know a way to do this or a workaround to be able to use relative paths for swc libraries in Flash Builder?
Thanks!
I would suggest to dump mxmlc compilator's settings to xml file (where you can add all required swcs and its paths by hands using your favorite text editor).
Add compilator option -dump-config=build.xml
Find this xml config, modify it for your needs
Replace -dump-config=build.xml with -load-config=build.xml
Add compilator option:
-library-path=../../lib/somelibrary.swc
I have two ActionScript projects in Flash Builder 4.5. The second project needs to use some of the actionscript files in the first project. Is there a way to do this without duplicating those files in the second folder? Is library project the answer? Any details appreciated.
I use Library projects for this type of sharing. It works well.
Create a new library project
File -> New -> Flex Lilbrary Project
Any files that you want to be shared can go into that project. I tend to organize it by folder, depending on what the classes do. (example: Views, Models, DTOs, Utilities, etc).
The output will be a SWC file in the bin folder.
Manually referencing the library project
If you aren't actively developing the library project, you can build it and drop it into the libs folder and use the classes like you normally would.
If you are like me and you are constantly working on the library projects, then I like to set it up so that the projects actually reference each other in a way that changes to the library project don't require a manual step.
Automatically referencing the library project
In the project that wants to reference the library project, do the following:
Go to Project Properties -> Flex Build Path -> Add SWC Folder
Add /LibraryProjectName/bin
Go to Project Properties -> Project References
Select the library project
That's it
Once you set it up this way, you can share files via the library project. I do this all the time. Reasons you might want to do this:
Library Project: MyProject.Behavior
Web Project: MyProject.Web
Mobile Project: MyProject.Mobile
Desktop Project: MyProject.Desktop
Administrator Desktop Project: MyProject.Administrator
Testing: MyProject.Specs
As you can see, I can have several projects that all use the same behavior (models, views, etc).
you can make a library project, and add this output library file into library of used project, and add this library used project by adding library in Eclipse.
Making library project sample:
http://cookbooks.adobe.com/post_Creating_a_Flex_Library_Project_in_Flash_Builder-17629.html
Or
you can share reference of the library project by adding reference project in Eclipse, it works fine to me.
HTH.