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

How to get current view in Javascript

antros
antros's picture
Registered: Jul 22 2010
Posts: 6

Hello,
 
I need to execute a piece of code everytime the user selects a view in the tool bar. For this purpose I have created new CameraEventHandler. However, in my event handler I need to know which view has been selected but I haven't figured out how to get it. All help is appreciated.
 

UVSAR
UVSAR's picture
Expert
Registered: Oct 29 2008
Posts: 1357
You can't. The 3D JavaScript API allows you to set a view from the preset entries and collect a View object by index or name from the array that populates the menu, but you cannot find what view is "current", nor can you hook an event handler onto the View dropdown list.

A CameraEvent object holds the raw camera position data but it has no idea what set those values and triggered the event.