credits.swf
A scrolling credits roll dialog shown in Trove when the player views the game credits. It displays HTML-formatted credits text that auto-scrolls upward at a fixed speed, ending with a callback to the game engine. On console builds a close button (B button icon) is also shown.
Document/main class: Credits (extends _kiwi.Core.UIComponent) — no top-level embed; dialog content is via Credits_fla.Dialog_1 (embeds symbol33 from /_assets/assets.swf)
SWF-specific classes: 12
Main class: Credits
Credits is the root UIComponent for the credits screen. Its constructor wires up the close button and, when running inside the Iggy runtime, registers an OnRequestClose ExternalInterface callback. On non-console platforms the iconClose (Xbox B-button glyph) is hidden. Data arrives via the text setter — once set it triggers a full redraw and starts the scroll animation. The engine writes text as a property (it is in no addCallback list), passing the whole of Credits.txt: the file named by $Credits_Filename ("Credits.txt"), which sits in the game's install root rather than under ui/. The string keeps the file's byte-order mark as a leading U+FEFF.
Key fields
dialog : MovieClip— public reference to theDialog_1timeline symbol; contains the header, close button,mainContent(scroll area), andiconClose.ScrollSpeed : Number = 70— pixels per second the credits text scrolls upward (constant).scrolling : Boolean— unused in the current code; scroll state is inferred from listener presence.lastFrameTime : int— timestamp captured eachENTER_FRAMEtick viagetTimer()for delta-time scroll calculation._text : String— the raw HTML credits string received from the engine.
Frame scripts / timeline
Credits_fla.Dialog_1 installs frame scripts via addFrameScript indirectly through BtnGreen (frames 9, 19, 29, 39 — all call stop()), corresponding to the four button states (up, over, down, disabled) of the green close button.
Runtime dependencies & integration
IggyFunctions.inIggy— checked in constructor; iftrue,ExternalInterface.addCallback("OnRequestClose", onRequestClose)registers the close handler so the C++ game layer can trigger it.ExternalInterface.call("OnRequestClose")— fired when the user clicks the close button (or the engine calls the callback). Signals the game to dismiss the credits screen.ExternalInterface.call("OnCreditsRollFinished")— fired byonEnterFramewhen the credits text has fully scrolled past the top boundary (creditsFinished()returnstrue). Notifies the game engine that the roll is complete.Event.ENTER_FRAME— listener added indraw()when new text data arrives; drives per-frame delta-time scrolling; removed when roll finishes.InvalidationType.DATA— standard Kiwi invalidation flag; triggersdraw()override which resets scroll position, setshtmlTexton the text field, auto-sizes it (textfield.height = textfield.textHeight), and restarts the enter-frame loop.configUI()/setupTranslation()—configUIoverride calls the inheritedsetupTranslation()to apply localized string substitutions.- translate keys (set in
Dialog_1component properties):$Credits_Header— window header title string.$Close_ButtonLegend— label on the green close button.
IsConsole()— global function (not in this SWF's source; injected by runtime or framework) used to conditionally show/hide theiconCloseconsole button glyph.
Other game-specific classes
Credits_fla.Dialog_1— timeline symbol class (embedssymbol33from/_assets/assets.swf); the main dialog shell containing aWindowHeader(__id0_, title$Credits_Header), aBtnGreenclose button (label$Close_ButtonLegend), abtn_console_easticon (iconClose), and amainContentMovieClip holding the scrollingtextfield.BtnGreen— (embedssymbol19from/_assets/assets.swf) extends_kiwi.Controls.LabelButton; 40-frame button with 4 states (up/over/down/disabled), each halted by astop()frame script. Used as the close button.btn_console_east— bareMovieClipsubclass; represents the console East-button (B) glyph shown on console builds next to the close button.- 8 embedded bitmap asset classes (pure
BitmapDatawrappers, no logic):trionteam2018(1230×813 jpg),team_photo(800×400 jpg),bsgstudio(828×315 jpg),trionteam(980×702 jpg),grannylogo.png(2255×864 png),wwise_logo(679×204 png),iggylogo.jpg(1079×1379 jpg),binklogo.jpg(1500×1518 jpg), plusbtn_XBOne_B.png(64×64 png). These are embedded image assets for display within the scrolling credits content area.
Notable logic
- Delta-time scroll:
onEnterFramecomputes elapsed seconds as(getTimer() - lastFrameTime) / 1000and subtractsScrollSpeed * elapsedfrom the text field's Y position each frame, giving frame-rate-independent scrolling at 70 px/sec. - Scroll reset:
resetCreditsRoll()positionstextfield.ybelow the bottom of theboundsclip, so text starts off-screen and scrolls up into view. - Finish detection:
creditsFinished()checks whetherbounds.y > mainContent.textfield.y + mainContent.textfield.height— i.e., the bottom edge of the text has scrolled above the top of the visible area — then firesOnCreditsRollFinishedand removes the enter-frame listener. - Disabled close during scroll: The close button starts disabled (
closeButton.enabled = false) in the constructor and is only re-enabled oncetextis set (i.e., real content has arrived from the engine). - HTML content: Credits text is set via
htmlText, allowing the game engine to pass rich-text HTML as the credits payload.Credits.txtuses exactly two tags:<font size="…">for headings (sizes 22, 20 and 18) and<img src="…" width="…" height="…">, whosesrcis the class name of one of the embedded bitmaps — that is how the photographs and logos appear in the roll. Seven are referenced;bsgstudiois embedded but unused by the current file.