Updates a movie scene object’s graph and timeline with properties obtained by a class parser.
MovieObjectGenerator | Updates a movie scene object’s graph and timeline with properties obtained by a class parser. |
Public properties | |
movie | Movie scene object that is updated by a call to updateFromParser. |
Public methods | |
updateFromParser | Updates the movie scene object with properties collected by a ClassParser. |
Private movie scene methods | |
setupMovieProperties | Sets movie scene properties for name, background color, timeline framerate, loop state and scene coordinate system according to the values present in the parser. |
setupSceneMethods | Sets the movie scene graph reestablishing parent/child relationships of shapes, masks and paths. |
lookupParentIndex | Find the index of a parent stroke for a named child stroke. |
Private timeline methods | |
setupTimeline | Sets timeline properties from a method parser object. |
setupTimelineTweens | Sets timeline tweens from a method parser object. |
setTweenParams | Sets tween parameters for a new tween added to the movie timeline. |
setPathTweenParams | Sets tween parameters for a new motion path tween added to the movie timeline. |
setAdvancedTweenParams | Sets tween parameters for a new advanced tween added to the movie timeline. |
reverseTransitionType | Translates a Transitions symbolic enumeration string into its runtime pseudo-enumeration string representation. |
Private helper methods | |
stripQuotes | Removes double quotes from a string |
stripMethodPrefix | Removes the method name prefix to obtain the name of the asset created by the method. |
public var movie: MovieScene
Movie scene object that is updated by a call to updateFromParser.
public function updateFromParser( parser: ClassParser ):String
Updates the movie scene object with properties collected by a ClassParser. This may be a partial update depending on the parser properties. Scene dependencies and an optional timeline with tweens is handled directly, stroke shape and path methods are handled by calls to a StrokeObjectGenerator.
parser | initialized class parser object |
An empty string if successful or a string with an error message
private function setupMovieProperties( parser: ClassParser ):String
Sets movie scene properties for name, background color, timeline framerate, loop state and scene coordinate system according to the values present in the parser.
A scene coordinate system is not currently implemented.
parser | initialized class parser object |
private function setupSceneMethods( sceneRelations: Array, maskNames: Array, sceneMethods: Array ):String
Sets the movie scene graph reestablishing parent/child relationships of shapes, masks and paths. The scene methods are converted into stroke objects by calls to a StrokeObjectGenerator object.
sceneRelations | array of objects with parentName/childName properties |
maskNames | array of names of the strokes that are masks |
sceneMethods | array of MethodParser objects |
An empty string if successful or a string with an error message
private function lookupParentIndex( sceneRelations: Array, childName: String ):int
Find the index of a parent stroke for a named child stroke. The parent must exist on the movie scene graph for its index to be returned. Handles the case where the stroke has no parent because it is root by returning -1.
sceneRelations | array of objects with parentName/childName properties |
childName | name of a stroke |
Found parent index or 0 for root if not found. If the stroke is root then -1 is returned.
private function setupTimelineTweens( actions: Array ):String
Sets timeline tweens from a method parser object. Handled tween types are Tween, TweenEx, PathTween and AdvancedTween.
actions | array of tweens obtained from parsing |
An empty string if successful or a string with an error message
private function setTweenParams( params: Array ):String
Sets tween parameters for a new tween added to the movie timeline. Ensures that the stroke exists and if it is an extended property such as a filter or a color/matrix transform that a filter or transform object of the required type is added to it if not already present.
params | array of tween parameters obtained from parsing |
An empty string if successful or a string with an error message
private function setPathTweenParams( params: Array ):String
Sets tween parameters for a new motion path tween added to the movie timeline. Ensures that the stroke and the motion path exists.
params | array of tween parameters obtained from parsing |
An empty string if successful or a string with an error message
private function setAdvancedTweenParams( params: Array ):String
Sets tween parameters for a new advanced tween added to the movie timeline. Ensures that the stroke and the value path exists and if it is a tween of an extended property such as a filter or a color/matrix transform that a filter or transform object of the required type is added to it if not already present.
params | array of tween parameters obtained from parsing |
An empty string if successful or a string with an error message
private function reverseTransitionType( transition: String ):String
Translates a Transitions symbolic enumeration string into its runtime pseudo-enumeration string representation. For example “Transitions.LINEAR” is translated to “linear”.
transition | Symbolic transitions enumeration |
String representing the symbolic enumeration
Movie scene object that is updated by a call to updateFromParser.
public var movie: MovieScene
Updates the movie scene object with properties collected by a ClassParser.
public function updateFromParser( parser: ClassParser ):String
Sets movie scene properties for name, background color, timeline framerate, loop state and scene coordinate system according to the values present in the parser.
private function setupMovieProperties( parser: ClassParser ):String
Sets the movie scene graph reestablishing parent/child relationships of shapes, masks and paths.
private function setupSceneMethods( sceneRelations: Array, maskNames: Array, sceneMethods: Array ):String
Find the index of a parent stroke for a named child stroke.
private function lookupParentIndex( sceneRelations: Array, childName: String ):int
Sets timeline properties from a method parser object.
private function setupTimeline( parser: MethodParser ):String
Sets timeline tweens from a method parser object.
private function setupTimelineTweens( actions: Array ):String
Sets tween parameters for a new tween added to the movie timeline.
private function setTweenParams( params: Array ):String
Sets tween parameters for a new motion path tween added to the movie timeline.
private function setPathTweenParams( params: Array ):String
Sets tween parameters for a new advanced tween added to the movie timeline.
private function setAdvancedTweenParams( params: Array ):String
Translates a Transitions symbolic enumeration string into its runtime pseudo-enumeration string representation.
private function reverseTransitionType( transition: String ):String
Removes double quotes from a string
private function stripQuotes( quotedString: String ):String
Removes the method name prefix to obtain the name of the asset created by the method.
private function stripMethodPrefix( methodName: String ):String