Java Doc for Script.java in  » Ajax » Laszlo-4.0.10 » org » openlaszlo » iv » flash » api » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » Laszlo 4.0.10 » org.openlaszlo.iv.flash.api 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.openlaszlo.iv.flash.api.FlashItem
      org.openlaszlo.iv.flash.api.FlashObject
         org.openlaszlo.iv.flash.api.FlashDef
            org.openlaszlo.iv.flash.api.Script

Script
final public class Script extends FlashDef (Code)
Flash movie clip

Contains a timeline, a background color and generator commands of script level.

Excerpt from flash file format specs:

A script corresponds to a 'movie clip' in the Flash user-interface. It is a movie contained within a movie, and supports many of the features of a regular Flash movie, including:

  • Most of the control tags that can be used in the main movie.
  • A timeline that can stop, start and play independently of the main movie.
  • A streaming sound track that is automatically mixed with the main sound track.

A script object is defined with a DefineSprite tag. It consists of a character ID, a frame count, and a series of control tags. Definition tags (such as DefineShape) are not allowed in the DefineSprite tag. All the characters referred to by control tags in the sprite must be defined outside the sprite, and before the DefineSprite tag.

Once defined, a script is displayed with a PlaceObject2 tag in the main movie. The transform (specified in PlaceObject) is concatenated with the transforms of objects placed inside the script. These objects behave like 'children' of the script, so when the script is moved, the objects inside the script move also. Similarly, when the script is scaled or rotated, the child objects are also scaled or rotated. A script object stops playing automatically when it is removed from the display list.
author:
   Dmitry Skavish




Constructor Summary
public  Script()
    
public  Script(int frameNumber)
    
public  Script(int objID, int frameNumber)
     Creates empty script with specified initial capacity and ID

The capacity specifies the capacity of this script's timeline (in frames).


Method Summary
protected  voidaddGlobalCommand(GenericCommand cmd)
    
public  FrameaddTweening(FlashDef def, int layer, int startFrame, AffineTransform startMatrix, CXForm startCXF, int endFrame, AffineTransform endMatrix, CXForm endCXF)
    
public  FrameaddTweening(FlashDef def, int layer, int startFrame, AffineTransform startMatrix, CXForm startCXF, int endFrame, AffineTransform endMatrix, CXForm endCXF, String name)
    
public  FrameaddTweening(FlashDef def, int layer, Frame frame, int num, AffineTransform startMatrix, CXForm startCXF, AffineTransform endMatrix, CXForm endCXF)
    
public  FrameaddTweening(FlashDef def, int layer, Frame frame, int num, AffineTransform startMatrix, CXForm startCXF, AffineTransform endMatrix, CXForm endCXF, String name)
    
public  voidappendScript(Script sc)
     Appends specified script to the end of this script

Removes all hanging instances of this script, i.e.

public  voidapply(Context context)
    
public  voidcollectDeps(DepsCollector dc)
    
public  voidcollectFonts(FontsCollector fc)
    
protected  FlashItemcopyInto(FlashItem item, ScriptCopier copier)
    
public  ScriptcopyScript()
    
public  voidfadeOut(int num)
    
public  InstancefindInstance(String name)
     Finds nested script's instance by name

Searches instance of a script in this script and in all nested scripts by instance's name.

public  voidgenerate(FlashOutput fob)
     Writes content of this script to flash buffer

This method has to be used only if this script is main script.

public  voidgenerate(FlashOutput fob, FontsCollector fc1, FontsCollector pfc, boolean hasPreloader)
     Writes content of this script to flash buffer

This method has to be used only if this script is main script.

public  SetBackgroundColorgetBackgroundColor()
    
public  Rectangle2DgetBounds()
    
public  FlashItemgetCopy(ScriptCopier copier)
    
public  FramegetFrameAt(int frameNum)
    
public  intgetFrameCount()
    
public  intgetFrameIndex(Frame frame)
    
public  FramegetLastFrame()
    
public  intgetMaxDepth()
    
public  IVVectorgetOccupiedLayers()
    
public  intgetTag()
    
public  TimelinegetTimeline()
    
public  IVVectorgetZero_frame()
    
public static  AffineTransforminterLinear(double t, AffineTransform startMatrix, AffineTransform endMatrix)
    
