Flex - changes to mxml not reflected in browser - apache-flex

I have a Flex project and am using a trial version of Adobe Flex Builder 3 to build it.
I do the following:
1. Change an mxml file in the project (for simplicity, assume I changed the text in a label).
2. Right click on the project, Export, Release Build
3. Right click on the main mxml file, Run As -> Flex Application
A browser window opens, everything runs fine, but I cannot see the change I made in step 1.
I thought the browser (tried with IE, Chrome) might be caching stuff, so I tried after deleting all temporary internet files, but I see the same behavior.
Am I being dumb and missing something or is there something going on here?

Check the timestamp on your .swf in your release folder. You might be running from a different folder.

Check the URL of the flex app in your browser to see if its running the debug version or the release version.
file:///C:/ASWorkspace/FlexTest/bin-debug/FlexTest.html
When you run a flex app, flex builder normally runs the debug version. Exporting the release build is done when the project is completed - release build won't have any debug information in it and hence will be compact. If you have selected Build Automatically in the Project menu, the debug version will be recompiled automatically when you save a file. You can just hit F11 to run it.

Related

Issue with Flex mobile project - bug?

I have a problem with Flash, so that Flash Builder shows an error icon on my project (and I can't run my project) but there's no error I'm sure -> I's working on this project and there's not any error in it AND flash builder doesn't show any error on any file. Any helps? How can I resolve this problem?
Note: I'm using Flex SDK 4.6 and BlazeDS...
Sometimes when odd things like this happen, you can fix them by cleaning the project or the workspace.
You can clean the project by selecting "Clean" from the project menu in Flash Builder.
To clean the work space, you want to first shut down Flash Builder. Then relaunch Flash Builder using the '-clean' command line argument.
Per the comments on the original question, your solution was the latter.

Flex 4.5 - to long build process

We are developing an app using flex 4.5. The app runs just fine (no performance issues at all) but it takes us forever to compile and build it. A minor change, like just add a comment or press enter in an mxml file and rebuild takes about 3 minutes. You just cant work that way.
It is a large project with about 1300 files. We also use Parsley as IOC container and a beat of cairngorm navigation. We also use Maven (Flex mojos) but I am talking about a normal eclipse build (Ctrl + B).
We separated some of the code to a different SWC and all of our graphics are stored in a different resource SWF.
Please, Do you have any suggestions?
Regards, Ido
Summary
Turn off auto-build
Close unrelated projects
Remap Ctrl+B
Encapsulate application domains
Turn off auto-build
First thing to do when you install FlashBuilder is turning off the automatic building "feature". The Flex compiler is waaay to slow to constantly build in the background unless you work on very small projects. It's in menu > Project > Build Automatically.
Close unrelated projects
Any open project eats away memory. Close as many as you can.
Remap Ctrl+B
Since you use the Ctrl+B keybinding to launch the build process, you should know that this will actually build your entire workspace. Every single project that is open will be built. When you have a lot of dependencies that's gonna take a whole lot of time.
That's why I remap the Ctrl+B combo to just build the project that I'm currently working on. A small donwside is that sometimes you have to go 'manually' build a few projects, but that's largely outweighed by the time gain.
Go to menu > Window > Preferences. Type "key" in the search box. Click the topic "keys" under "general". Now type "build" in the searchbox on the right. Select "Build Automatically" and click the "Unbind Command" button. The ctrl+B binding should disappear. Now select "Build Project", then select the "Binding" input field (lower left) and hit Ctrl+B. Save and you're done.
Encapsulate application domains
I don't have a single project that is bigger than 200 files (usually even less than 100). Since your project consists of 1300 files I assume that it is does not have one monolithic function. So you should be able to slice it up into separate libraries; preferably one for each application domain. This will allow you to compile sizeable bits of the application and has the added benefit of clearly separating some concerns within your application.
How to fix slow build time when trying to use the debugger on Flash Builder 4.6 Mobile Apps
I ran into the same problem. Here is how you fix it.
It seem when you build a mobile app with a Server Connection like PHP it writes all of the
files on the server Directory..
When it come time to compile the app to debug it packages all of the sitting in the server directory. To fix this issue do the following.
Properties of the project.
Flex Build Packaging
for this example Pick Google Android.
Package Contents.
UnSelect anything that does not belong in your project..
After doing this build time when from 30 minutes to under 10 seconds..
Ok, This is how we fixed it:
We deleted all the dependencies. Then, we added only the necessary ones. You won't believe how many SWC files were just there and never used.
We went through almost every action-script and mxml file, and deleted unnecessary imports (using CTRL+ O on eclipse). This is a lot of work.
We changed the buiders on the project configurations so that only Flex builder remains. There were more builders including Maven. Every builder makes everything slower.
That is it.

How to make a Flex Builder project to work on an existing Flex non-project with ant build?

I want to do some development on a Flex project that uses Ant: http://svn.openstreetmap.org/applications/editors/potlatch2/ . I can build it from the command line but now want to use Flex Builder 3.0.2 to build, debug, etc.
I can see a few different paths to follow, but nothing that screams out "this is the right way":
create new project, SVN checkout in there (but then the directory structures won't match, and not sure how to tell FB to build using the existing build.xml)
create new project, create external source links to another directory with the files in it
Surely people do this all the time? (Never done Flash development before...)
Ok, here's what ended up working for me. It turns out I didn't need to use ant to build the project after all. This is for the specific project (Potlatch2) but lots of the principles are probably common.
File | New Flex Project (no server), save it somewhere, eg "c:\pot"
SVN checkout the potlatch2 files inside, so you have c:\pot\potlatch2\potlatch2.mxml etc...
Rename version.as.template to version.as and make up some stuff inside
Remove the "..." line from potlatch2-config.xml. Don't ask me why.
Set Flex SDK version - configure it to point to SDK 3.5
Project | Properties | Flex Build Path:
set source folder to potlatch2
set output folder to potlatch2\resources
set library path to potlatch2\lib
Update Flash global security settings to allow access to c:\pot\potlatch2\resources (otherwise you get 1. SWF security errors)[1]
Update browser settings (Window | Preferences...) to use a browser that has Flash Debug Player installed (ie, not Chrome).
Under debug settings (click the bug drop down, Other...): Turn off "Use defaults", make debug (and possibly run and profile) point to an HTML host file that passes the right settings to potlatch2.swf, passing lat/long coordinates of a place you want to edit.

clean project in flash builder on debug launch

Using Flash builder 4 to build an AIR app.
I keep having my code changes not take effect when I launch the project with the debugger, probably happens about once an hour. So does anyone know how to have FlashBuilder clean the project automatically before each launch?
Thanks
I'm having a similar issue with a Flex application. If I make a change to an .as file the change is not taking effect. The component is being instantiated by a parent component in the application so the compiler should be catching any changes I made. In fact, I can put a syntax error in the file and it won't report a problem. I've uninstalled and reinstall Flash Builder 4. I have to do a clean every time. I tried the tip from rakslice's comment of compiling with mxmlc manually and it successfully compiled without any clues as to what the issue with incremental compiling in Flash Builder 4 is. I finally added "-incremental=false" to my project's additional compiler arguments. This takes longer to compile of course, but I find it easier than having to click Project --> Clean every time.
I find that as long as I don't change code and/or recompile while an active debug sessions is on-going; I have no issues with the application not picking up code changes between subsequent runs.
I'm finding that I have a very similar problem. Everytime I launch my Flex app in a browser I have to perform a Clean just to get it to run.
I have noticed that I get a JavaScript error saying 'swfobject' is undefined odd error to be getting.
Not sure if that helps?

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