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

what is in AnimationController.js

drosenbe
drosenbe's picture
Registered: Feb 24 2011
Posts: 5
Answered

I am trying to work thru the Controlling Animation tutorial, but I have no idea what is in the required script AnimationController.js. The links at the Adobe site are dead.
 
Can someone PLEEEEEEAAASE contact me with information regarding what is supposed to go into the script, or even better, send me a copy of it.
 
Thanks
 
David

My Product Information:
Acrobat 3D 8.1, Windows
UVSAR
UVSAR's picture
Expert
Registered: Oct 29 2008
Posts: 1357
Accepted Answer
If you're reading the PDF file of the "Controlling Animation" tutorial then the scripts are attached to the PDF - click the paperclip in the bottom right corner of your screen, save the two files, and remove the ".txt" extension to turn them back into scripts.
drosenbe
drosenbe's picture
Registered: Feb 24 2011
Posts: 5
Thank you so much...I can't believe it was that simple....but I just never looked there.
drosenbe
drosenbe's picture
Registered: Feb 24 2011
Posts: 5
Well, i found the script and attached it to the the 3D model, but it is still not working.

In the debugger, I get a:

getField("AnimationSections") has no properties
13:Document-Level:AnimationControl

message. my 'entire Javascript' is below.

Any help would be most appreciated. BTW, I am running acrobat 8 3d.

David

//-------------------------------------------------------------
//-----------------Do not edit the XML tags--------------------
//-------------------------------------------------------------

//
//AnimationControl
//
/*********** belongs to: Document-Level:AnimationControl ***********/
var AnimationSections = [[0,2],[2,4],[4,5]];
var SectionCount = AnimationSections.length;
function Context()
{
return getAnnots3D(0)[0].context3D;
}
function Stop()
{
Context().MyAnimation.pause();
}
function GetSelectedSectionIndex()
{
return getField("AnimationSections").currentValueIndices;
}
function SetSelectedSectionIndex(value)
{
value = Math.min(SectionCount-1, value);
getField("AnimationSections").currentValueIndices = value;
}
function SetPlayRange(playall)
{
if(playall)
{
Context().MyAnimation.setPlayRange(AnimationSections[0][0], AnimationSections[SectionCount-1][1]);
}
else
{
var section = AnimationSections[GetSelectedSectionIndex()];
Context().MyAnimation.setPlayRange(section[0], section[1]);
}
}
function PlaySelected(DontPlay)
{
SetPlayRange();
Context().MyAnimation.reset();
if(!DontPlay)
Context().MyAnimation.play();
}
function PlayAll(DontPlay)
{
SetPlayRange(true);
SetSelectedSectionIndex(0);
Context().MyAnimation.reset();
if(!DontPlay)
Context().MyAnimation.play();
}
function PlayNext(DontPlay)
{
SetPlayRange();
Context().MyAnimation.reset();
if(!DontPlay)
Context().MyAnimation.play();
SetSelectedSectionIndex(GetSelectedSectionIndex() + 1);
}

//
////
//PlayAll:Annot1:MouseUp:Action1
//
/*********** belongs to: AcroForm:PlayAll:Annot1:MouseUp:Action1 ***********/
PlayAll();
//
////
//PlayNext:Annot1:MouseUp:Action1
//
/*********** belongs to: AcroForm:PlayNext:Annot1:MouseUp:Action1 ***********/
PlayNext();
//
////
//PlaySelection:Annot1:MouseUp:Action1
//
/*********** belongs to: AcroForm:PlaySelection:Annot1:MouseUp:Action1 ***********/
PlaySelected();
//
////
//RewindAll:Annot1:MouseUp:Action1
//
/*********** belongs to: AcroForm:RewindAll:Annot1:MouseUp:Action1 ***********/
PlayAll(true);
//
////
//RewindLast:Annot1:MouseUp:Action1
//
/*********** belongs to: AcroForm:RewindLast:Annot1:MouseUp:Action1 ***********/
PlaySelected(true);
//
////
//Stop:Annot1:MouseUp:Action1
//
/*********** belongs to: AcroForm:Stop:Annot1:MouseUp:Action1 ***********/
Stop();
//
//
UVSAR
UVSAR's picture
Expert
Registered: Oct 29 2008
Posts: 1357
The document level script attached to the PDF is a copy of the script used in the example. As that example uses a form field on the page to select the step within the animation to play, the script is referring to it. If you try to use the script as-is in another PDF it'll fall over as there's no form field.

AnimationController.js - the file you attach to the 3D scene - is a generic set of functions which don't need editing. The doc-level script *must* be rewritten to reflect your specific PDF and how your user is controlling the features (buttons, links, page open events, whatever).
rmkumaran
rmkumaran's picture
Registered: Feb 13 2011
Posts: 9
HI UVSAR,

thanks for replying in my topic too, i am facing the same problem, actually i have no programme knowledge
but i need to do it with in this week end, i have created a 3d pump model in 3ds max and animated it in Deep exploration 6.0 and exported as a *.*U3D file and now i need to control the animation using the buttons.
but as Drosenbe said that animation controller is not working. can you please help in getting through my problem.

thanks in advance

R.M.Kumaran
UVSAR
UVSAR's picture
Expert
Registered: Oct 29 2008
Posts: 1357
If you have no scripting experience then I'd suggest using Deep Exploration to do it for you - with DE you can create animations visually using the timeline and keyframing, and export directly to a 3D PDF file with all the scripting embedded for you. DE comes with a collection of samples (in My Documents/My 3D Models) that demonstrate what it can do.

drosenbe
drosenbe's picture
Registered: Feb 24 2011
Posts: 5
I would agree with the previous poster. If you do not have programming experience, this stuff is not that apparent. I found another example pdf that has scripts that works, but it is still flaky. contact me via the board if you want the file.

David
rmkumaran
rmkumaran's picture
Registered: Feb 13 2011
Posts: 9
Hi people,

thanks for your reply, i think i failed to communicate what i want, i already has the model and i animated it in deep exploration i need and all java script that is to show my animation part by part in acrobat pro by clicking the buttons.

thanks
rmkumaran
rmkumaran's picture
Registered: Feb 13 2011
Posts: 9
Hi people,

thanks for your reply, i think i failed to communicate what i want, i already has the model and i animated it in deep exploration i need and all java script that is to show my animation part by part in acrobat pro by clicking the buttons.

and Drosenbe this is my mail ID can you please mail me that file kumaran [dot] viscom [at] gmail [dot] comthanks