Animating transformations. Adobe InDesign CS6
Advertisement
Advertisement
C HAPTER 11: Creating Dynamic Documents Working with Animation 186 delete timing group -1 delete timing group -1 end tell
--Add a new timing list that triggers when the page is clicked.
set myTimingListB to make timing list with properties {trigger event:on page click} tell myTimingListB set myTimingGroupB to make timing group with properties {dynamic target:myPolygonD, delay seconds:0} tell myTimingGroupB make timing target with properties {dynamic target:myPolygonE, delay seconds:2} end tell end tell end tell make timing target with properties {dynamic target:myPolygonF, delay seconds:2}
In the previous examples, we’ve worked with the timing settings
of the spread containing the page items we want to animate. When you want to animate a page item when a user clicks the item, you’ll need to use the timing settings of the page item itself, as shown in the following script fragment (for the complete script, refer to PageItemTimingSettings).
--Given a page "myPage"...
tell myPage set myPolygonA to make polygon with properties {fill color:myColorA, stroke color:"None"} set entire path of path 1 of myPolygonA to {{72, 72}, {72, 144}, {144, 108}}
--Create a motion path.
set myMotionPathPointsA to {{{{108, 108}, {108, 108}, {108, 108}}, {{516, 108},
{516, 108}, {516, 108}}}, true}
--Set animation preferences for the polygon.
tell animation settings of myPolygonA set duration to 2 set motion path points to myMotionPathPointsA end tell
--Remove the default timing list in the timing settings for the spread.
set myTimingSettings to timing settings of parent of myPage tell myTimingSettings delete timing list 1 end tell set myTimingSettings to timing settings of myPolygonA tell myTimingSettings set myTimingList to make timing list with properties {trigger event:on click} end tell tell myTimingList set myTimingGroup to make timing group with properties {dynamic target:myPolygonA, delay seconds:0} end tell end tell
Animating transformations
Page items can change size, rotation or skewing angles, opacity, and visibility as their animation plays. The animation settings
of the page item contain properties (such as rotation array
or hidden after
) that define the transformations that are applied during animation. The following script fragment shows how to make a page item rotate as it follows a motion path (for the complete script, refer to
AnimateRotation).
Download
Advertisement