Skip navigation
Currently Being Moderated

Does anyone know how to load a file from the source directory?

Oct 3, 2013 9:40 AM

I have a Photoshop panel  that uses the Texturizer function. I would like to use the images in the src images directory of the  project. I need to reference the /src/images directory of the panel when the project is running.

 

Does anyone know how to access the source directory using action script?

 

I have tried a number of options but only seems to work if I hard code a location

 

 

 

 

public static function Mat02(): void

{

 

 

// Works

var myTexture:File = new File("C:\\Users\\Ed\\Adobe Flash Builder 4.6\\LayoutBuilderSuite\\src\\images\\mat 02.psd");

 

 

// Tried - no luck

//          var file = File.applicationStorageDirectory.resolvePath("mat 02.psd");

//          var file:File = File.applicationDirectory.resolvePath("mat 02.psd");

 

//var file:File = File.applicationStorageDirectory;

//file = file.resolvePath("mat 02.psd");

 

//var myTexture:File = File.applicationDirectory.resolvePath("mat 02.psd");

 

//var myTexture:File = File.documentsDirectory.resolvePath("mat 02.psd");

 

 

 

          var desc5:ActionDescriptor = new ActionDescriptor();

          desc5.putEnumerated( app.charIDToTypeID( "GEfk" ), app.charIDToTypeID( "GEft" ), app.charIDToTypeID( "Txtz" ) );

          desc5.putPath( app.charIDToTypeID( "TxtT" ),   myTexture  );

          desc5.putInteger( app.charIDToTypeID( "Scln" ), 150 );

          desc5.putInteger( app.charIDToTypeID( "Rlf " ), 4 );

          desc5.putEnumerated( app.charIDToTypeID( "LghD" ), app.charIDToTypeID( "LghD" ), app.charIDToTypeID( "LDBR" ) );

          desc5.putBoolean( app.charIDToTypeID( "InvT" ), false );

          app.executeAction( app.charIDToTypeID( "GEfc" ), desc5, DialogModes.NO );

 

}

 

 

Thanks

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points