pvpscorecard.swf
End-of-match scorecard displayed after a PVP battle in Trove. Shows both teams' player scores (kills, deaths, captures, returns), a victory/defeat header, team names and aggregate scores, a PVP meta-level progress bar, the match's bronze/silver/gold/first-blood reward counts, and buttons to exit or play again.
Document/main class: PVPScoreCard (extends _kiwi.Core.UIComponent)
SWF-specific classes: 8
Main class: PVPScoreCard
PVPScoreCard is the root document class. Its constructor registers frame scripts for frames 0, 10, and 20, hides the header and victory banner until a winner is declared, sets up the PVP meter mask, and calls setupTranslation(). On console, it also initializes teamScoresUpdated tracking and registers an ENTER_FRAME listener that waits until the component reaches its target frame before calling showLegend(false) and then (if a victor has already been set) calling setVictor. In configUI() all game callbacks are registered via ExternalInterface.addCallback; in the Flash IDE preview path a set of dummy players and metadata are added for testing.
Public methods
reset() : void— clears all player rows from both team lists (or resetsteamScoresUpdatedcounters on console).setVictor(param1:int) : void— wires the Exit/Play-Again button click listeners, makes the header visible, hidesfooterMask, and shows the button legend.hasVictor() : Boolean— returnstruewhenwinningTeam != -1.showLegend(param1:Boolean) : void— toggles visibility ofplayAgainButton,playAgainTextField, andButtonLegendClose.setPVPMetaData(oldLevel, newLevel, oldPercent, newPercent, battleBoxes, battleFactor) : void— animates the PVP metermaskShape.scaleXfromoldPercenttonewPercentusing two sequentialIggyTweencalls (with optional level rollover); updatestxtMetalevelandtxtBattleBoxes.setRewardInfo(blood:int, bronze:int, silver:int, gold:int, p5:int, p6:int) : void— stores the four reward quantities in the staticrewardQuantities(indexed by thePVPRewards.FRAME_*constants) and refreshesrewardsContainer. The fifth and sixth arguments are accepted but not read.setViewerRewardTier(tier:int, firstBlood:Boolean) : void— stores the viewer's reward tier (aPVPRewards.FRAME_*value) inrewardToHighlightand the first-blood flag inviewerFirstBlood, then refreshesrewardsContainer.addTeamScore(team:int, color:uint, score:int) : void— sets the appropriateteamScoreNTextField color (color is passed ascolor >> 8) and text.overrideColumnHeaders(...rest) : void— writes up to 4 strings into thecolumnNTextFields on bothteamHeader1andteamHeader2.addPlayerScore(team, isLocal, name, c0, c1, c2, c3) : void— creates or updates aScoreListingrow in the appropriate team list. On console in update mode it finds an existing row by username and repositions it. WhenisLocalis true, repositions team header/score/list MovieClips for both teams, navigatesteamNameandteamHeaderclips to the correct frame, refreshesrewardsContainer, and queues anEvent.RENDERhandler.exitClicked(e:MouseEvent) : void— callsExternalInterface.call("OnRequestClose").playAgainClicked(e:MouseEvent) : void— callsExternalInterface.call("OnPlayAgain").onRender(e:Event) : void— recalculates x-position of both team score TextFields based on team-name label width; callssetupTranslation().
Key fields
header : MovieClip— victory/defeat banner; hidden untilsetVictoris called.teamName1 / teamName2 : MovieClip— team name clips (headerFrame_2); framed by team index. Both start on frame 1, which reads YOUR TEAM, until the local player's row arrives; thenteamName1goes to frameteamandteamName2to frameteam + 2.teamHeader1 / teamHeader2 : MovieClip— column header clips (containcolumn0–column3TextFields viaheaderClip_23).teamList1 / teamList2 : MovieClip— containers that holdScoreListingrows as children, stacked aty = 32 * index.teamScore1 / teamScore2 : TextField— aggregate score displays.pvpMeter : MovieClip— containsfillandmaskShape; mask applied in constructor. Animated bysetPVPMetaData.txtMetalevel : TextField— current PVP meta level.txtBattleBoxes : TextField— battle box count (format:n/factor).btnExit : LabelButton— label"$Scorecard_ExitGame"; listener attached when a victor is set.btnPlay : LabelButton— label"$Scorecard_NewGame"; listener attached when a victor is set.footerMask : MovieClip— masks the footer area until game ends.winningTeam : int— starts at -1; set bysetVictor.allPlayersAdded : Boolean— set byinitialScoresAdded(); switches console update path.teamScoresUpdated : Array— per-team row counters used for console re-ordering.TWEEN_TIME : Number = 1— total seconds for PVP meter fill animation.rewardsContainer : PVPRewards— the reward strip, a root child placed just aboveteamName2.rewardQuantities : Array(static) — reward counts indexed byPVPRewards.FRAME_*.rewardToHighlight : int(static, default -1) — the viewer's reward tier.viewerFirstBlood : Boolean(static) — whether the viewer earned first blood.
Frame scripts / timeline
- Frame 0 (
frame1) —stop(). PC layout. - Frame 10 (
frame11) —stop(). Console layout: tellsteamHeader1/2,header,teamName1/2,btnExit,btnPlaytogotoAndPlay("Console"). - Frame 20 (
frame21) —stop(). Same console child redirections as frame 10 (second console variant).
Runtime dependencies & integration
- Iggy callbacks registered:
reset,setVictor,setPVPMetaData,addTeamScore,overrideColumnHeaders,addPlayerScore,hasVictor,initialScoresAdded,setRewardInfo,setViewerRewardTier. - ExternalInterface calls out:
OnRequestClose,OnPlayAgain,RequestRewards(from thePVPRewardsconstructor). - IggyTween: used in
setPVPMetaDatafor the progress-bar fill animation. - translate keys:
"$Scorecard_ExitGame","$Scorecard_NewGame"(set on buttons via__setProp_*). setupTranslation()called on construction and re-render.IsConsole()checked in constructor,addPlayerScore,reset,setVictor.
Other game-specific classes
ScoreListing— Embed symbol18; represents one player row. Constructor accepts (name, c0–c3 strings, isLocal).setScoreTextsetstxt_kills,txt_deaths,txt_captures,txt_returns; ifisLocalis true, sets all fields to white (#FFFFFF). Two timeline frames (0 and 10) for PC/console layout.PVPScoreCard_fla/headerFrame_2— Embed symbol101; the team-name clip placed asteamName1andteamName2; containstxt_label; frames 1–5 are labelledPC, 6–10Console, stops at frames 5 and 10. PC frames: 1$Scorecard_YourTeamHeaderName("YOUR TEAM") in red, 2 the same in blue, 3$Scorecard_EnemyNameTitle("ENEMY TEAM") in blue, 4 the same in red.PVPScoreCard_fla/headerVictoryDefeat_21— Embed symbol114; theheadervictory/defeat strip withtxt_label; frames 1–5PC, 6–10Console, stops at frames 5 and 10. The local-player branch ofaddPlayerScoresends it to frame 1 ($Scorecard_Victory) when the local team iswinningTeam, otherwise frame 2 ($Scorecard_Defeat).PVPScoreCard_fla/headerClip_23— Embed symbol130; four-column header row withcolumn0–column3TextFields; four stopping frames (one per team × layout variant).PVPRewards(extendsUIComponent) — Embed symbol85; the reward strip. Holds four slotsreward0–reward3, each with anicon(rewardIconLarge_19), arewardCountTextField, ananimationclip and anartPreviewContainer. Frame constants:FRAME_BRONZE = 1,FRAME_SILVER = 2,FRAME_GOLD = 3,FRAME_BLOOD = 4; slots are shown in the order blood, bronze, silver, gold.update()sends eachiconto its tier frame, writes the matchingrewardQuantitiesentry intorewardCount, and showsanimationon the slot whose tier equalsrewardToHighlight(on the blood slot, whenviewerFirstBloodis true). The constructor callsupdate()and thenExternalInterface.call("RequestRewards").PVPScoreCard_fla/rewardIconLarge_19— Embed symbol80; four-frame reward icon (each framestop()), framed byPVPRewards.update().PreviewContainer(extends_kiwi.Core.ObjectPreview) — Embed symbol51; theartchild of each reward slot. No code in this SWF sets it: the engine writes itstextureNameby path,rewardsContainer.reward{0}.art, where{0}is the slot index iniconFrameOrderorder (0 blood, 1 bronze, 2 silver, 3 gold).- Asset wrappers:
btnGreen,btnGreenIcon_small— 2 button skin symbols.
Notable logic
- Score positioning:
getScorePositioncomputes the x of each team-score TextField by reading the team-name label'stextWidth, centering the score under the team name. This is deferred toEvent.RENDERso Flash has laid out the text first. - PVP meter rollover:
setPVPMetaDatadetects a level rollover (newPercent <= oldPercent), splits the animation at the1.0boundary, resetsmaskShape.scaleXto 0 and updatestxtMetalevelmid-tween via a closure. - Console update path: after
initialScoresAdded()is called,addPlayerScoreswitches to finding and repositioning existingScoreListingchildren (keyed bytxt_userName) rather than appending new ones, enabling live score updates during a match. - Reward strip (October 2026 build): the engine answers
RequestRewardswithsetRewardInfoand marks the viewer's own result withsetViewerRewardTier; every call re-runsPVPRewards.update(), as does the local-player branch ofaddPlayerScore. - Color encoding quirk:
addTeamScoreshifts the incoming color right by 8 bits (param2 >> 8) before applying it totextColor— the game passes color as a shifted 32-bit value.