public  booleanisConstant()
    
public  booleanisMain()
    
public  booleanisProcessed()
    
protected  voidmergeFonts(IVVector fonts)
    
public  FramenewFrame()
    
public static  Scriptparse(Parser p, boolean isMain)
    
public  voidprintContent(PrintStream out, String indent)
    
public  voidprocess(FlashFile file, Context context)
    
public  voidremoveAllInstances(Frame lastFrame)
     Removes all hanging instances of the timeline in the specified frame

Traverses this script and for every hanging instance (instance which is still on the timeline by the last frame) puts RemoveObject tag in the specified frame.

public  voidremoveFileDepGlobalCommands()
     Removes global commands from this script which have to appear only once in a file.
public  intreserveLayers(int from, int num)
     Reserves specified number of layers beginning from the specified one

Traverses the timeline and moves all the instances which are on layers greater than the specified one by the specified number.

public  voidresetMain()
    
public  voidsetBackgroundColor(SetBackgroundColor bkgColor)
    
public  voidsetMain()
    
public  voidsetProcessed()
    
public  voidwrite(FlashOutput fob)
     Writes content of this script to flash buffer

This method has to be used only if this script is NOT a main script.



Constructor Detail
Script
public Script()(Code)
Creates empty script



Script
public Script(int frameNumber)(Code)
Creates empty script with specified initial capacity
Parameters:
  frameNumber - initial capacity of this script in frames
See Also:   Script.Script(int,int)



Script
public Script(int objID, int frameNumber)(Code)
Creates empty script with specified initial capacity and ID

The capacity specifies the capacity of this script's timeline (in frames). It does not specify how many frames this script will eventually have.
Parameters:
  objID - ID of this script, if it's -1, then this is a main script
Parameters:
  frameNumber - initial capacity of this script in frames





Method Detail
addGlobalCommand
protected void addGlobalCommand(GenericCommand cmd)(Code)



addTweening
public Frame addTweening(FlashDef def, int layer, int startFrame, AffineTransform startMatrix, CXForm startCXF, int endFrame, AffineTransform endMatrix, CXForm endCXF)(Code)
Adds simple motion and color tweening to this script
Parameters:
  def - symbol to be tweened
Parameters:
  layer - layer on which to place the symbol and do the tweening
Parameters:
  startFrame - start frame
Parameters:
  startMatrix - start transformation matrix
Parameters:
  startCXF - start color matrix (optional)
Parameters:
  endFrame - end frame (included)
Parameters:
  endMatrix - end transformation matrix
Parameters:
  endCXF - end color matrix (optional) last frame



addTweening
public Frame addTweening(FlashDef def, int layer, int startFrame, AffineTransform startMatrix, CXForm startCXF, int endFrame, AffineTransform endMatrix, CXForm endCXF, String name)(Code)
Adds simple motion and color tweening to this script
Parameters:
  def - symbol to be tweened
Parameters:
  layer - layer on which to place the symbol and do the tweening
Parameters:
  startFrame - start frame
Parameters:
  startMatrix - start transformation matrix
Parameters:
  startCXF - start color matrix (optional)
Parameters:
  endFrame - end frame (included)
Parameters:
  endMatrix - end transformation matrix
Parameters:
  endCXF - end color matrix (optional)
Parameters:
  name - instance name last frame



addTweening
public Frame addTweening(FlashDef def, int layer, Frame frame, int num, AffineTransform startMatrix, CXForm startCXF, AffineTransform endMatrix, CXForm endCXF)(Code)
Adds simple motion and color tweening to this script
Parameters:
  def - symbol to be tweened
Parameters:
  layer - layer on which to place the symbol and do the tweening
Parameters:
  frame - first frame to start the tweening
Parameters:
  num - number of frames for the tweening (in addition to the first frame)
Parameters:
  startMatrix - start transformation matrix
Parameters:
  startCXF - start color matrix (optional)
Parameters:
  endMatrix - end transformation matrix
Parameters:
  endCXF - end color matrix (optional) last frame



addTweening
public Frame addTweening(FlashDef def, int layer, Frame frame, int num, AffineTransform startMatrix, CXForm startCXF, AffineTransform endMatrix, CXForm endCXF, String name)(Code)
Adds simple motion and color tweening to this script
Parameters:
  def - symbol to be tweened
Parameters:
  layer - layer on which to place the symbol and do the tweening
Parameters:
  frame - first frame to start the tweening
Parameters:
  num - number of frames for the tweening (in addition to the first frame)
Parameters:
  startMatrix - start transformation matrix
Parameters:
  startCXF - start color matrix (optional)
Parameters:
  endMatrix - end transformation matrix
Parameters:
  endCXF - end color matrix (optional)
Parameters:
  name - instance name (optional), is set on first instance last frame



appendScript
public void appendScript(Script sc)(Code)
Appends specified script to the end of this script

Removes all hanging instances of this script, i.e. for every instance which is still on the timeline by the of this script put RemoveObject tag in the last frame of the timeline. Then adds all frames of the specified script to the end of this one.
Parameters:
  sc - script to be appended




apply
public void apply(Context context)(Code)



collectDeps
public void collectDeps(DepsCollector dc)(Code)



collectFonts
public void collectFonts(FontsCollector fc)(Code)



copyInto
protected FlashItem copyInto(FlashItem item, ScriptCopier copier)(Code)



copyScript
public Script copyScript()(Code)
Creates a copy of this script copy of this script



fadeOut
public void fadeOut(int num)(Code)
Fades out everything on the timeline during the specified number of frames
Parameters:
  num - number of frames



findInstance
public Instance findInstance(String name)(Code)
Finds nested script's instance by name

Searches instance of a script in this script and in all nested scripts by instance's name.
Parameters:
  name - name of the instance to be searched found Script or null




generate
public void generate(FlashOutput fob)(Code)
Writes content of this script to flash buffer

This method has to be used only if this script is main script.
Parameters:
  fob - flash buffer to write
See Also:   Script.isMain
See Also:   Script.write




generate
public void generate(FlashOutput fob, FontsCollector fc1, FontsCollector pfc, boolean hasPreloader)(Code)
Writes content of this script to flash buffer

This method has to be used only if this script is main script.
Parameters:
  fob - flash buffer to write
Parameters:
  fc1 -
Parameters:
  pfc - preloader fonts
Parameters:
  hasPreloader - true if preloader exists
See Also:   Script.isMain
See Also:   Script.write




getBackgroundColor
public SetBackgroundColor getBackgroundColor()(Code)
Returns background color of this script background color of this script



getBounds
public Rectangle2D getBounds()(Code)
Calculates bounds of this script

Takes masks into account too bounds of this script




getCopy
public FlashItem getCopy(ScriptCopier copier)(Code)



getFrameAt
public Frame getFrameAt(int frameNum)(Code)
Returns frame at specified index

If frame does not exist, creates it at specified index and fills everything in between with empty frames
Parameters:
  frameNum - frame number frame at specified index




getFrameCount
public int getFrameCount()(Code)
Returns number of frames in this script number of frames



getFrameIndex
public int getFrameIndex(Frame frame)(Code)
Returns index of specified frame in the timeline or -1
Parameters:
  frame - specified frame index of specified frame in the timeline or -1



getLastFrame
public Frame getLastFrame()(Code)
Returns last frame of this script last frame of this script



getMaxDepth
public int getMaxDepth()(Code)
Returns maximum layer's depth of this script maximum depth



getOccupiedLayers
public IVVector getOccupiedLayers()(Code)
Returns vector of all occupied layers by the end of this script vector which contains Instances at 'layer' indexes



getTag
public int getTag()(Code)



getTimeline
public Timeline getTimeline()(Code)
Returns this script's timeline script's timeline



getZero_frame
public IVVector getZero_frame()(Code)
zero_frame IVVector accessor IVVector



interLinear
public static AffineTransform interLinear(double t, AffineTransform startMatrix, AffineTransform endMatrix)(Code)
Creates linear interpolation of the two specified matrixes
Parameters:
  t - coefficient of the interpolation [0..1]
Parameters:
  startMatrix - first matrix
Parameters:
  endMatrix - second matrix interpolation of the two specified matrixes



isConstant
public boolean isConstant()(Code)



isMain
public boolean isMain()(Code)
Returns true if this script is a main script

Main script is a script which represents main flash timeline true if this is a main script




