|
|
Search Tutorials
Ticker Template The basic structure of the ticker is several levels of nested clips. The inner-most nesting is a clip with only the blank template of text fields:
This is where a single ticker group is assembled. The first two frame contain actions that waits until it's sure all data is available by checking for the presence of "eof=1" as mentioned above. The third frame (see code below) uses a looped Duplicate Movie Clip action to create all the entries, then positions them in a fixed-spacing row. When it's done, it reports to the clip above it that it is finished.
Set Variable: "x" = 1
Set Variable: "clipwidth" = template:_width
Loop While (x <= /:itemcount)
Comment: Using a counter value (x) allows each clip to have a unique name.
Set Variable: "newclip" = "stock" & x
Duplicate Movie Clip ("template", newclip, x)
Set Property (newclip, Y Position) = "0"
Set Property (newclip, X Position) = (clipwidth + /:space) * (x-1)
Begin Tell Target (newclip)
Comment: Load this ticker entry's information from the "/" level. This will
need to be changed depending on how many variables you set for each entry.
Set Variable: "symbol" = eval("/:symbol" & ../:x) & ":"
Set Variable: "price" = eval("/:price" & ../:x)
End Tell Target
Set Variable: "x" = x + 1
End Loop
Set Variable: "../:" & _name & "done" = 1
Stop
|
||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||
|