tutorial.swf
A paginated tutorial / help slideshow panel shown to players when they first start Trove or enter a new game mode. It presents a series of slides (each a timeline frame in a
textAreaMovieClip) with prev/next navigation buttons, an optional image panel rendered viaObjectPreview, and a close button that appears only on the final page. Separate slide variants exist for the Welcome, Adventure, Build Mode, Tip, and Geode tutorial contexts.
Document/main class: Tutorial (extends _kiwi.Core.UIComponent)
SWF-specific classes: 17
Main class: Tutorial
Tutorial manages a multi-page slideshow. The textArea MovieClip's frame position drives which slide content is visible (currentPage + frameOffset). Navigation is handled locally for display updates but all page-change requests are forwarded to the game engine via ExternalInterface.call("OnSetPage", n) so the C++ side controls authoritative state; the Flash side receives onNext/onPrev/onExit callbacks back through ExternalInterface.addCallback.
Constructor calls addFrameScript for frames 1, 11, and 21 (all stop()), adds the ObjectPreview image to imgAnchor, captures original dimensions, wires click listeners to prevButton, m_backArrow, nextButton, and buttonCloseGreen, and registers the stage-resize and navigation Iggy callbacks.
configUI() is inherited from UIComponent. draw() pushes title and desc strings into textArea.titleField and textArea.descField text fields when the DATA invalidation flag is set.
Public methods
textRendered(e:Event) : void—Event.RENDERhandler fired aftertextArea.gotoAndStop; iteratestextFields<N>child containers on the current frame to resolve single-character$[X]escape sequences, and on frame 4 specifically lays out 7tutorialTipsub-clips by translating$Tutorial_tip_Nkeys viaIggyFunctions.translate, settinghtmlText, resizing height totextHeight, vertically centring the bullet, and stacking each tip below the previous one.
Key properties (getters/setters)
texture : String— setsimage.textureName; drives theObjectPreviewslide image.text : String— gets/sets the label text onbuttonCloseGreen.frameOffset : int(default1) — added tocurrentPagewhen callingtextArea.gotoAndStop; allows thetextAreatimeline to reserve frame 1 for a blank/default state.title : String— written totextArea.titleField; invalidates DATA.desc : String— written totextArea.descField; invalidates DATA.currentPage : int— core pagination setter: clamps to[0, numPages-1], controls visibility ofprevButton,nextButton,buttonCloseGreen,m_backArrow,consoleNextBtn/consoleBackBtnand their labels, updatesconsoleNextLabeltext between"$Tutorial_NEXT"and"$Tutorial_GO", then callstextArea.gotoAndStop(currentPage + frameOffset)and schedulestextRenderedviaEvent.RENDER.numPages : int— resetscurrentPageto 0 when changed.
Key fields
image : ObjectPreview— 690×408 texture display added toimgAnchor; shows slide artwork.screenFade : MovieClip— full-screen dark overlay; repositioned and resized in_onStageResizedto cover the viewport regardless of scale.nextButton : LabelButton— "Next" button, label$tutorial_window_next.prevButton : LabelButton— "Back" button, label$tutorial_window_back.m_backArrow : BaseButton— secondary back arrow (visible on last page ifcurrentPage > 0).buttonCloseGreen : BaseButton— "Close" / "Done" button shown only on the final page.textContainer : MovieClip— holdstxttext field; mouse interaction disabled.textArea : MovieClip— multi-frame content area; its child structure varies per frame and is accessed bytextRenderedastextFields<frameNumber>.consoleNextBtn / consoleBackBtn : MovieClip— console button prompts.consoleNextLabel / consoleBackLabel : TextField— console label text fields._frameOffset : * = 1— backing store forframeOffset._currentPage : int,_numPages : int— backing stores for pagination.__setPropDict : Dictionary— Flash component inspector helper; prevents double-initialisation ofnextButton/prevButtonper frame.
Frame scripts / timeline
- Frame 1 (
frame1) —stop()— default/standard tutorial layout. - Frame 11 (
frame11) —stop()— alternate layout (e.g. platform variant). - Frame 21 (
frame21) —stop()— second alternate layout.
__setProp_handler fires on Event.FRAME_CONSTRUCTED each frame; delegates to __setProp_nextButton_Scene1_leftrightbuttons_0 and __setProp_prevButton_Scene1_leftrightbuttons_0 which apply Flash component-inspector defaults (label, toggle, enabled, data) once per frame range.
Runtime dependencies & integration
- ExternalInterface callbacks registered:
UIComponent.onStageResized,onExit,onPrev,onNext. - ExternalInterface calls outbound:
OnSetPage(pageIndex)(prev/next navigation),OnRequestClose()(when Next is pressed on the last page). IggyFunctions.translate("$Tutorial_tip_N")called intextRenderedfor tip-frame localisation.vcenterTextfieldToClip(tf, clip)— non-class utility function called to vertically align tip text to its bullet icon.- Translate keys used:
$tutorial_window_back,$tutorial_window_next,$Tutorial_BACK,$Tutorial_NEXT,$Tutorial_GO,$Tutorial_tip_1through$Tutorial_tip_7. IsNX()check incurrentPagesetter forces console back-button to always be visible on Nintendo Switch.
Other game-specific classes
AdventureText(extendsUIComponent, embeds symbol155) — slide content symbol for Adventure mode tips; 3 frame states (1, 11, 21).WelcomeText(extendsUIComponent, embeds symbol220) — slide content symbol for the Welcome / intro screen; 3 frame states (1, 11, 21).BuildText(extendsUIComponent, embeds symbol104) — slide content symbol for Build Mode tutorial; 3 frame states (1, 11, 21).TipText(extendsUIComponent, embeds symbol57) — slide content symbol for the Tips page; 2 frame states (1, 11). Used astextFields4intextarea_3.BuildModeHeader(extendsUIComponent, embeds symbol60) — header banner displayed when entering Build Mode; 2 frame states (frame 1 stop, frame 10 stop).bullet(extendsUIComponent, embeds symbol55) — bullet-point icon used alongside tip text in the Tips slide; 2 frame states.btnArrowLeft(extendsBaseButton, embeds symbol39) — left arrow button skin (4 button-state frames: 10, 20, 30, 40).btnArrowRight(extendsBaseButton, embeds symbol9) — right arrow button skin (same 4-state structure).btnLeft(extendsLabelButton, embeds symbol20) — labelled left / "Back" button skin; 4 frame states.btnRight(extendsLabelButton, embeds symbol30) — labelled right / "Next" button skin; 4 frame states.
Tutorial_fla timeline symbols (6):
textarea_3(symbol247) — the primary multi-frame text-area MovieClip; exposestitleField:TextField,descField:TextField, and per-frame child referencestextFields1:WelcomeText,textFields2:AdventureText,textFields3:BuildText,textFields4:TipText,textFields5:TextField. Stops at frames 1 and 12.textareaLoc_21(symbol266) — localised variant oftextarea_3; same child structure minustitleField/descField; stops at frame 1.TutorialSlide1_11(symbol237) — slide 1 content symbol; 3 frame states.TutorialSlide2_12(symbol239) — slide 2 content symbol; 3 frame states.TutorialHubText_13(symbol240) — hub/world-map tutorial text symbol; 3 frame states.TutorialGeodeSlide1_14(symbol243) — Geode sub-biome tutorial slide; 3 frame states.
Notable logic
- Page navigation is split: Flash handles only visual state (button visibility,
textAreaframe); the canonical page index lives on the C++ side.onPrev/onNextcallExternalInterface.call("OnSetPage", n)rather than directly settingcurrentPage; the C++ side sendsonPrev/onNextback via registered callbacks to confirm, which then updatescurrentPage. - Tip layout (frame 4):
textRenderedhard-codes a loop overtutorialTip1–tutorialTip7sub-clips insidetextFields4. Each tip's text is set viaIggyFunctions.translate, its height is clamped totextHeight, the bullet icon is vertically centred, and the next tip'syis placed4pxbelow the current tip's bottom — a dynamic stack layout driven purely in ActionScript. $[X]escape: Single-character key escapes of the form$[A](4-character strings) in text fields are stripped to just the character at index 2. This appears to be a workaround for button-icon characters that cannot be stored directly in FLA text fields.frameOffset: Allows thetextAreatimeline to use frame 1 as a blank default; actual slide content starts at frameframeOffset(default 1, so page 0 → frame 1, page 1 → frame 2, etc.). The game can override this by setting the property before settingnumPages.- Screen fade resize:
screenFadeis positioned at(-w/scale, -h/scale)with size(4w/scale, 4h/scale)to guarantee full-screen coverage across all resolution scales.