When I change the main project mxml file, then export it, the swf doesn't change, why? - apache-flex

I have an existing flex project from years ago that I need to modify, I am using Flash Builder 4. When I export the project it creates an swf file in bin-release, then when I modify the code in the project mxml file or any supporting files and export it the swf should change but it does not. Do you have any idea why this may be happening?

I found the problem, there was an existing swf file in the html-template folder in the project. This caused it to override the new builds swf.

Related

Flash Builder compiling swc and no swf

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>

Embed external CSS in Flex's swf file

I want a few Flex (SDK 4.6) applications to share the same stylesheet (stored in CSS file). However I do not want to distribute standalone file along those applications' SWFs, but rather want to embed the CSS file into Flex application file (just as you embed images etc.). CSS declarations include font-embeddings so it is (I think) impossible to load CSS at runtime.
What I already found out:
I cannot simply use <fx:Script source="#Embed(stylesheet.css)" />. Wrong syntax.
I cannot use inline stylesheet in some MXML component that is shared among applications because CSS contains type declarations which are not allowed in components.
I can choose to compile CSS to SWF but this creates standalone SWF file (so I can embed Flex framework into SWF but not a standalone CSS ;]).
I hope I am missing something obvious and this is fairly easy to achieve.
Create a library project (producing a swc file)
Add the stylesheet as a resource
Put this project (or the compiled swc) on your other project's build path
You can now use this resource from within your other projects:
<fx:Style source="stylesheet.css" />
As an example:
In the librabry project you have src/stylesheet.css
If src is a source folder, the file should automatically be packaged into the library
If it's not, you'll have to manually add the files: in FlashBuilder this can be done through the Assets tab of the Build path editor. On the command line, add it with the -include-file option.
An alternative to using the swc as a library dependency, is to define it as a theme dependency. In FlashBuilder there's a Theme wizard in the project properties. On the command line do:
mxmlc -theme="/path/to/my/theme.swc" MyApp.mxml
If you use it as a theme, you don't even have to include the fx:Style tag in your Application. The CSS is included by default. But I think it has to be named defaults.css.

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......

In flex mxml application on including .as file

In mxml application made in flex if i place a part of actionscript code in separate file and include it in mail application using (fx:Script source) , then do i have to import all the mx and spark components in .as included file even though they are were already imported in main mxml application ?
For example if i have mx alert already imported in main mxml file then will i have to import in again in the .as file placed externally although .as file is included in main mxml application ?
Thanks
The answer is no you don't need to, but you will get compiler warnings if you reference classes inside the include. These warnings will not prevent you from compiling or deploying your app properly.
If you already had a sample set up for this, why did you ask here instead of just trying it?

facing problem in importing mxml file in action script using flex builder plugin in eclipse

I am trying to create a flex app but facing a weird problem I have created a package to keep my mxml file separately and action script file separately. But the problem I am facing is when I am trying to import one of the .mxml component in my actionscript of main file of mxml application then I am not able to do so .can some one help me in importing one mxml file into other mxml file. my flash builder is not recognizing the package in which i have kept my other mxmk file
I figured out my problem and learned that we cant import mxml file we can include mxml file in namespace and can only import actionscript file.

Resources