Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript Buttons for 3d PDF help

    Hellow all. New to the forums and java as well, hopefully I have come to the right place. I've recently started using the 3d PDF Animate plug in for Adobe Acrobat. If you aren't familiar with it, Tetra4d.com is their website. The program allows you to animate a 3d object that you import into a PDF on a very basic level (scale, rotate, translate).

    The problem I am having is that the buttons you insert into the PDF to control the animation are very rudimentary. It has Play, Play All, Pause, Previous, Next, First, and Last. All the buttons are java, and I have the option of editing them or creating a new button from scratch. I, however, have exactly not experience with java and all my efforts to learn what I need have ended in nothing.

    Here is an example of the Play button

    var A3D = getAnnots3D(0)[0];try{A3D.context3D.playStep();}catch(e){};

    I think A3D is the name assigned to the animation. Conext3d, i think, is referring to the 3d space(think text box, but for the imported model). I have no idea what getAnnots3d(0)[0] is. Step is referring to a single animation. Ex. You have a house with a window and a door, opening the door would be step 1, opening the window would be step 2. The play button only plays the current step, to play the next or previous step, you have to click the next or previous button.


    Here is the PlayAll Button

    var A3D = getAnnots3D(0)[0];try{A3D.context3D.playAll();}catch(e){};

    Adding a value in the .playall() does nothing, in fact it ends up breaking the script and it plays nothing.

    What I am trying to do is to make a button that can play specific Steps without having to click next or previous to find it. Ex. Button 1 plays steps 1-3, button 2 plays step 4-5 and the like.

    Hopefully this is enough info, if you need anything else, or want to see the script for other buttons I can post that too.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    This is the JavaScript forum. Java and Javascript are entirely different programming languages, in spite of the confusingly similar names. Rather like Austria and Australia! Ask a mod to move this thread to the right forum.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well damn, thanks for the heads up. Just goes to show how lost I am in the situation.

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,700
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    Well, it looks like JavaScript, though (although it’s really hard to say from this little code but I would guess from the way the variables are declared), so you should understand Philip’s hint just as advice to use the correct name for the language, not that you posted in the wrong forum.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •