Add new clothing system
[18plus-7leafadventure.git] / src / Main.mxml
blob0fb28f8317ac02d12a453ff009617204830993d8
1 <?xml version="1.0" encoding="utf-8"?>
2 <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
3 xmlns:s="library://ns.adobe.com/flex/spark"
4 xmlns:dongs="org.sevenchan.dongs.*"
5 creationComplete="dicks(this)"
6 resize="onResize();">
7 <fx:Script>
8 <![CDATA[
9 import spark.components.Application;
10 import org.sevenchan.AdventureController;
11 public static var main:AdventureController;
13 public function dicks(hurf:Application):void
15 main = new AdventureController(Main(hurf));
16 dongs.addChild(main);
19 public function showBodyParts(show:Boolean):void
21 trace(show);
22 bodyparts.visible = show;
23 creatures.visible = !show;
24 dongs.visible = !show;
25 dongs.alpha = show ? 0 : 1;
26 dongs.percentHeight = dongs.percentWidth = show ? 0 : 100;
29 public function showCreatureViewer(show:Boolean):void
31 trace(show);
32 creatures.visible = show;
33 bodyparts.visible = !show;
34 dongs.visible = !show;
35 dongs.alpha = show ? 0 : 1;
36 dongs.percentHeight = dongs.percentWidth = show ? 0 : 100;
39 private function onResize():void
41 var ratio:Number = width / measuredWidth;
42 if (dongs != null)
44 //dongs.scaleX *= ratio;
45 //dongs.scaleY *= ratio;
47 if (main != null)
49 main.onResize(height, width, measuredHeight, measuredWidth);
52 ]]>
53 </fx:Script>
54 <dongs:frmBodyPartsPool id="bodyparts"
55 visible="false"
56 width="100%"
57 height="100%"
58 horizontalCenter="true"
59 verticalCenter="true" />
60 <dongs:frmCreatureViewer id="creatures"
61 visible="false"
62 width="100%"
63 height="100%"
64 horizontalCenter="true"
65 verticalCenter="true" />
66 <s:SpriteVisualElement id="dongs" />
67 </s:Application>