lockbox.swf
The Loot Box (lock box) opening window in Trove. Displays the current box item, unlock buttons (golden key and free/Flux), a karma progress meter with particle explosion effects, the resulting reward item, and an auto-open checkbox. Appears whenever the player interacts with an openable loot box.
Document/main class: LockBox (extends _kiwi.Core.UIComponent)
SWF-specific classes: 6 (plus 4 LockBox_fla timeline symbols and several asset/rarity wrappers)
Main class: LockBox
LockBox is the root component. The constructor wires up frame scripts for frames 0 and 10, forces btn_unlock_key visible, clears result display, creates and positions an ExplodingProgressBar over the karma meter area, hides karmaMeter, and initialises component inspector properties via five __setProp_* helpers. configUI() configures the shine timer (10 s interval), highlights the box-name text field, and registers all ExternalInterface callbacks; on non-Iggy preview it calls setLockBoxKarma(69,70) and wires a test unlock. draw() responds to STATE invalidation by enabling/disabling btn_unlock_free once any pending reward timer has finished.
Public methods
set canOpen(value:Boolean) : void— stores flag and invalidatesSTATE, which re-evaluatesbtn_unlock_free.enabledindraw(). Nothing in the SWF calls it; the engine assigns it as a property.clearResults() : void— hidesresultDisplay, blanks result text and sets slot data to -1 with the "brown" frame.
Key fields
btn_unlock_key : MovieClip— golden key unlock button; click callsOnUpgradeKey(sound:Play_ui_window_click_button).btn_unlock_free : MovieClip— free (or Flux) unlock button; click callsOnUpgradeFree; enabled only whencanOpen && !waitOnTimer.winHeader : WindowHeaderSmall— title bar;allowFontResize = true; title key"$Lockbox_Header".m_boxName : TextField— box name label; highlighted viaHighlightUtil.highlightMovieClip. The SWF never sets its text: the engine writes the box name into it directly.slot_currentItem : Slot— displays the box being opened; quantity badge showsitemsAvailable; activates slot 1 on update.resultDisplay : MovieClip— containsslot_resultItem(Slot) andtxt_resultDetails(TextField); shown after unlock resolves.frame : MovieClip— decorative frame; plays "shine" animation on a 10 s timer.karmaMeter : MovieClip— containskarmaMask; masked by itself; visible only when max karma > 0. Tooltip keys:"$LockboxTooltip_KarmaDesc"/"$GemTooltip_Karma_Bar_Title".progressBar : ExplodingProgressBar— particle explosion overlay on the karma bar; positioned at(72, 540).m_autoOpenCheckBox : Checkbox— label"$Lootbox_AutoOpen"("Auto Open Until Rare"); label cleared to""on console. The SWF has no handler for it: the engine readscheckedwhen the SWF sendsRequestApplyUnlockOptions(see Notable logic).buttonLegend : MovieClip— console button hint; navigated to"KeyOpen"frame viagotoKeyOpenButtonLegend.shineTimer : Timer— 10 000 ms, 1 repeat; triggers frame "shine" animation loop.rewardTimer : Timer— 400 ms (Uncommon) or 1000 ms (Rare) one-shot; delays re-enabling unlock buttons after a reward animation.waitOnTimer : Boolean— blocksbtn_unlock_freere-enable untilrewardTimerfires.itemsAvailable : int— quantity of boxes remaining; shown onslot_currentItem.quantityBadge._canOpen : Boolean— backing field forcanOpensetter.
Frame scripts / timeline
- Frame 0 (
frame1) —stop(). PC layout. - Frame 10 (
frame11) —stop(). Console layout (child clips expected to handle console display internally). - Stage 500×587 at 60 fps, 20 frames.
Private methods of note
onGoldenKeyUnlock(e:MouseEvent)— disables both buttons, updates quantity badge, firesPOST_SOUND_EVENT("Play_ui_window_click_button")andOnUpgradeKey.onFreeUnlock(e:MouseEvent)— same flow, firesOnUpgradeFree.showResultItem(icon, name, band, qty, showQty, rarityId, color, quality)— configuresresultDisplay.slot_resultItem(size 70, quantity, quality, andrarityIdas the slot rarity unlessshowQtyis true, which forces 0); does nothing whenqtyis 0.bandis"Common","Uncommon"or"Rare": the box's own tier for this pull, which drives the karma bar, the sound and the timer, and is not the item's rarity (that israrityId, withcolorthe item's name colour). The band picks a prefix key that is prepended to$LockBox_Got; formatstxt_resultDetailsas HTML with colored item name; forrarityId6 (Rarity_Resplendentin this SWF'sSlottable) callsrainbowify(); sets result Y based on text height; fires per-band sound event; startsrewardTimerfor Uncommon/Rare.setLockBoxItem(icon, count)— setsslot_currentItem.iconImage, shows/hides quantity badge, sets size to 55, callsExternalInterface.call("SLOT.ACTIVATE", 1). The engine re-sends it as boxes are used, socounttracks the remaining stock; a differenticonalso clears the previous result.setLockBoxKarma(current, max)—maxis the number of boxes after which a rare result is guaranteed (the loot-probability text gives 70, or 35 with Patron); shows/hides meter and repositionsresultDisplay.y(504 if meter shown, 522 if not); atcurrent == max-1callsprogressBar.initParticles("KarmaParticle", 3); at rollover (current==0, meter shrinking) callsprogressBar.start(); setskarmaMask.scaleX = current/max.recheckUnlockOptions()— callsRequestApplyUnlockOptionsto let the game re-evaluate which buttons should be enabled.shine(e:TimerEvent)— plays "shine" onframeMovieClip, resets and restarts timer.gotoKeyOpenButtonLegend()— navigatesbuttonLegendto "KeyOpen" stop frame.rainbowify(field, start, end)— applies a 6-color rainbowTextFormatcycle (red→orange→yellow→green→cyan→lavender) to a character range in a TextField. Used for Stellar/special rarity result text.
Runtime dependencies & integration
- Iggy callbacks registered:
setLockBoxItem,showResultItem,setLockBoxKarma,onGoldenKeyUnlock,onFreeUnlock,gotoKeyOpenButtonLegend. - ExternalInterface calls out:
POST_SOUND_EVENT(with event namesPlay_ui_window_click_button,Play_ui_lockbox_common,Play_ui_lockbox_uncommon,Play_ui_lockbox_rare),OnUpgradeKey,OnUpgradeFree,RequestApplyUnlockOptions,SLOT.ACTIVATE. The engine queues everyOnUpgradeFreeit receives and nothing the SWF can send recalls a queued open. - IggyTween: not used directly in LockBox;
ExplodingProgressBaruses the flint particle library instead. - translate keys:
"$Lockbox_Header"(winHeader title),"$Lootbox_AutoOpen"(checkbox),"$Lockbox_OpenButton"(free button label),"$LockBox_Common","$LockBox_Uncommon","$LockBox_Rare","$LockBox_Got","$LockboxTooltip_KarmaDesc","$GemTooltip_Karma_Bar_Title". The four result keys are written$LockBox_in the code; the shipped language files contain no$LockBox_key and spell them$Lockbox_Common("Nice! "),$Lockbox_Uncommon("Sweet! "),$Lockbox_Rare("Lucky! ") and$Lockbox_Got("You got"). - org.flintparticles library used by
ExplodingProgressBarfor karma-bar explosion effect. IsConsole()checked to clear auto-open label text.
Other game-specific classes
ExplodingProgressBar— standaloneMovieClipthat wraps the flintEmitter2D/DisplayObjectRendererpipeline. Takes progress bar dimensions in the constructor;initParticles(prefix, count)instantiates particle MovieClips by name (KarmaParticle0–KarmaParticle2) viagetDefinitionByName, tiles them across the bar width, and pre-builds a cascade ofGravityWell+Explosion+LinearDrag+DeathZoneactions.start()makes the renderer visible, starts the emitter, and fires the explosion timer (500ms / NUM_EXPLOSIONS intervals, 20 explosions total).
LockBox_fla timeline symbols
LockBox_fla/frame_1— Embed symbol120; decorative frame clip; stops at frame 78 (end of shine animation).LockBox_fla/slotFrame_5— Embed symbol86; two-frame slot border clip (states 1/2).LockBox_fla/equipped_7— Embed symbol90; two-frame equipped indicator clip.LockBox_fla/qualityPips_13— Embed symbol104; quality pip display; stops on frame 1.LockBox_fla/buttonLegend_24— Embed symbol137; console button legend; exposesbutton_y(btn_console_north),button_console_east,button_a(btn_console_south); two stops (frame 0 PC, frame 10 console layout).
Particle assets (game-specific, top-level)
KarmaParticle0,KarmaParticle1,KarmaParticle2— three particle sprite MovieClips used byExplodingProgressBar.initParticles.meter_karma,slot_large,btnKey,btnGreen— embedded symbol wrappers for UI elements.btn_console_east,btn_console_north,btn_console_south— console button prompt symbols.
Asset wrappers (rarity frames — not individually documented)
18 rarity frame symbols (rarity_frame_common_png, rarity_frame_uncommon_png, rarity_frame_rare_png, rarity_frame_epic_png, rarity_frame_legendary_png, rarity_frame_relic_png, rarity_frame_shadow_png, rarity_frame_radiant1_png, rarity_frame_resplendent_png, rarity_frame_stellar, plus _over variants) — pure bitmap/shape wrappers, not individually documented.
Notable logic
- Karma rollover detection:
setLockBoxKarmachecks whether the meter is shrinking (current == 0 && scaleX > 0 && scaleX < 1) to fire the particle explosion; this handles the karma bar resetting at the start of a new karma tier. - Reward timer gating:
waitOnTimerprevents the unlock buttons from being prematurely re-enabled during a rarity animation (400 ms for Uncommon, 1 000 ms for Rare).recheckUnlockOptionsis called both fromCommonrarity handling (immediate) and from the timer callback. - Two-step unlock button label:
btn_unlock_freelabel is"$Lockbox_OpenButton"(free unlock);btn_unlock_keyhas no label — it is icon-only (key image embedded in the MovieClip skin). - Rainbow rarity (ID 6):
Rarity_Resplendent(6 in this SWF's_kiwi.Controls.Slottable, which runs Common 0 … Resplendent 6, Shadow1–5 7–11, Radiant/Stellar interleaved 12–21, Crystal1–5 22–26) applies alternating TextFormat color segments in a 6-step rainbow cycle to the item name portion oftxt_resultDetails. - Auto Open Until Rare is the engine's loop: a press sends
OnUpgradeFree; the engine answers withshowResultItem; the SWF then sendsRequestApplyUnlockOptions(at once for a Common pull, after the 400 ms / 1000 ms reward timer for Uncommon / Rare); the engine readsm_autoOpenCheckBox.checkedand, if set, callsonFreeUnlockagain. The reward timers are therefore what paces auto-opening.