These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Resource is not defined?

KentYang
Registered: Jul 23 2008
Posts: 7

Hi, there

I would like to attach a few image files in my PDF3D, so that I can switch textures on the model by resourcing different images.
Here is what I write in my script: "FaceRes = new Resource(“pdf://picture.jpg”);"
however, no matter what I wrote in the (), Acrobat keeps on showing "Resource is not defined"......

How do I achieve changing textures in PDF3D without re-editing shadder balls in 3Dtoolkit?

Thanks a lot!

My Product Information:
Acrobat 3D 8.0, Windows
csol
Registered: Oct 29 2008
Posts: 3
I am having the same problem.

Does anyone have a solution.
I followed the tutorial at
http://www.graysonlang.com/acrobat3d/attach3dresource/

But when trying to get the same effect but by clicking on a button with javascript to change the texture i always get "Resource is not defined"......

Here is my code
// get index of page containing the Annot3D object (count starts at 0)pageIndex = this.pageNum; // index of the Annot3D (count starts at 0)annotIndex = 0; // get a reference to the Annot3D script contextc3d = this.getAnnots3D( pageIndex )[ annotIndex ].context3D; // get a reference to the node in the scene named "WALL"axes = c3d.scene.nodes.getByName( "WALL" );  // Create a new Resource with the file's URI as the argumentimageResource = new Resource( "pdf://myimage.jpg" );  // use the Image constructor with the Resource as an argument,image = new Image( imageResource ); // set the loaded 3D model's diffuse texture to the imageaxes.material.diffuseTexture.setImage( image );

Has anyone got any ideas?