isProcessed
public boolean isProcessed()(Code)
Returns true if this script was already processed true if this script was already processed



mergeFonts
protected void mergeFonts(IVVector fonts)(Code)
Merges the same fonts into one
Parameters:
  fonts - vector of fonts (FontDefs)



newFrame
public Frame newFrame()(Code)
Creates new frame and adds it to the end of the timeline new added frame



parse
public static Script parse(Parser p, boolean isMain) throws IVException(Code)
Parses script
Parameters:
  p - parser
Parameters:
  isMain - true if script to be parsed is main new parsed script
exception:
  IVException -



printContent
public void printContent(PrintStream out, String indent)(Code)



process
public void process(FlashFile file, Context context) throws IVException(Code)
Processes this script in the specified context and flash file
Parameters:
  file - file to be used when processing this script
Parameters:
  context - context to be used when processing this script
exception:
  IVException -



removeAllInstances
public void removeAllInstances(Frame lastFrame)(Code)
Removes all hanging instances of the timeline in the specified frame

Traverses this script and for every hanging instance (instance which is still on the timeline by the last frame) puts RemoveObject tag in the specified frame.
Parameters:
  lastFrame - frame to put RemoveObject tags in




removeFileDepGlobalCommands
public void removeFileDepGlobalCommands()(Code)
Removes global commands from this script which have to appear only once in a file. For example: MovieSetCommand

Usually all templates loaded into another one need to have these global commands stripped out




reserveLayers
public int reserveLayers(int from, int num)(Code)
Reserves specified number of layers beginning from the specified one

Traverses the timeline and moves all the instances which are on layers greater than the specified one by the specified number.

For example if we have instances A, B, C, D on layers 2,3,4,5, then if we call reserveLayers(3,2) we will have: A on 2, B on 5, C on 6, D on 7, so there will be two available layers depths: 3 and 4.
Parameters:
  from - reserve layers beginning from this one
Parameters:
  num - number of layers to be reserved 'from' layer




resetMain
public void resetMain()(Code)
Sets this script to be NOT main script



setBackgroundColor
public void setBackgroundColor(SetBackgroundColor bkgColor)(Code)
Sets new background color
Parameters:
  bkgColor - new color



setMain
public void setMain()(Code)
Sets this script to be main



setProcessed
public void setProcessed()(Code)
Marks this script as processed



write
public void write(FlashOutput fob)(Code)
Writes content of this script to flash buffer

This method has to be used only if this script is NOT a main script.
Parameters:
  fob - flash buffer to write
See Also:   Script.isMain
See Also:   Script.generate




Methods inherited from org.openlaszlo.iv.flash.api.FlashDef
protected FlashItem copyInto(FlashItem item, ScriptCopier copier)(Code)(Java Doc)
public int getID()(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public void setID(int id)(Code)(Java Doc)
public void setName(String name)(Code)(Java Doc)

Methods inherited from org.openlaszlo.iv.flash.api.FlashObject
protected boolean _isConstant()(Code)(Java Doc)
public void apply(Context context)(Code)(Java Doc)
public void collectDeps(DepsCollector dc)(Code)(Java Doc)
public void collectFonts(FontsCollector fc)(Code)(Java Doc)
protected FlashItem copyInto(FlashItem item, ScriptCopier copier)(Code)(Java Doc)
public void generate(FlashOutput fob, DepsCollector dc)(Code)(Java Doc)
public Rectangle2D getBounds()(Code)(Java Doc)
abstract public int getTag()(Code)(Java Doc)
public boolean isConstant()(Code)(Java Doc)
public boolean isProcessed()(Code)(Java Doc)
public void printContent(PrintStream out, String indent)(Code)(Java Doc)
public void process(FlashFile file, Context context) throws IVException(Code)(Java Doc)
protected void setConstant(boolean is_const)(Code)(Java Doc)
public void setProcessed()(Code)(Java Doc)

Methods inherited from org.openlaszlo.iv.flash.api.FlashItem
protected FlashItem copyInto(FlashItem item, ScriptCopier copier)(Code)(Java Doc)
public FlashItem getCopy(ScriptCopier copier)(Code)(Java Doc)
abstract public void printContent(PrintStream out, String indent)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
abstract public void write(FlashOutput fob)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.