Flash Builder compiling swc and no swf - apache-flex

I've got an old Flex project I have to bug fix - and Flash builder is now refusing to compile a swf. I'm getting a swc only in the output directory in run or debug.
Does anyone know why Flash Builder might do this? Any settings I'm not aware of?

Flash builder will create swcs for library projects. There is probably another "shell" project that depends on the project you're looking at;
However, if I assume that this was supposed to be a regular Flex project, and it got converted into a library by mistake, you can change it back by editing the .project file in the project root. Look for the following XML element in that file:
<natures>
<nature>com.adobe.flexbuilder.project.flexlibnature</nature>
<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
</natures>
Change that to:
<natures>
<nature>com.adobe.flexbuilder.project.flexnature</nature>
<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
</natures>

Related

Unable to add SWC file to Flex Library Build Path in Flash Builder

I'm looking at Flash Builder for my next project. I'm following some tutorials, yet I keep getting stuck at the same part. The tutorials I am following tell me to add a SWC files (containing my art) and should be in a library project.
I can create the library project and use it as a reference in my application. However, when I try to add the SWC file to the "Flex Library Build Path" the OK button does nothing. The same happens if I try to add a SWC or SWC Folder.
I' m using Flash Builder 4.6 (trial version) if that makes any difference. Below is a screenshot of the window that I am talking about in case I'm not very clear.
It has also happened to me.
There is workaround - just place SWC into /libs directory of your project and perform clean. SWCs there will be loaded automatically.
Make sure you have added the folder to the Workspace's linked resources. In Flash Builder, go to menu Windows > Preferences > General > Workspace > Linked Resources, and add a new path variable to the component directory. After this, the component can be added to the project's Flex Library path.
I think this is a bug of flash builder. It has also happened to me. And I can not choose the output path in fb....
I found a way, first, delete this project, delete evrey thing fb created itself except the source code, then u can swith ur fb to a new workspace, add creat a new project, u will see that u can add the swc file now.finally,switch back to the workspace u worked with before......

Imported flash builder project unable to open swc

I wanted to import an older FB project into the flash builder on my new pc, but I only have the filestructure. So I used 'import>existing projects into workspace'.
The files seem to be intact still, but the project now gives me an error regarding an swc in the bin folder: 'unable to open \'something'\bin\'something'.swc
I have no idea how to solve this, or what this even means. Can somebody lend me a hand here?
This would be referring to an old library project that you forgot to include in your workspace (or open). In Eclipse, when you specify a path as /your-library-project/some/path, it automatically resolves the real path to whatever you're trying to reference.
In this particular case, you were referring to the swc created by this library project and linking to it directly. To fix this issue, you'll need to find the library project and import it into your workspace.

Flash Builder 4.5: could not resolve X to a component implementation

I just upgraded out Flex project to use SDK version 4.5.1.21328 and the Flash Builder to version 4.5
All of the sudden, I'm getting several red tags on the Flash Builder: "could not resolve s:State/fx:Script/whatever to a component implementation"
However, the project builds fine with Maven, and seems to work well too.
Does anyone have any information on how to remove these "problems"?
Thanks.
Finally managed to find a workaround. Adding
--namespace+=http://ns.adobe.com/mxml/2009,${flexlib}/mxml-2009-manifest.xml --namespace+=http://www.adobe.com/2006/mxml,${flexlib}/mxml-manifest.xml --namespace+=library://ns.adobe.com/flex/spark,${flexlib}/spark-manifest.xml
to the "Additional compiler arguments" in properties -> Flex Compiler seems to remove all the red markers.
Great tip. Error I was getting was:
Could not resolve <mx:RichTextEditor> to a component implementation.
I had to add the above settings and do the following to get mine to compile.
Here's what I did:
project properties->Flex Build->Path-> Library path tab. press Add SWC...
add C:/Program Files/Adobe/Adobe Flash Builder 4.5/sdks/4.5.1/frameworks/libs/mx/mx.swc
Then in the Source Path tab press add folder navigate to:
C:/Program Files/Adobe/Adobe Flash Builder 4.5/sdks/4.5.1/frameworks/projects/mx/src
then add in the namespaces as listed in the above article. That fixed it for me.
Clean.
Just as the commenter said, usually just a strange Flash Builder bug. If Project -> Clean... doesn't fix it, comment or revise question.
Your batch builder might be using a different set of library files than the IDE. Look in Project | Properties under Build Path and see what version of the SDK it's using.

How to create an SWC file

All I want is to take my AS3 source code files and compile them into a SWC file.
Upon inspection, the SWC files I generate end up with some kind of timeline or spite in them when I use the Flash IDE or that Flex SDK utility "compc", and it's irritating.
Flash is timeline based; so everything in Flash uses a timeline. They hide it very well in Flex, though, so it's not obvious under the hood.
To create a SWC file in Flex, you need to use the command line compiler, although it sounds like you've already done that, so I'm unclear what your issue is.
In fact, you can build a "flex library project" in Flash builder. place your AS3 source code files in this project, it would automatic generate a swc file in which your AS3 Class;

Trouble compiling flashbuilder project with sdk 3.*

I have a series of projects that we have been using Flex3/Flashbuilder to work with, but I've recently been trying to move over to Flashdevelop for most of my development but I have hit a snag with a certain project structure that Flex/FB can handle but FD/mxmlc can't with sdk 3.*
What I have is something like this:
project_root/
/src
/resources
The resources in flex is added as a class path to the project and I am embedding images like this: [Embed(source="/wardrobe.png")]
This all works fine in Flex/FB but FD I get there errors for all my images :
Error:unable to resolve '/wardrobe.png' for transcoding
Error:unable to transcode /wardrobe.png
This problem don't occur when I'm using the Flex 4 sdk, but for these projects I require 3.2. If anyone has any idea of what these projects won't build and a way to make them work outside of Flex/FB that would be great.
Good news:
there is a reason why the Flex 3 SDK does not resolve embeds in the entire classpath but only the class' one.
Bad news:
it's a bug which is not going to be fixed in Flex 3 SDK (it's ok in Flex 4 SDK).
As a matter of fact, both FlashBuilder and Maven Flexmojos use a workaround (they inject a custom "resource resolver" in the compiler).
Solution:
The best you can do is to fix embed paths like: "/../resources/wardrobe.png" (the starting "/" makes the path relative to the class' classpath root).
try cleaning the project
i don't know where in flex builder but in eclipse it in Project>Clean
then build again the project..

Resources