flex sources not working in 8.1.1

I've just downloaded and installed IDEA 8.1.1 and opened my flex-facet enabled project with it.  At first I had some problems all over the place when I opened a mxml file because it seems the new version of the flex-facet for 8.1.1 defaulted to the flex 3.0 sdk for me.  Once I found that out and corrected it to flex 2.0.1 most of the errors went away.  However there does seem to be a problem with refering to relative resources in the source attributes for the Script and Style tags. After some testing I think i've determined that It seems that all the relative paths are being treated as coming from one of the defined Source Folders, and not relative to the file.

So for instance, I have a file structure that looks something like this:

Code/   (designated as a Source Folder)







In main.mxml I have Script and Style tags like this:

<mx:Script source="main_script.as"/>

<mx:Script source="./common/DragEventHandlers.as"/>
<mx:Style source="./common/sidx.css"/>
But with version 8.1.1 the editor is highlighting these source files and paths and telling me it cannot resolve them.  If I change the paths to be relative to the Code folder, like this:

<mx:Script source="flex/main_script.as"/>

<mx:Script source="./flex/common/DragEventHandlers.as"/>
<mx:Style source="./flex/common/sidx.css"/>

The error goes away but then I can no longer compile because the flex compiler imports the files relative to the file and fails to find them at their new path.  Putting an 'absulute' path such as /flex/main_script.as did not work either.

I had problems with the flex facet migrating from version 8.0 to 8.1 where I had the flex directory above marked as a Source Folder and I was able to get help here to change some settings and marke Code as the Source directory that then fixed those problems.  Is there a setting I'm missing or got wrong that I can change to fix the problem in 8.1.1?

1 comment
Comment actions Permalink

Hi Ronald!

Thank you for your feedback, it's definitely a bug which will be fixed
ASAP. I've created Jira issue for this:

Currently IDEA uses the same rules to resolve path s for assets like
<mx:Image source="..."/> and tags like <mx:Script source="..."/>,
<mx:Style source="..."/>. But in fact rules must be different.

If you don't want to see red code workaround is to use absolute paths
like source="d:/work/flex_project/Code/flex/main_script.as"


Please sign in to leave a comment.