Broken Images in Flex Project - apache-flex

I'm trying to get an old Flex project up and running. (It was written by someone else, in Flash Builder. I've imported it into FDT).
I've noticed that all my MXML image links are all broken.
I thought I could remedy this by adding the assets directory to the package contents. (Project Properties -> FDT AIR Properties -> Desktop ... added the assets directory) But it didn't help.
I found a work-around. I simply say:
<mx:Image source="#Embed('assets/picture.png')"
Instead of:
<mx:Image source="assets/picture.png"
I also tried /assets, /src/assets, ../assets/, /..assets/ etc... (by the way, assets is a subdirectory of src)
But I'm curious why adding the assets directory to the package didn't work. And given that the project must have worked before as-is - I'd like to make it work for me, without modification.

Ive found that diff IDEs have their own "opinions" on how these assets paths are interpreted. Same experience when I moved from FB to IntelliJ.

Related

Prevent FlashBuilder from building all my assets

One annoying thing here..
My project contains lots of assets (a couple GB). They never change. At least not when I'm working on the main MXML code. Is there a way to prevent FlashBuilder to rebuild (delete, then copy) all my assets almost everytime I save or hit debug?
All I need to build is the main MXML file which is edited..
Thanks guys! =)
Move the unchanging assets to a separate library file. Link back to them from the 'project' 'properties'.
EDIT:
Library files can either be compile-time linked or run-time.
For details:
- Flex 4.7
- Flex 3

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

Is it possible to nest folders in the Flash Builder bin-debug

I'm trying to setup my bin-debug folder so that the structure looks like this:
bin-debug
assets
img
swf
main.swf
css
style.css
js
swfobject.js
index.html
I've tried setting the project's output folder to: bin-debug/assets/swf which does get my main.swf where I want it, but then my other source folders get dumped into that swf folder as well. What I would really like is to tell Flash Builder to put my swf into a nested folder and to be able to specify where my build folders' output goes as well. Is this at all possible without resorting to ANT scripts?
I ended up setting up an Ant script to pull this off and completely removing the html-template folder. Doesn't seem like there's any decent alternative. The upshot is that the Ant script gives me a lot more flexibility.
I don't think this is possible in Flash Builder. I have been looking for this feature myself but with no luck. I know it is possible in FDT though.
Just modify the html-template folder to look like the structure of your desired output. The variables in the index.template.html file is pretty well documented as well.

Flex Builder not building new source code

I have imported an existing project into flex but any changes I make to the source are not being built and displayed when I test run the application. The original files which are in the bin-debug folder dont seem to be changing at all.
I have tried cleaning the project, deleting the bin-debug folder even reinstalling flex builder, but nothing has solved the problem.
I've read this post which was about the same problem but none of the advice helped.
Any advice would be appreciated.
When you imported the project did you do a default import (copies everything into your workspace) or an "Existing Projects into Workspace" import?
If you did the default (listed as "FlexBuilder/Flex Project" under the import source) then you might be changing the wrong code. If you're looking in the original project's location for the SWFs to run then you're in the wrong place, as the SWFs you build will be in the new location.
One quick way to test to see if your code is actually being compiled would be to intentionally put a compile error in there. If the compiler chokes on it then your code is being compiled.
There's another thing you can try. I just ran into a weird issue where FB was caching a compile error, and even after fixing the file it still showed the error. Even after doing a clean, restarting FB, etc.
I found a place where FB caches information for the project, and for some reason it wasn't clearing things it should. It's possible your project's cache got messed up and it's messing up the compile somehow. You can try deleting it (might need to delete and re-import your project though).
The cache is at:
workspace.metadata.plugins\org.eclipse.core.resources.projects\
I just made a blog post about this, in case you'd find it useful.

Flex builder 3 word completion/intellisense stopped working for new variables

For some reason code completion/intellisense has stopped working for new properties in
our projects.
These are the symptoms:
Add a new property to a class
If you go to a different class, and you try to use that property, the intellisense dropdown doesn't show the new property. It does show the already existing ones.
If you build the project, everything works fine, there are no errors or compiler warnings.
The property will not show in intellisense until you restart Flex Builder (version 3).
We have tried it on different machines and als tried to set up the workspace again, but the symptoms stay the same everywhere in our project.
Anyone who has seen this behaviour before and any tips on how to resolve this?
Thanks
I see this behavior while flexBuilder is "Building WorkSpace" and "Refreshing WorkSpace" which, on large projects can take a few minutes sometimes. Flex builder by default builds your workspace every time you save some changes or launch/debug a project.
If you don't have "Build Automatically" checked under the "Project" menu, then your workspace will not be built with each save and you will not see your new properties until it is built, which won't be until Flex builder restarts.
The problem was that I was using a non-localized resource bundle that I had placed in the source folder of my project. In the compiler I added the source path "src" to the Flex Build Path settings, which is also the main folder of the source code.
This caused the problem. I have now moved the resources to another folder outside the src folder and configured the compiler accordingly. Flex Builder works all fine again.

Resources