Create a gist now

Instantly share code, notes, and snippets.

/*
* Source code for kraski-universal-blogplayer.swf (C) Yandex
*
* Decompiled using flaczki - https://github.com/chung-leong/flaczki
*
*/
package ru.yandex.kraski.universalpainter.preloader
{
public class KraskiPreloader extends flash.display::Sprite implements {mx.preloaders}::IPreloaderDisplay
{
//========================= Variables
private var preloaderImage : Loader;
public var preloaderSWF : String;
private var prevFrame : uint;
//========================= Methods
public static function KraskiPreloader()
{
return;
}
public function KraskiPreloader()
{
super();
return;
}
private function handleComplete(arg0:flash.events::Event)
{
return;
}
public Getter function stageHeight() : Number
{
return 700;
}
public Getter function backgroundImage() : Object
{
return null;
}
public Getter function backgroundSize() : String
{
return null;
}
public Setter function stageHeight(arg0:Number)
{
return;
}
public Getter function backgroundColor() : uint
{
return 0;
}
public function initialize()
{
var loc0:* = stage.loaderInfo.url;
var loc1:* = "";
var loc2:* = loc0.indexOf("?");
loc0 = loc0.substr(0, loc2);
loc2 = loc0.lastIndexOf("/");
loc0 = loc0.substr(0, loc2);
loc1 = loc0 + "/" + this.preloaderSWF;
this.preloaderImage = new Loader();
addEventListener(Event.COMPLETE, this.loader_completeHandler);
preloaderImage.load(new URLRequest(loc1));
return;
}
public Setter function backgroundImage(arg0:Object)
{
return;
}
public Setter function backgroundSize(arg0:String)
{
return;
}
public Setter function backgroundAlpha(arg0:Number)
{
return;
}
private function enterFrameHandler(arg0:flash.events::Event)
{
if(this.prevFrame == MovieClip(this.preloaderImage.content).currentFrame)
{
removeEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
dispatchEvent(new Event(Event.COMPLETE));
}
this.prevFrame = MovieClip(this.preloaderImage.content).currentFrame;
return;
}
private function handleInitProgress(arg0:flash.events::Event)
{
return;
}
public Getter function backgroundAlpha() : Number
{
return 0;
}
public Getter function stageWidth() : Number
{
return 1000;
}
private function handleInitComplete(arg0:flash.events::Event)
{
this.startEnterFrame();
return;
}
public Setter function stageWidth(arg0:Number)
{
return;
}
private function handleProgress(arg0:flash.events::ProgressEvent)
{
var loc0:* = 0;
if(this.preloaderImage.content)
{
loc0 = Math.round(arg0.bytesLoaded / arg0.bytesTotal * 100);
gotoAndStop(loc0);
}
return;
}
private function startEnterFrame(arg0:flash.events::TimerEvent = null)
{
var loc0:* = null;
if(this.preloaderImage && this.preloaderImage.content)
{
this.prevFrame = MovieClip(this.preloaderImage.content).currentFrame;
play();
addEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
}
else
{
loc0 = new Timer(2000, 1);
loc0.addEventListener(TimerEvent.TIMER, this.startEnterFrame);
loc0.start();
}
return;
}
public Setter function backgroundColor(arg0:uint)
{
return;
}
public Setter function preloader(arg0:flash.display::Sprite)
{
arg0.addEventListener(ProgressEvent.PROGRESS, this.handleProgress);
arg0.addEventListener(Event.COMPLETE, this.handleComplete);
arg0.addEventListener(FlexEvent.INIT_PROGRESS, this.handleInitProgress);
arg0.addEventListener(FlexEvent.INIT_COMPLETE, this.handleInitComplete);
return;
}
private function loader_completeHandler(arg0:flash.events::Event)
{
addChild(this.preloaderImage);
stop();
return;
}
}
public class BlogPlayerPreloader extends ru.yandex.kraski.universalpainter.preloader::KraskiPreloader
{
//========================= Methods
public static function BlogPlayerPreloader()
{
return;
}
public function BlogPlayerPreloader()
{
super();
this.preloaderSWF = "blogPlayerPreloader.swf";
return;
}
public Getter function stageWidth() : Number
{
return 500;
}
public Getter function stageHeight() : Number
{
return 560;
}
}
}
package [Global]
{
public dynamic class blogPlayAgainButton_skin extends mx.flash::UIMovieClip
{
//========================= Methods
public static function blogPlayAgainButton_skin()
{
return;
}
public function blogPlayAgainButton_skin()
{
super();
return;
}
}
public dynamic class blogDownloadButton_skin extends mx.flash::UIMovieClip
{
//========================= Methods
public static function blogDownloadButton_skin()
{
return;
}
public function blogDownloadButton_skin()
{
super();
return;
}
}
public dynamic class blogPaintYourselfButton_skin extends mx.flash::UIMovieClip
{
//========================= Methods
public static function blogPaintYourselfButton_skin()
{
return;
}
public function blogPaintYourselfButton_skin()
{
super();
return;
}
}
public dynamic class blogPlayerStartButton_skin extends mx.flash::UIMovieClip
{
//========================= Methods
public static function blogPlayerStartButton_skin()
{
return;
}
public function blogPlayerStartButton_skin()
{
super();
return;
}
}
public dynamic class blogGetCodeButton_skin extends mx.flash::UIMovieClip
{
//========================= Methods
public static function blogGetCodeButton_skin()
{
return;
}
public function blogGetCodeButton_skin()
{
super();
return;
}
}
public class BlogPlayer extends mx.core::Application implements {mx.binding}::IBindingClient
{
//========================= Variables
private static var _watcherSetupUtil : IWatcherSetupUtil;
public static var _BlogPlayer_StylesInit_done : Boolean = False;
private var _1763239082paintCanvas : PaintCanvas;
private var _235964214traceTarget : TraceTarget;
private var _2056864585isDebug : Boolean = False;
private var card : Card;
private var _1354231074playAgainButton : HandCursorButton;
private var _1631133009preloaderAftertaste : BlogPlayerPreloaderAftertaste;
private var _model : Model;
private var _embed_css__2093910380 : Class;
private var _159077850downloadButton : HandCursorButton;
private var _1704619147getCodeButton : HandCursorButton;
private var currentVisualIndex : int;
public var _bindingsByDestination : Object;
private var _1435122461loggerWrapper : UIComponent;
private var _embed_css__2078891259 : Class;
private var _318184504preview : Canvas;
private var loadLibraryController : LoadLibraryController;
private var _416447130screenshot : Image;
private var _1613058925playerStartButton : HandCursorButton;
private var _1937158641paintYourselfButton : HandCursorButton;
private var customCursorManager : CustomCursorManager;
private var loadConfigController : LoadConfigController;
public var _BlogPlayer_HBox2 : HBox;
public var _watchers : Array;
private var _embed_css__1502235314 : Class;
private var _1554553085viewstack : ViewStack;
private var paintTypes : PaintType;
public var _bindingsBeginWithWord : Object;
private var _embed_css__162016752 : Class;
private var _embed_css__1017935931 : Class;
private var player : Player;
private var cardXML : XML;
public var _bindings : Array;
private var _documentDescriptor_ : UIComponentDescriptor;
//========================= Methods
public static function BlogPlayer()
{
this._BlogPlayer_StylesInit_done = false;
return;
}
public function BlogPlayer()
{
this._documentDescriptor_ = new UIComponentDescriptor({"type" : Application, "propertiesFactory" : function()
{
return {"width" : 500, "height" : 560, "childDescriptors" : [new UIComponentDescriptor({"type" : VBox, "stylesFactory" : function()
{
this.horizontalAlign = "center";
this.verticalGap = 6;
this.paddingTop = 12;
return;
}, "propertiesFactory" : function()
{
return {"width" : 500, "height" : 560, "styleName" : "PaintCanvasOuterContainerStyle", "childDescriptors" : [new UIComponentDescriptor({"type" : ViewStack, "id" : "viewstack", "propertiesFactory" : function()
{
return {"width" : 475, "height" : 475, "creationPolicy" : "all", "styleName" : "PaintCanvasInnerContainerStyle", "childDescriptors" : [new UIComponentDescriptor({"type" : Canvas, "id" : "preview", "propertiesFactory" : function()
{
return {"percentWidth" : 100, "percentHeight" : 100, "horizontalScrollPolicy" : "off", "verticalScrollPolicy" : "off", "childDescriptors" : [new UIComponentDescriptor({"type" : Image, "id" : "screenshot", "events" : {"complete" : "__screenshot_complete"}, "propertiesFactory" : function()
{
return {"x" : 0, "y" : 0};
}}), new UIComponentDescriptor({"type" : HandCursorButton, "id" : "playerStartButton", "events" : {"click" : "__playerStartButton_click"}, "stylesFactory" : function()
{
this.horizontalCenter = "0";
this.verticalCenter = "0";
return;
}, "propertiesFactory" : function()
{
return {"styleName" : "BlogPlayerStartButtonStyle", "visible" : false};
}})]};
}}), new UIComponentDescriptor({"type" : Canvas, "propertiesFactory" : function()
{
return {"percentWidth" : 100, "percentHeight" : 100, "horizontalScrollPolicy" : "off", "verticalScrollPolicy" : "off", "childDescriptors" : [new UIComponentDescriptor({"type" : PaintCanvas, "id" : "paintCanvas"})]};
}})]};
}}), new UIComponentDescriptor({"type" : HBox, "stylesFactory" : function()
{
this.horizontalAlign = "center";
this.verticalAlign = "middle";
return;
}, "propertiesFactory" : function()
{
return {"width" : 320, "height" : 60, "styleName" : "BlogControlsBoxStyle", "childDescriptors" : [new UIComponentDescriptor({"type" : HandCursorButton, "id" : "downloadButton", "events" : {"click" : "__downloadButton_click"}, "propertiesFactory" : function()
{
return {"styleName" : "DownloadButtonStyle", "enabled" : false};
}}), new UIComponentDescriptor({"type" : HandCursorButton, "id" : "paintYourselfButton", "events" : {"click" : "__paintYourselfButton_click"}, "propertiesFactory" : function()
{
return {"styleName" : "PaintYourselfButtonStyle", "enabled" : false};
}}), new UIComponentDescriptor({"type" : HandCursorButton, "id" : "getCodeButton", "events" : {"click" : "__getCodeButton_click"}, "propertiesFactory" : function()
{
return {"styleName" : "GetCodeButtonStyle", "enabled" : false};
}}), new UIComponentDescriptor({"type" : HandCursorButton, "id" : "playAgainButton", "events" : {"click" : "__playAgainButton_click"}, "propertiesFactory" : function()
{
return {"styleName" : "PlayAgainButtonStyle", "enabled" : false};
}})]};
}})]};
}}), new UIComponentDescriptor({"type" : BlogPlayerPreloaderAftertaste, "id" : "preloaderAftertaste", "propertiesFactory" : function()
{
return {"x" : 0, "y" : 0, "width" : 500, "height" : 560};
}}), new UIComponentDescriptor({"type" : HBox, "id" : "_BlogPlayer_HBox2", "stylesFactory" : function()
{
this.left = "0";
this.bottom = "0";
return;
}, "propertiesFactory" : function()
{
return {"childDescriptors" : [new UIComponentDescriptor({"type" : FpsMeter}), new UIComponentDescriptor({"type" : MemoryUsageMeter})]};
}}), new UIComponentDescriptor({"type" : UIComponent, "id" : "loggerWrapper", "propertiesFactory" : function()
{
return {"mouseEnabled" : false, "percentWidth" : 100, "percentHeight" : 100};
}})]};
}});
this.loadConfigController = LoadConfigController.instance;
this.loadLibraryController = LoadLibraryController.instance;
this._embed_css__1017935931 = BlogPlayer__embed_css__1017935931;
this._embed_css__1502235314 = BlogPlayer__embed_css__1502235314;
this._embed_css__162016752 = BlogPlayer__embed_css__162016752;
this._embed_css__2078891259 = BlogPlayer__embed_css__2078891259;
this._embed_css__2093910380 = BlogPlayer__embed_css__2093910380;
this._bindings = [];
this._watchers = [];
this._bindingsByDestination = {};
this._bindingsBeginWithWord = {};
super();
mx_internal._document = this;
if(this.styleDeclaration)
{
this.styleDeclaration = new CSSStyleDeclaration();
}
this.styleDeclaration.defaultFactory = ;
var loc1:* = this;
this.layout = "absolute";
this.width = 500;
this.height = 560;
this.horizontalScrollPolicy = "off";
this.verticalScrollPolicy = "off";
this._BlogPlayer_TraceTarget1_i();
this.addEventListener("applicationComplete", this.___BlogPlayer_Application1_applicationComplete);
return;
}
public static Setter function watcherSetupUtil(arg0:mx.binding::IWatcherSetupUtil)
{
*::_watcherSetupUtil._watcherSetupUtil = ;
return;
}
public function __playAgainButton_click(arg0:flash.events::MouseEvent)
{
this.playAgain();
return;
}
private function loadLibraryClipartsXML()
{
this.loadLibraryController.data = ;
loadLibraryController.addEventListener(ModelEvent.LIBRARY_LOAD_COMPLETE, this.library_loadCompleteHandler);
loadLibraryController.load();
return;
}
public Setter function viewstack(arg0:mx.containers::ViewStack)
{
var loc0:* = this._1554553085viewstack;
if(loc0 !== arg0)
{
this._1554553085viewstack = ;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "viewstack", loc0, arg0));
}
return;
}
private function _BlogPlayer_TraceTarget1_i() : mx.logging.targets::TraceTarget
{
var loc0:* = new TraceTarget();
this.traceTarget = loc0;
loc0.includeCategory = true;
loc0.includeLevel = true;
loc0.includeTime = true;
loc0.fieldSeparator = " -> ";
BindingManager.executeBindings(this, "traceTarget", this.traceTarget);
loc0.initialized(this, "traceTarget");
return loc0;
}
public function __screenshot_complete(arg0:flash.events::Event)
{
this.playerStartButton.visible = true;
return;
}
public Getter function downloadButton() : ru.yandex.kraski.universalpainter.view.comps::HandCursorButton
{
return this._159077850downloadButton;
}
private function playInitEffect()
{
preloaderAftertaste.gotoAndPlay(0);
addEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
return;
}
private function loadCard()
{
var loc0:* = ServiceLocator.loadCardForPlayService;
loc0.addEventListener(ResultEvent.RESULT, this.resultHandler);
loc0.addEventListener(FaultEvent.FAULT, this.faultHandler);
loc0.load(Config.instance.cardHash);
return;
}
public Getter function viewstack() : mx.containers::ViewStack
{
return this._1554553085viewstack;
}
private function enterFrameHandler(arg0:flash.events::Event)
{
if(this.preloaderAftertaste.totalFrames == this.preloaderAftertaste.currentFrame)
{
preloaderAftertaste.stop();
removeChild(this.preloaderAftertaste);
removeEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
}
return;
}
private function init()
{
this.isDebug = "false" == "true";
this.addVersionToContextMenu();
this.initCursorVisibility();
this.initCursorManager();
callLater(this.playInitEffect);
Log.addTarget(this.traceTarget);
var loc0:* = new Logger();
loc0.mouseEnabled = false;
loc0.target.filters = ;
Log.addTarget(loc0.target);
loggerWrapper.addChild(loc0);
if(parameters.mode == "local")
{
ServiceLocator.implementation = new FakeServiceLocatorImpl();
}
else
{
ServiceLocator.implementation = new WebServiceLocatorImpl();
}
this._model = new Model(this);
this.paintCanvas.model = ;
SmoothPaint.smoothingEnabled = false;
this.screenshot.source = 0;
return;
}
public Setter function paintYourselfButton(arg0:ru.yandex.kraski.universalpainter.view.comps::HandCursorButton)
{
var loc0:* = this._1937158641paintYourselfButton;
if(loc0 !== arg0)
{
this._1937158641paintYourselfButton = ;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "paintYourselfButton", loc0, arg0));
}
return;
}
public Setter function playerStartButton(arg0:ru.yandex.kraski.universalpainter.view.comps::HandCursorButton)
{
var loc0:* = this._1613058925playerStartButton;
if(loc0 !== arg0)
{
this._1613058925playerStartButton = ;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "playerStartButton", loc0, arg0));
}
return;
}
public Getter function model() : ru.yandex.kraski.universalpainter.data::Model
{
return this._model;
}
public Getter function paintYourselfButton() : ru.yandex.kraski.universalpainter.view.comps::HandCursorButton
{
return this._1937158641paintYourselfButton;
}
private function usedResources_loadCompleteHandler(arg0:ru.yandex.kraski.universalpainter.events::ModelEvent)
{
removeEventListener(ModelEvent.CLIPARTS_LOAD_COMPLETE, this.usedResources_loadCompleteHandler);
debug("Ready to show card");
this.card = Card.fromXML(this.model.clipartDescriptors, this.cardXML);
this.card.hash = Config.instance.cardHash;
this.cardXML = null;
CustomCursorManager.setCursorByName(CursorType.POINTER);
this.downloadButton.enabled = true;
this.paintYourselfButton.enabled = true;
this.getCodeButton.enabled = true;
this.player = new Player();
this.player.paintCanvas = paintCanvas;
this.player.card = ;
if(this.viewstack.selectedIndex == 0)
{
this.viewstack.selectedIndex = 1;
}
this.playCard();
return;
}
public function ___BlogPlayer_Application1_applicationComplete(arg0:mx.events::FlexEvent)
{
this.init();
return;
}
private function initCursorVisibility()
{
var loc0:* = new Rectangle(1, 1, width - 1, height - 1);
if(loc0.containsPoint(new Point(mouseX, mouseY)))
{
CustomCursorManager.setCursorByName(CursorType.POINTER);
}
else
{
addEventListener(MouseEvent.ROLL_OVER, this.app_rollOverHandler);
}
return;
}
public Getter function traceTarget() : mx.logging.targets::TraceTarget
{
return this._235964214traceTarget;
}
private function initCursorManager()
{
this.customCursorManager = new CustomCursorManager();
this.customCursorManager.stage = stage;
return;
}
public Getter function isDebug() : Boolean
{
return this._2056864585isDebug;
}
public Getter function preloaderAftertaste() : BlogPlayerPreloaderAftertaste
{
return this._1631133009preloaderAftertaste;
}
public Getter function paintCanvas() : ru.yandex.kraski.universalpainter.view::PaintCanvas
{
return this._1763239082paintCanvas;
}
private function loadBackgroundsXml()
{
var loc0:* = BackgroundsLoadingController.instance;
loc0.model = ;
loc0.register();
loc0.addEventListener(ModelEvent.BACKGROUNDS_LOAD_COMPLETE, this.backgrounds_completeHandler);
loc0.load();
return;
}
public function __getCodeButton_click(arg0:flash.events::MouseEvent)
{
this.gotoCardPlayerPage();
return;
}
private function playCard()
{
this.playAgainButton.enabled = false;
player.play();
player.addEventListener(PlayerEvent.PLAY_FINISNED, this.playFinishedHandler);
return;
}
public function getUsedPhotoframePictures(arg0:XML) : Array
{
result = null;
photoframeNode = null;
pictureNode = null;
cardXML = arg0;
result = [];
var loc2:* = 0;
var loc3:* = cardXML.visual;
var loc1:* = new XMLList("");
for(loc2 in loc3)
{
var loc4:* = loc3.__getNextEnumerablePropertyValue();
var loc5:* = loc3.__getNextEnumerablePropertyValue();
if(type == "Photoframe")
{
loc1.loc4 = 0;
}
}
photoframeNode = loc1;
loc1 = 0;
loc4 = 0;
loc5 = photoframeNode.photos.visual;
loc3 = new XMLList("");
for(loc4 in loc5)
{
var loc6:* = loc5.__getNextEnumerablePropertyValue();
var loc7:* = loc5.__getNextEnumerablePropertyValue();
if(type == "PhotoframePicture")
{
loc3.loc6 = 0;
}
}
loc2 = loc3;
for(loc1 in loc2)
{
pictureNode = loc2.__getNextEnumerablePropertyValue();
push(parseInt(pictureNode.pictureIndex));
}
return result;
}
private function resultHandler(arg0:mx.rpc.events::ResultEvent)
{
this.removeLoadCardServiceListeners(ILoadCardService(arg0.target));
this.cardXML = (arg0.result) as XML;
this.restoreCard(this.cardXML);
return;
}
public Setter function traceTarget(arg0:mx.logging.targets::TraceTarget)
{
var loc0:* = this._235964214traceTarget;
if(loc0 !== arg0)
{
this._235964214traceTarget = ;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "traceTarget", loc0, arg0));
}
return;
}
public Getter function getCodeButton() : ru.yandex.kraski.universalpainter.view.comps::HandCursorButton
{
return this._1704619147getCodeButton;
}
public function __paintYourselfButton_click(arg0:flash.events::MouseEvent)
{
this.gotoServiceMainPage();
return;
}
private function getUsedClipartVOs(arg0:XML) : Array
{
clipartNode = null;
clipartVO = null;
cardXML = arg0;
result = [];
var loc1:* = 0;
var loc4:* = 0;
var loc5:* = cardXML.visual;
var loc3:* = new XMLList("");
for(loc4 in loc5)
{
var loc6:* = loc5.__getNextEnumerablePropertyValue();
var loc7:* = loc5.__getNextEnumerablePropertyValue();
if(type == "Clipart")
{
loc3.loc6 = 0;
}
}
var loc2:* = loc3;
for(loc1 in loc2)
{
clipartNode = loc2.__getNextEnumerablePropertyValue();
clipartVO = getClipartVOByClassName(clipartNode.resource.symbol);
if(clipartVO)
{
push(clipartVO);
}
}
return result;
}
private function addVersionToContextMenu()
{
var loc0:* = new ContextMenuManager();
loc0.addVersionToContextMenu(Model.blogPlayerAppName);
return;
}
public Getter function screenshot() : mx.controls::Image
{
return this._416447130screenshot;
}
private function gotoCardPlayerPage()
{
var loc0:* = new URLRequest(URLsBuilder.getCardPlayerPage(Config.instance.cardHash));
navigateToURL(loc0, "_blank");
return;
}
private function library_loadCompleteHandler(arg0:ru.yandex.kraski.universalpainter.events::ModelEvent)
{
this.loadBackgroundsXml();
return;
}
public function getUsedPictures(arg0:XML) : Array
{
pictureNode = null;
cardXML = arg0;
result = [];
var loc1:* = 0;
var loc4:* = 0;
var loc5:* = cardXML.visual;
var loc3:* = new XMLList("");
for(loc4 in loc5)
{
var loc6:* = loc5.__getNextEnumerablePropertyValue();
var loc7:* = loc5.__getNextEnumerablePropertyValue();
if(type == "Picture")
{
loc3.loc6 = 0;
}
}
var loc2:* = loc3;
for(loc1 in loc2)
{
pictureNode = loc2.__getNextEnumerablePropertyValue();
push(parseInt(pictureNode.pictureIndex));
}
return result;
}
private function playAgain()
{
if(this.player)
{
player.stop();
}
this.playCard();
return;
}
private function config_loadCompleteHandler(arg0:ru.yandex.kraski.universalpainter.events::ModelEvent)
{
this.loadLibraryClipartsXML();
return;
}
public function initialize()
{
target = null;
watcherSetupUtilClass = null;
var loc1:* = setDocumentDescriptor;
bindings = this._BlogPlayer_bindingsSetup();
watchers = [];
target = this;
if(this._watcherSetupUtil == null)
{
watcherSetupUtilClass = getDefinitionByName("_BlogPlayerWatcherSetupUtil");
loc1 = watcherSetupUtilClass;
}
_watcherSetupUtil.setup(this, function()
{
return target.loc0;
}, bindings, watchers);
i = 0;
while(i < bindings.length)
{
execute();
i = i + 1;
}
this._bindings = 0;
this._watchers = 0;
this.initialize();
return;
}
public Getter function playerStartButton() : ru.yandex.kraski.universalpainter.view.comps::HandCursorButton
{
return this._1613058925playerStartButton;
}
private function loadPhotoframes()
{
var loc0:* = PhotoframesLoadingController.instance;
loc0.model = ;
loc0.register();
loc0.addEventListener(ModelEvent.PHOTOFRAMES_LOAD_COMPLETE, this.photoframes_completeHandler);
loc0.load();
return;
}
private function backgrounds_completeHandler(arg0:ru.yandex.kraski.universalpainter.events::ModelEvent)
{
removeEventListener(ModelEvent.BACKGROUNDS_LOAD_COMPLETE, this.backgrounds_completeHandler);
this.loadPhotoframes();
return;
}
public Setter function preview(arg0:mx.containers::Canvas)
{
var loc0:* = this._318184504preview;
if(loc0 !== arg0)
{
this._318184504preview = ;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "preview", loc0, arg0));
}
return;
}
public Setter function isDebug(arg0:Boolean)
{
var loc0:* = this._2056864585isDebug;
if(loc0 !== arg0)
{
this._2056864585isDebug = ;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "isDebug", loc0, arg0));
}
return;
}
public Setter function preloaderAftertaste(arg0:BlogPlayerPreloaderAftertaste)
{
var loc0:* = this._1631133009preloaderAftertaste;
if(loc0 !== arg0)
{
this._1631133009preloaderAftertaste = ;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "preloaderAftertaste", loc0, arg0));
}
return;
}
private function playFinishedHandler(arg0:ru.yandex.kraski.universalpainter.events::PlayerEvent)
{
player.removeEventListener(PlayerEvent.PLAY_FINISNED, this.playFinishedHandler);
this.playAgainButton.enabled = true;
return;
}
public Setter function paintCanvas(arg0:ru.yandex.kraski.universalpainter.view::PaintCanvas)
{
var loc0:* = this._1763239082paintCanvas;
if(loc0 !== arg0)
{
this._1763239082paintCanvas = ;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "paintCanvas", loc0, arg0));
}
return;
}
public function _BlogPlayer_StylesInit()
{
style = null;
effects = null;
if(mx_internal._BlogPlayer_StylesInit_done)
{
return;
}
mx_internal._BlogPlayer_StylesInit_done = true;
style = StyleManager.getStyleDeclaration(".GetCodeButtonStyle");
if(style)
{
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".GetCodeButtonStyle", style, false);
}
if(style.factory == null)
{
style.factory = ;
}
style = StyleManager.getStyleDeclaration(".BlogControlsBoxStyle");
if(style)
{
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".BlogControlsBoxStyle", style, false);
}
if(style.factory == null)
{
style.factory = ;
}
style = StyleManager.getStyleDeclaration(".PaintCanvasInnerContainerStyle");
if(style)
{
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".PaintCanvasInnerContainerStyle", style, false);
}
if(style.factory == null)
{
style.factory = ;
}
style = StyleManager.getStyleDeclaration(".PaintCanvasOuterContainerStyle");
if(style)
{
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".PaintCanvasOuterContainerStyle", style, false);
}
if(style.factory == null)
{
style.factory = ;
}
style = StyleManager.getStyleDeclaration("Application");
if(style)
{
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("Application", style, false);
}
if(style.factory == null)
{
style.factory = ;
}
style = StyleManager.getStyleDeclaration(".PlayAgainButtonStyle");
if(style)
{
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".PlayAgainButtonStyle", style, false);
}
if(style.factory == null)
{
style.factory = ;
}
style = StyleManager.getStyleDeclaration(".DownloadButtonStyle");
if(style)
{
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".DownloadButtonStyle", style, false);
}
if(style.factory == null)
{
style.factory = ;
}
style = StyleManager.getStyleDeclaration(".PaintYourselfButtonStyle");
if(style)
{
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".PaintYourselfButtonStyle", style, false);
}
if(style.factory == null)
{
style.factory = ;
}
style = StyleManager.getStyleDeclaration(".BlogPlayerStartButtonStyle");
if(style)
{
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".BlogPlayerStartButtonStyle", style, false);
}
if(style.factory == null)
{
style.factory = ;
}
var loc1:* = StyleManager;
return;
}
public Setter function downloadButton(arg0:ru.yandex.kraski.universalpainter.view.comps::HandCursorButton)
{
var loc0:* = this._159077850downloadButton;
if(loc0 !== arg0)
{
this._159077850downloadButton = ;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "downloadButton", loc0, arg0));
}
return;
}
public Setter function playAgainButton(arg0:ru.yandex.kraski.universalpainter.view.comps::HandCursorButton)
{
var loc0:* = this._1354231074playAgainButton;
if(loc0 !== arg0)
{
this._1354231074playAgainButton = ;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "playAgainButton", loc0, arg0));
}
return;
}
private function restoreCard(arg0:XML)
{
var loc0:* = ResourceManager.instance;
loc0.model = ;
var loc1:* = this.getUsedClipartVOs(arg0);
var loc2:* = 0;
while(loc2 < loc1.length)
{
loc0.queueClipart(loc1[loc2]);
loc2++;
}
var loc3:* = this.getUsedPictures(arg0);
var loc4:* = 0;
while(loc4 < loc3.length)
{
loc0.queuePicture(loc3[loc4]);
loc4++;
}
var loc5:* = this.getBackgroundVO(arg0);
if(this.getBackgroundVO(arg0))
{
loc0.queueClipart(loc5);
}
var loc6:* = this.getPhotoframeVO(arg0);
if(this.getPhotoframeVO(arg0))
{
loc0.queueClipart(loc6);
}
var loc7:* = this.getUsedPhotoframePictures(arg0);
var loc8:* = 0;
while(loc8 < loc7.length)
{
loc0.queuePicture(loc7[loc8]);
loc8++;
}
loc0.addEventListener(ModelEvent.CLIPARTS_LOAD_COMPLETE, this.usedResources_loadCompleteHandler);
loc0.loadQueuedResources();
return;
}
public function __downloadButton_click(arg0:flash.events::MouseEvent)
{
this.gotoServiceMainPage();
return;
}
private function loadConfig()
{
this.playerStartButton.enabled = false;
CustomCursorManager.showBusyCursor();
this.loadConfigController.data = this._model.config;
addEventListener(ModelEvent.XML_LOAD_COMPLETE, this.config_loadCompleteHandler);
loadConfigController.load();
return;
}
public Setter function loggerWrapper(arg0:mx.core::UIComponent)
{
var loc0:* = this._1435122461loggerWrapper;
if(loc0 !== arg0)
{
this._1435122461loggerWrapper = ;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "loggerWrapper", loc0, arg0));
}
return;
}
private function faultHandler(arg0:mx.rpc.events::FaultEvent)
{
this.removeLoadCardServiceListeners(ILoadCardService(arg0.target));
return;
}
public Setter function screenshot(arg0:mx.controls::Image)
{
var loc0:* = this._416447130screenshot;
if(loc0 !== arg0)
{
this._416447130screenshot = ;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "screenshot", loc0, arg0));
}
return;
}
private function _BlogPlayer_bindingExprs()
{
var loc0:* = undefined;
loc0 = ( (this.isDebug)? LogEventLevel.ALL : LogEventLevel.WARN );
loc0 = this.isDebug;
loc0 = this.isDebug;
return;
}
public Getter function preview() : mx.containers::Canvas
{
return this._318184504preview;
}
private function gotoServiceMainPage()
{
var loc0:* = new URLRequest(Config.instance.serviceURL);
navigateToURL(loc0, "_blank");
return;
}
private function getBackgroundVO(arg0:XML) : ru.yandex.kraski.universalpainter.data::ClipartVO
{
var loc0:* = arg0.background[0];
return ( (loc0)? getClipartVOByClassName(loc0.resource.symbol) : null );
}
public Getter function playAgainButton() : ru.yandex.kraski.universalpainter.view.comps::HandCursorButton
{
return this._1354231074playAgainButton;
}
public Getter function loggerWrapper() : mx.core::UIComponent
{
return this._1435122461loggerWrapper;
}
private function removeLoadCardServiceListeners(arg0:ru.yandex.kraski.universalpainter.services::ILoadCardService)
{
arg0.removeEventListener(ResultEvent.RESULT, this.resultHandler);
arg0.removeEventListener(FaultEvent.FAULT, this.faultHandler);
return;
}
private function photoframes_completeHandler(arg0:ru.yandex.kraski.universalpainter.events::ModelEvent)
{
debug("photoframes's library loaded");
removeEventListener(ModelEvent.PHOTOFRAMES_LOAD_COMPLETE, this.photoframes_completeHandler);
this.loadCard();
return;
}
private function getPhotoframeVO(arg0:XML) : ru.yandex.kraski.universalpainter.data::ClipartVO
{
photoframeNode = null;
cardXML = arg0;
var loc2:* = 0;
var loc3:* = cardXML.visual;
var loc1:* = new XMLList("");
for(loc2 in loc3)
{
var loc4:* = loc3.__getNextEnumerablePropertyValue();
var loc5:* = loc3.__getNextEnumerablePropertyValue();
if(type == "Photoframe")
{
loc1.loc4 = 0;
}
}
photoframeNode = loc1;
return ( (photoframeNode)? getClipartVOByClassName(photoframeNode.resource.symbol) : null );
}
private function _BlogPlayer_bindingsSetup() : Array
{
binding = null;
result = [];
binding = new Binding(this, function()
{
return ( (isDebug)? LogEventLevel.ALL : LogEventLevel.WARN );
}, function()
{
traceTarget.level = ;
return;
}, "traceTarget.level");
result[0] = binding;
binding = new Binding(this, function()
{
return isDebug;
}, function()
{
_BlogPlayer_HBox2.visible = ;
return;
}, "_BlogPlayer_HBox2.visible");
result[1] = binding;
binding = new Binding(this, function()
{
return isDebug;
}, function()
{
_BlogPlayer_HBox2.includeInLayout = ;
return;
}, "_BlogPlayer_HBox2.includeInLayout");
result[2] = binding;
return result;
}
public Setter function getCodeButton(arg0:ru.yandex.kraski.universalpainter.view.comps::HandCursorButton)
{
var loc0:* = this._1704619147getCodeButton;
if(loc0 !== arg0)
{
this._1704619147getCodeButton = ;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "getCodeButton", loc0, arg0));
}
return;
}
private function app_rollOverHandler(arg0:flash.events::MouseEvent)
{
CustomCursorManager.setCursorByName(CursorType.POINTER);
removeEventListener(MouseEvent.ROLL_OVER, this.app_rollOverHandler);
return;
}
public function __playerStartButton_click(arg0:flash.events::MouseEvent)
{
this.loadConfig();
return;
}
}
public class BlogPlayer__embed_css__2078891259 extends blogPlayAgainButton_skin implements {mx.core}::IBorder, {mx.core}::IFlexAsset, {mx.core}::IFlexDisplayObject
{
//========================= Methods
public static function BlogPlayer__embed_css__2078891259()
{
return;
}
public function BlogPlayer__embed_css__2078891259()
{
super();
try {
NEW_ACTIVATION_OBJECT.name = NameUtil.createUniqueName(this);
} catch (e:Error) {
var loc1:* = e;
someVal = null;
}
return;
}
public function toString() : String
{
return NameUtil.displayObjectToString(this);
}
public Getter function borderMetrics() : mx.core::EdgeMetrics
{
if(scale9Grid == null)
{
return EdgeMetrics.EMPTY;
}
return new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil(measuredWidth - scale9Grid.right), Math.ceil(measuredHeight - scale9Grid.bottom));
}
}
public class BlogPlayer__embed_css__2093910380 extends blogPaintYourselfButton_skin implements {mx.core}::IBorder, {mx.core}::IFlexAsset, {mx.core}::IFlexDisplayObject
{
//========================= Methods
public static function BlogPlayer__embed_css__2093910380()
{
return;
}
public function BlogPlayer__embed_css__2093910380()
{
super();
try {
NEW_ACTIVATION_OBJECT.name = NameUtil.createUniqueName(this);
} catch (e:Error) {
var loc1:* = e;
someVal = null;
}
return;
}
public function toString() : String
{
return NameUtil.displayObjectToString(this);
}
public Getter function borderMetrics() : mx.core::EdgeMetrics
{
if(scale9Grid == null)
{
return EdgeMetrics.EMPTY;
}
return new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil(measuredWidth - scale9Grid.right), Math.ceil(measuredHeight - scale9Grid.bottom));
}
}
public class _BlogPlayerWatcherSetupUtil extends flash.display::Sprite implements {mx.binding}::IWatcherSetupUtil
{
//========================= Methods
public static function _BlogPlayerWatcherSetupUtil()
{
return;
}
public function _BlogPlayerWatcherSetupUtil()
{
super();
return;
}
public static function init(arg0:mx.core::IFlexModuleFactory)
{
BlogPlayer.watcherSetupUtil = ;
return;
}
public function setup(arg0:Object, arg1:Function, arg2:Array, arg3:Array)
{
arg3[0] = new PropertyWatcher("isDebug", {"propertyChange" : true}, [arg2[0], arg2[1], arg2[2]], arg1);
updateParent(arg0);
return;
}
}
public class BlogPlayer__embed_css__162016752 extends blogPlayerStartButton_skin implements {mx.core}::IBorder, {mx.core}::IFlexAsset, {mx.core}::IFlexDisplayObject
{
//========================= Methods
public static function BlogPlayer__embed_css__162016752()
{
return;
}
public function BlogPlayer__embed_css__162016752()
{
super();
try {
NEW_ACTIVATION_OBJECT.name = NameUtil.createUniqueName(this);
} catch (e:Error) {
var loc1:* = e;
someVal = null;
}
return;
}
public function toString() : String
{
return NameUtil.displayObjectToString(this);
}
public Getter function borderMetrics() : mx.core::EdgeMetrics
{
if(scale9Grid == null)
{
return EdgeMetrics.EMPTY;
}
return new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil(measuredWidth - scale9Grid.right), Math.ceil(measuredHeight - scale9Grid.bottom));
}
}
public dynamic class BlogPlayerPreloaderAftertaste extends mx.flash::UIMovieClip
{
//========================= Methods
public static function BlogPlayerPreloaderAftertaste()
{
return;
}
public function BlogPlayerPreloaderAftertaste()
{
super();
return;
}
}
public class BlogPlayer__embed_css__1502235314 extends blogGetCodeButton_skin implements {mx.core}::IBorder, {mx.core}::IFlexAsset, {mx.core}::IFlexDisplayObject
{
//========================= Methods
public static function BlogPlayer__embed_css__1502235314()
{
return;
}
public function BlogPlayer__embed_css__1502235314()
{
super();
try {
NEW_ACTIVATION_OBJECT.name = NameUtil.createUniqueName(this);
} catch (e:Error) {
var loc1:* = e;
someVal = null;
}
return;
}
public function toString() : String
{
return NameUtil.displayObjectToString(this);
}
public Getter function borderMetrics() : mx.core::EdgeMetrics
{
if(scale9Grid == null)
{
return EdgeMetrics.EMPTY;
}
return new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil(measuredWidth - scale9Grid.right), Math.ceil(measuredHeight - scale9Grid.bottom));
}
}
public class BlogPlayer__embed_css__1017935931 extends blogDownloadButton_skin implements {mx.core}::IBorder, {mx.core}::IFlexAsset, {mx.core}::IFlexDisplayObject
{
//========================= Methods
public static function BlogPlayer__embed_css__1017935931()
{
return;
}
public function BlogPlayer__embed_css__1017935931()
{
super();
try {
NEW_ACTIVATION_OBJECT.name = NameUtil.createUniqueName(this);
} catch (e:Error) {
var loc1:* = e;
someVal = null;
}
return;
}
public function toString() : String
{
return NameUtil.displayObjectToString(this);
}
public Getter function borderMetrics() : mx.core::EdgeMetrics
{
if(scale9Grid == null)
{
return EdgeMetrics.EMPTY;
}
return new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil(measuredWidth - scale9Grid.right), Math.ceil(measuredHeight - scale9Grid.bottom));
}
}
public dynamic class PhotoframeCursorIcon extends flash.display::MovieClip
{
//========================= Methods
public static function PhotoframeCursorIcon()
{
return;
}
public function PhotoframeCursorIcon()
{
super();
return;
}
}
public dynamic class PointerCursorIcon extends flash.display::MovieClip
{
//========================= Methods
public static function PointerCursorIcon()
{
return;
}
public function PointerCursorIcon()
{
super();
return;
}
}
public dynamic class FingerCursorIcon extends flash.display::MovieClip
{
//========================= Methods
public static function FingerCursorIcon()
{
return;
}
public function FingerCursorIcon()
{
super();
return;
}
}
public dynamic class TextCursorIcon extends flash.display::MovieClip
{
//========================= Methods
public static function TextCursorIcon()
{
return;
}
public function TextCursorIcon()
{
super();
return;
}
}
public dynamic class Brush extends ru.yandex.kraski.universalpainter.cursors::BrushCursorClass
{
//========================= Methods
public static function Brush()
{
return;
}
public function Brush()
{
super();
return;
}
}
public dynamic class DragCursorIcon extends flash.display::MovieClip
{
//========================= Methods
public static function DragCursorIcon()
{
return;
}
public function DragCursorIcon()
{
super();
return;
}
}
public dynamic class HandCursorIcon extends flash.display::MovieClip
{
//========================= Methods
public static function HandCursorIcon()
{
return;
}
public function HandCursorIcon()
{
super();
return;
}
}
public dynamic class RectPaintSymbol extends flash.display::MovieClip
{
//========================= Variables
public var mc : MovieClip;
//========================= Methods
public static function RectPaintSymbol()
{
return;
}
public function RectPaintSymbol()
{
super();
return;
}
}
public dynamic class HeartPaintSymbol extends flash.display::MovieClip
{
//========================= Methods
public static function HeartPaintSymbol()
{
return;
}
public function HeartPaintSymbol()
{
super();
return;
}
}
public dynamic class FlowerPaintSymbol extends flash.display::MovieClip
{
//========================= Variables
public var mc : MovieClip;
//========================= Methods
public static function FlowerPaintSymbol()
{
return;
}
public function FlowerPaintSymbol()
{
super();
return;
}
}
public dynamic class PentaPaintSymbol extends flash.display::MovieClip
{
//========================= Methods
public static function PentaPaintSymbol()
{
return;
}
public function PentaPaintSymbol()
{
super();
addFrameScript(39, this.frame40);
return;
}
internal function frame40()
{
gotoAndPlay(6);
return;
}
}
}
package skins_fla
{
public dynamic class blog_icon_play_7 extends flash.display::MovieClip
{
//========================= Methods
public static function blog_icon_play_7()
{
return;
}
public function blog_icon_play_7()
{
super();
addFrameScript(0, this.frame1);
return;
}
internal function frame1()
{
stop();
return;
}
}
public dynamic class blog_icon_save_2 extends flash.display::MovieClip
{
//========================= Methods
public static function blog_icon_save_2()
{
return;
}
public function blog_icon_save_2()
{
super();
addFrameScript(0, this.frame1);
return;
}
internal function frame1()
{
stop();
return;
}
}
public dynamic class blog_icon_brush_main_12 extends flash.display::MovieClip
{
//========================= Methods
public static function blog_icon_brush_main_12()
{
return;
}
public function blog_icon_brush_main_12()
{
super();
addFrameScript(0, this.frame1);
return;
}
internal function frame1()
{
stop();
return;
}
}
public dynamic class blog_icon_mail_main_9 extends flash.display::MovieClip
{
//========================= Methods
public static function blog_icon_mail_main_9()
{
return;
}
public function blog_icon_mail_main_9()
{
super();
addFrameScript(0, this.frame1);
return;
}
internal function frame1()
{
stop();
return;
}
}
}
package ru.yandex.kraski.universalpainter.services
{
public class URLsBuilder extends Object
{
//========================= Methods
public static function URLsBuilder()
{
return;
}
public function URLsBuilder()
{
super();
return;
}
public static function getLoadCardURL(arg0:String) : String
{
return Config.instance.servantURL + "/get-xml/" + this.getFullStoragePath(arg0) + "?kraski_ver=2&nocache=" + valueOf();
}
private static function extractStorageNum(arg0:String) : String
{
return arg0.split(".")[1];
}
public static function getPictureUploadURL(arg0:String, arg1:int) : String
{
return Config.instance.uploadURL + "/custom-image-upload" + "?slide_n=" + arg1 + "&hash=" + arg0 + "&kraski_ver=2";
}
public static function getSaveCardURL(arg0:String) : String
{
return Config.instance.uploadURL + "/upload-xml";
}
public static function getCreateNewCardURL(arg0:String) : String
{
return Config.instance.serviceURL + "/pre.xml?hash=" + arg0 + "&kraski_ver=2";
}
public static function getScreenshotUploadURL() : String
{
return Config.instance.uploadURL + "/screenshot-upload";
}
public static function getScreenshotURL(arg0:String) : String
{
return Config.instance.servantURL + "/get/" + this.getFullStoragePath(arg0) + "_scr";
}
public static function getCardPlayerPage(arg0:String) : String
{
return Config.instance.serviceURL + "/view.xml?hash=" + arg0;
}
public static function getNewHashURL() : String
{
return Config.instance.serviceURL + "/newcard.xml?kraski_ver=2";
}
public static function getHelpURL() : String
{
return Config.instance.serviceURL + "/help.xml";
}
private static function extractStorageDirectory(arg0:String) : String
{
return arg0.substr(0, 4);
}
private static function getFullStoragePath(arg0:String) : String
{
return this.extractStorageNum(arg0) + "/" + this.extractStorageDirectory(arg0) + "/" + arg0;
}
public static function getConfigURL() : String
{
return Config.instance.appBaseURL + "/config.xml";
}
public static function getPictureDownloadURL(arg0:String, arg1:int = 0) : String
{
return Config.instance.servantURL + "/get-custom/" + this.getFullStoragePath(arg0) + "_img" + arg1 + "?kraski_ver=2";
}
}
public class ServiceLocatorImpl extends Object
{
//========================= Variables
public var _createNewCardService : ICreateNewCardService;
public var _saveCardService : ISaveCardService;
public var _loadCardForPlayService : ILoadCardService;
public var _loadConfigService : ILoadConfigService;
public var _loadCardForEditService : ILoadCardService;
public var _loadPictureService : ILoadPictureService;
//========================= Methods
public static function ServiceLocatorImpl()
{
return;
}
public function ServiceLocatorImpl()
{
super();
return;
}
public Getter function createNewCardService() : ru.yandex.kraski.universalpainter.services::ICreateNewCardService
{
return this._createNewCardService;
}
public Getter function loadCardForPlayService() : ru.yandex.kraski.universalpainter.services::ILoadCardService
{
return this._loadCardForPlayService;
}
public Getter function saveCardService() : ru.yandex.kraski.universalpainter.services::ISaveCardService
{
return this._saveCardService;
}
public Getter function loadConfigService() : ru.yandex.kraski.universalpainter.services::ILoadConfigService
{
return this._loadConfigService;
}
public Getter function loadPictureService() : ru.yandex.kraski.universalpainter.services::ILoadPictureService
{
return this._loadPictureService;
}
public Getter function loadCardForEditService() : ru.yandex.kraski.universalpainter.services::ILoadCardService
{
return this._loadCardForEditService;
}
}
public interface ILoadCardServiceimplements {flash.events}::IEventDispatcher
{
//========================= Methods
public function load(arg0:String);
}
public class ServiceLocator extends Object
{
//========================= Variables
private static var _impl : ServiceLocatorImpl;
//========================= Methods
public static function ServiceLocator()
{
return;
}
public function ServiceLocator()
{
super();
return;
}
public static Getter function createNewCardService() : ru.yandex.kraski.universalpainter.services::ICreateNewCardService
{
return this._impl.createNewCardService;
}
public static Getter function loadConfigService() : ru.yandex.kraski.universalpainter.services::ILoadConfigService
{
return this._impl.loadConfigService;
}
public static Getter function loadCardForPlayService() : ru.yandex.kraski.universalpainter.services::ILoadCardService
{
return this._impl.loadCardForPlayService;
}
public static Getter function loadCardForEditService() : ru.yandex.kraski.universalpainter.services::ILoadCardService
{
return this._impl.loadCardForEditService;
}
public static Getter function saveCardService() : ru.yandex.kraski.universalpainter.services::ISaveCardService
{
return this._impl.saveCardService;
}
public static Getter function implementation() : ru.yandex.kraski.universalpainter.services::ServiceLocatorImpl
{
return this._impl;
}
public static Setter function implementation(arg0:ru.yandex.kraski.universalpainter.services::ServiceLocatorImpl)
{
this._impl = ;
return;
}
public static Getter function loadPictureService() : ru.yandex.kraski.universalpainter.services::ILoadPictureService
{
return this._impl.loadPictureService;
}
}
public interface ICreateNewCardServiceimplements {flash.events}::IEventDispatcher
{
//========================= Methods
public function createCard();
}
public interface ILoadConfigServiceimplements {flash.events}::IEventDispatcher
{
//========================= Methods
public function load();
}
public interface ILoadPictureServiceimplements {flash.events}::IEventDispatcher
{
//========================= Methods
public function downloadPicture(arg0:int);
public function load(arg0:ru.yandex.kraski.universalpainter.data::Card);
}
public interface ISaveCardServiceimplements {flash.events}::IEventDispatcher
{
//========================= Methods
public function save(arg0:ru.yandex.kraski.universalpainter.data::Card, arg1:flash.display::DisplayObject);
}
public class KraskiService extends flash.events::EventDispatcher
{
//========================= Variables
private var _className : String;
//========================= Methods
public static function KraskiService()
{
return;
}
public function KraskiService()
{
super();
return;
}
public Getter function className() : String
{
if(this._className)
{
this._className = join(".");
}
return this._className;
}
}
}
package ru.yandex.profiling
{
public class FpsMeter extends mx.controls::Label
{
//========================= Variables
private var _frames : int = 0;
private var _timestamp : int;
//========================= Methods
public static function FpsMeter()
{
return;
}
public function FpsMeter()
{
super();
this.addEventListener("addedToStage", this.___FpsMeter_Label1_addedToStage);
this.addEventListener("removedFromStage", this.___FpsMeter_Label1_removedFromStage);
return;
}
private function start()
{
addEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
this._timestamp = getTimer();
return;
}
private function stop()
{
removeEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
return;
}
public function ___FpsMeter_Label1_addedToStage(arg0:flash.events::Event)
{
this.start();
return;
}
public function initialize()
{
this.initialize();
return;
}
private function enterFrameHandler(arg0:flash.events::Event)
{
var loc0:* = 0;
var loc1:* = this;
var loc2:* = this._frames + 1;
loc1._frames = this._frames;
if(this._frames == 10)
{
loc0 = getTimer();
this = "fps: " + Math.round(10000 / loc0 - this._timestamp);
this._timestamp = loc0;
this._frames = 0;
}
return;
}
public function ___FpsMeter_Label1_removedFromStage(arg0:flash.events::Event)
{
this.stop();
return;
}
public Setter function text(arg0:String)
{
return;
}
public Setter function htmlText(arg0:String)
{
return;
}
}
public class MemoryUsageMeter extends mx.controls::Label
{
//========================= Variables
private var _timer : Timer;
//========================= Methods
public static function MemoryUsageMeter()
{
return;
}
public function MemoryUsageMeter()
{
this._timer = new Timer(500);
super();
this.addEventListener("addedToStage", this.___MemoryUsageMeter_Label1_addedToStage);
this.addEventListener("removedFromStage", this.___MemoryUsageMeter_Label1_removedFromStage);
return;
}
public function initialize()
{
this.initialize();
return;
}
public function ___MemoryUsageMeter_Label1_removedFromStage(arg0:flash.events::Event)
{
this.stop();
return;
}
private function start()
{
_timer.addEventListener(TimerEvent.TIMER, this.timerHandler);
_timer.start();
return;
}
private function timerHandler(arg0:flash.events::TimerEvent)
{
this = "memory: " + Math.round(System.totalMemory / 1024 * 1024) + " MB";
return;
}
private function stop()
{
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, this.timerHandler);
return;
}
public Setter function text(arg0:String)
{
return;
}
public function ___MemoryUsageMeter_Label1_addedToStage(arg0:flash.events::Event)
{
this.start();
return;
}
public Setter function htmlText(arg0:String)
{
return;
}
}
}
package ru.yandex.kraski.universalpainter.services.fake
{
public class FakeServiceLocatorImpl extends ru.yandex.kraski.universalpainter.services::ServiceLocatorImpl
{
//========================= Methods
public static function FakeServiceLocatorImpl()
{
return;
}
public function FakeServiceLocatorImpl()
{
super();
this._loadPictureService = new FakeLoadPictureService();
this._saveCardService = new FakeSaveCardService();
this._createNewCardService = new FakeCreateNewCardService();
this._loadCardForEditService = new FakeLoadCardService();
this._loadCardForPlayService = new FakeLoadCardService();
this._loadConfigService = new FakeLoadConfigService();
return;
}
}
public class FakeLoadPictureService extends flash.events::EventDispatcher implements {ru.yandex.kraski.universalpainter.services}::ILoadPictureService
{
//========================= Variables
private static const className : String = "ru.yandex.kraski.universalpainter.services.FakeLoadPictureService";
//========================= Methods
public static function FakeLoadPictureService()
{
this.className = "ru.yandex.kraski.universalpainter.services.FakeLoadPictureService";
return;
}
public function FakeLoadPictureService()
{
super();
return;
}
private function download_completeHandler(arg0:flash.events::Event)
{
info("picture loaded");
var loc0:* = LoaderInfo(arg0.target);
this.removeDownloadListeners(loc0);
dispatchEvent(new ResultEvent(ResultEvent.RESULT, false, true, loc0.content));
return;
}
public function downloadPicture(arg0:int)
{
var loc0:* = new Loader();
this.addDownloadListeners(loc0.contentLoaderInfo);
loc0.load(new URLRequest("testData/testPicture.jpg"), new LoaderContext(false, ApplicationDomain.currentDomain));
return;
}
private function removeDownloadListeners(arg0:flash.display::LoaderInfo)
{
arg0.removeEventListener(Event.COMPLETE, this.download_completeHandler);
arg0.removeEventListener(IOErrorEvent.IO_ERROR, this.download_ioErrorHandler);
arg0.removeEventListener(ProgressEvent.PROGRESS, this.download_progressHandler);
return;
}
private function download_progressHandler(arg0:flash.events::ProgressEvent)
{
info("download progress: {0} of {1} Kbytes loaded ({2}%)", toFixed(0), toFixed(0), toFixed(0));
return;
}
private function addDownloadListeners(arg0:flash.display::LoaderInfo)
{
arg0.addEventListener(Event.COMPLETE, this.download_completeHandler);
arg0.addEventListener(IOErrorEvent.IO_ERROR, this.download_ioErrorHandler);
arg0.addEventListener(ProgressEvent.PROGRESS, this.download_progressHandler);
return;
}
public function load(arg0:ru.yandex.kraski.universalpainter.data::Card)
{
this.downloadPicture(0);
return;
}
private function download_ioErrorHandler(arg0:flash.events::IOErrorEvent)
{
info(arg0.toString());
this.removeDownloadListeners(LoaderInfo(arg0.target));
dispatchEvent(FaultEvent.createEvent(new Fault(arg0.type, arg0.toString())));
return;
}
}
public class FakeLoadConfigService extends ru.yandex.kraski.universalpainter.services::KraskiService implements {ru.yandex.kraski.universalpainter.services}::ILoadConfigService
{
//========================= Methods
public static function FakeLoadConfigService()
{
return;
}
public function FakeLoadConfigService()
{
super();
return;
}
private function completeHandler(arg0:flash.events::Event)
{
var loc0:* = URLLoader(arg0.target);
this.removeListeners(loc0);
dispatchEvent(ResultEvent.createEvent(XML(loc0.data)));
return;
}
private function removeListeners(arg0:flash.net::URLLoader)
{
arg0.removeEventListener(Event.COMPLETE, this.completeHandler);
arg0.removeEventListener(IOErrorEvent.IO_ERROR, this.errorHandler);
arg0.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, this.errorHandler);
return;
}
private function errorHandler(arg0:flash.events::ErrorEvent)
{
this.removeListeners(URLLoader(arg0.target));
dispatchEvent(FaultEvent.createEvent(new Fault("ConfigLoadingError", arg0.toString())));
return;
}
public function load()
{
var loc0:* = new URLLoader();
loc0.addEventListener(Event.COMPLETE, this.completeHandler);
loc0.addEventListener(IOErrorEvent.IO_ERROR, this.errorHandler);
loc0.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.errorHandler);
loc0.load(new URLRequest(URLsBuilder.getConfigURL()));
return;
}
}
public class FakeCreateNewCardService extends flash.events::EventDispatcher implements {ru.yandex.kraski.universalpainter.services}::ICreateNewCardService
{
//========================= Methods
public static function FakeCreateNewCardService()
{
return;
}
public function FakeCreateNewCardService()
{
super();
return;
}
public function createCard()
{
dispatchEvent(ResultEvent.createEvent(new XML("<new hash=\"7569f8dc55cdfd6994e34879e13bff10.0\"/>")));
return;
}
}
public class FakeLoadCardService extends flash.events::EventDispatcher implements {ru.yandex.kraski.universalpainter.services}::ILoadCardService
{
//========================= Methods
public static function FakeLoadCardService()
{
return;
}
public function FakeLoadCardService()
{
super();
return;
}
public function load(arg0:String)
{
dispatchEvent(ResultEvent.createEvent(new XML("<card picturesTotal=\"0\">
</card>")));
return;
}
}
public class FakeSaveCardService extends flash.events::EventDispatcher implements {ru.yandex.kraski.universalpainter.services}::ISaveCardService
{
//========================= Variables
private static const CLASS_NAME : String = "ru.yandex.kraski.universalpainter.services.FakeSaveCardService";
//========================= Methods
public static function FakeSaveCardService()
{
this.CLASS_NAME = "ru.yandex.kraski.universalpainter.services.FakeSaveCardService";
return;
}
public function FakeSaveCardService()
{
super();
return;
}
public function save(arg0:ru.yandex.kraski.universalpainter.data::