Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-17-2013, 05:44 PM   PM User | #1
ashtronaut12
New to the CF scene

 
Join Date: Jan 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
ashtronaut12 is an unknown quantity at this point
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.
ashtronaut12 is offline   Reply With Quote
Old 01-17-2013, 06:35 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,033
Thanks: 197
Thanked 2,410 Times in 2,388 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
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.
Philip M is offline   Reply With Quote
Old 01-17-2013, 06:40 PM   PM User | #3
ashtronaut12
New to the CF scene

 
Join Date: Jan 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
ashtronaut12 is an unknown quantity at this point
well damn, thanks for the heads up. Just goes to show how lost I am in the situation.
ashtronaut12 is offline   Reply With Quote
Old 01-17-2013, 07:22 PM   PM User | #4
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,587
Thanks: 5
Thanked 864 Times in 841 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
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.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:06 PM.


Advertisement
Log in to turn off these ads.