views:

98

answers:

0

I have a big set of fla's that use an ActionScript 3.0 class that uses the Embed Flex SDK feature. (Like this; [Embed(source="pngasset.png")] )

My Flash CS3 IDE knows where my Flex SDK path is. And my global actionscript library path contains;

$(FlexSDK)/frameworks/libs/flex.swc;

However when I recompile an older Fla. I get a dialog asking;

Please set the Flex SDK path if necessary and add it to the library path for this file. The Flex SDK folder contains the bin, frameworks, lib and other folders.

Strangely enough the Flex SDK Path is already contained within this dialog and I only need to confirm it.

When I delete the project's aso files and recompile, this dialog is gone. However I have to go through this dialog at least one time.

Is there a way to set the Flex SDK path (apparantly needed per project file) using JSFL code instead of manually confirming per project?

I know how to set the librarypath per FLA. I'm using this code;

function updateLibraryPath(dom)
{
 if(dom.libraryPath.indexOf("$(FlexSDK)/frameworks/libs/flex.swc") == -1)
 {
  dom.libraryPath = "$(FlexSDK)/frameworks/libs/flex.swc;"+dom.libraryPath;
  fl.trace("Added \"$(FlexSDK)/frameworks/libs/flex.swc\" to Document Library Path");
 }
 else
 {
  fl.trace("Document Library path already contained \"$(FlexSDK)/frameworks/libs/flex.swc\"");
 }
} 

What I need is the JSFL code to automatically update the $(FlexSDK) variable per project. I hope someone can help me!