communityleaderboard.swf
The Community Leaderboard is a voting UI panel that lets players browse and vote for items — the Fluxion vote: its title field is authored as
$FluxionStore("Fluxion"), and$FluxionStore_Descriptiondescribes it as an every-other-week vote on Luxion items deciding what shows up the following week. It shows up to five item tiles in a carousel, tracks per-player and global vote counts, and handles a currency-based vote-purchase flow.
Document/main class: CommunityLeaderboard (extends UIComponent)
SWF-specific classes: 10 (excluding shared framework)
Main class: CommunityLeaderboard
CommunityLeaderboard is the root UI component that manages the leaderboard carousel. On initialisation (configUI) it registers all Iggy/ExternalInterface callbacks so the game engine can push data in, wires mouse listeners to the five ItemView tile instances and the left/right navigation arrows, and seeds the initial display state. It owns two parallel data collections: itemObjects (the full server-provided entry list) and displayTiles (the five visible ItemView instances that serve as a sliding window into that list).
Public methods
SetLeaderboardData(name, desc, voting, nextStateChange, ?, locked, hasHistory, voteCostDesc) : void— populates header and info-box text fields; stores state flags for voting/locked/history; triggersSetInfoData.AddEntry(name, desc, canBuy, voting, costPrefab, voteCost, userVotes, totalVotes, voteCostDesc, voteId, texture, costTexture, tradeable) : void— creates a newItemView, callsSetupItem, appends it toitemObjects, and shows nav arrows when more than five entries exist.ClearEntryList() : void— emptiesitemObjectsand hides nav arrows.RefreshDisplay() : void— re-maps the visible tiles to the current window position and re-draws selection state.SelectItemsToDisplay() : void— copies data fromitemObjectsinto the fivedisplayTilesusing modular arithmetic aroundcurrentSelection.ShiftDirection(right:Boolean) : void— moves the carousel one step left or right. On PC it clampscurrentTileto 0–4 and shifts the backing list when at an edge; on console it always re-centres on tile 2 and immediately shifts the backing list. After moving it callsCanBuyandRequestWalletInfoon the newly focused tile.SetMode(param1:Boolean) : void— whentrue, re-centres selection on tile 2. It shiftscurrentSelectionby2 - currentTile, the opposite of what keeps the highlighted entry under tile 2 (onlycurrentTile == 2is unaffected), and does not re-map the tiles (SelectItemsToDisplayis not called).UpdateEntryCost(voteId, cost, userVotes, totalVotes, canBuy) : void— finds the entry byvoteIdin bothitemObjectsanddisplayTilesand refreshes vote counts and the purchase button.
Key fields
itemObjects : Vector.<ItemView>— master list of all leaderboard entries received from the server.displayTiles : Vector.<ItemView>— the fiveItemViewinstances visible on screen (Tile1–Tile5).currentSelection : int— index intoitemObjectsof the entry currently mapped to the left edge of the window.currentTile : int— index (0–4) of the highlighted tile;-1when nothing is selected._voting : Boolean— whether the leaderboard is currently in voting phase._locked : Boolean— whether the voting window has closed._hasHistory : Boolean— whether historical results are available._hasPendingVote : Boolean— blocksPurchaseRequestcalls while a vote is in-flight._nextStateChange : String— human-readable countdown to the next phase transition (displayed inInfoBox)._leaderboardName / _leaderboardDesc : String— title and description text._voteCostDescription : String— currency description for vote cost.walletImage : ObjectPreview— 40×40 icon for the current wallet currency, embedded insidewallet.priceDisplay.preview.wallet : MovieClip— wallet display area containingpriceDisplay(awalletPriceDisplay_16timeline symbol).displayProgress : MovieClip— blocking overlay (aBlockingStatus_17symbol) shown while a server request is in-flight.InfoBox : MovieClip— panel showing leaderboard state, countdown, and description text.LeaderboardTitleHeader : MovieClip— animated title header.btn_left / btn_right : MovieClip— carousel navigation arrows, visible only when more than 5 entries exist.
Frame scripts / timeline
No custom addFrameScript calls in the main class. Navigation buttons use gotoAndStop("over") / gotoAndStop("up") for hover states. Single frame on a 1200 × 800 stage; the wooden window frame occupies x 38–1137, y 16–747, with the title plaque above it.
Runtime dependencies & integration
ExternalInterface callbacks registered (Iggy → Flash):
| Callback name | Handler |
|---|---|
ShiftSelection |
ShiftDirection |
SetLeaderboardData |
SetLeaderboardData |
AddEntry |
AddEntry |
ClearEntryList |
ClearEntryList |
RefreshDisplay |
RefreshDisplay |
SetMode |
SetMode |
Purchase |
onPurchase |
UpdateEntryCost |
UpdateEntryCost |
HasPendingVote |
HasPendingVote |
SetDisplayProgress |
SetDisplayProgress |
UpdateEntryCanPurchase |
UpdateEntryCanPurchase |
SetWalletIcon |
SetWalletIcon |
ExternalInterface calls made (Flash → Iggy/game):
CanBuy(voteId)— queries whether the player can currently vote for the focused entry.RequestWalletInfo(voteId)— requests currency balance update for the focused entry.PurchaseRequest(voteId)— submits a vote purchase; only fires if_hasPendingVoteis false.ReapplyVotes()— sent only from the privateReApplyVotes(MouseEvent)handler, which nothing attaches as a listener, so the call is never made.SetFocused(bool)— tells the engine whether focus is on the info panel or the tile selection.
Translate keys used:
$CL_StateChange("Hours Remaining") — label for the "time remaining" info box line.$CommunityLeaderboard_Voting/$CommunityLeaderboard_Displaying("Voting" / "Buying")$CommunityLeaderboard_VotingEnded/$CommunityLeaderboard_DisplayingEnded("Voting ended" / "Buying ended")$CommunityLeaderboard_PlayerVotes/$CommunityLeaderboard_GlobalVotes("Your Vote Count:" / "Global Vote Count:", inItemView)
Other game-specific classes
ItemView (extends UIComponent) — [Embed symbol "symbol58"]
A single leaderboard entry tile. Holds all per-entry data (_itemName, _voteId, _itemvoteCost, _numberOfUserVotes, _numberOfTotalVotes, _canBuy, _voting, _tradeable, etc.). Renders a 128×128 item preview (ObjectPreview) and a 40×40 cost-currency icon, per-player and global vote count text fields, a purchase button (LabelButton), a market-tradeable badge, and a hover-activated info popup (infoPopup). Key methods: SetupItem (full data load), Transfer (copy data from another ItemView), UpdateVoteText (refresh counts and purchase button), SelectTile (show/hide selection highlight), SetCanBuy (enable/disable purchase button).
btnGreenIcon_small (extends LabelButton) — [Embed symbol "symbol32"]
Green icon-label button skin used for the purchase button on each tile. Four-state timeline (frames 10/20/30/40 = up/over/down/disabled), each stopped by a frame script.
btnPageExtreme (extends LabelButton) — [Embed symbol "symbol11"]
Alternate label-button skin (used for page-navigation extremes). Same four-state timeline pattern as btnGreenIcon_small.
CommunityLeaderboard_fla timeline symbols (5 classes)
| Class | Symbol | Notes |
|---|---|---|
timer_pulse_anim_3 |
symbol73 | Single-frame stop; pulse animation for countdown timer. |
InfoPopup_11 |
symbol53 | Two-state MC (frames 1/11 stopped); exposes textField:TextField for item description on hover. |
walletPriceDisplay_16 |
symbol94 | Wallet currency row; exposes preview:MovieClip (for ObjectPreview child) and price:TextField. |
BlockingStatus_17 |
symbol108 | Two-state overlay (frame 11 = Console) with a statusMessage sub-MC; used as the displayProgress spinner. |
btnInfo2_10 |
symbol49 | Info icon button MC, four-state timeline; used as ItemView.infoButton. |
btn_skip_13 |
symbol89 | Four-frame MC (frames 1–4 each stopped); skip navigation button. |
Notable logic
- Carousel window arithmetic:
SelectItemsToDisplaymapsdisplayTiles[i]toitemObjects[(currentSelection + i) % itemObjects.length], creating a circular ring, so with fewer than five entries the tiles repeat items. Overflow wraps to 0; underflow wraps toitemObjects.length - 1(any negative value, not just −1, lands there). - PC vs. console navigation difference: On PC,
ShiftDirectionclampscurrentTilewithin the visible 5-tile strip and only scrolls the item list when hitting an edge. On console (IsConsole()),currentTileis always forced to 2 (centre) and the list scrolls immediately on every press. - Purchase guard:
onPurchasechecks_hasPendingVotebefore emittingPurchaseRequest. The game setsHasPendingVote(true)immediately and clears it after the round-trip completes, preventing double-votes. - Wallet display:
SetWalletIcon(textureName, priceText)populates thewalletImageObjectPreview and the price label; the wallet area is a child MC containing awalletPriceDisplay_16symbol. - State label logic:
GetStateText()produces a localised string from the 2×2 matrix of_voting×_lockedflags.