2 Replies Latest reply on Oct 3, 2013 10:25 AM by ed@edkelley.biz

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

    ed@edkelley.biz Level 1

      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 );