blob: 60b35097c354224551ed47e83a587731ac9ea3b1 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" creationComplete="application1_creationCompleteHandler(event)"
xmlns:s="library://ns.adobe.com/flex/spark" width="700" height="600"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@font-face{
src: url("../../../Assets/Fonts/Open_Sans/OpenSans-Regular.ttf");
fontFamily: SparkVera;
embedAsCFF: true;
}
@font-face{
src: url("../../../Assets/Fonts/Open_Sans/OpenSans-Bold.ttf");
fontWeight: bold;
fontFamily: SparkVera;
embedAsCFF: true;
}
@font-face{
src: url("../../../Assets/Fonts/Open_Sans/OpenSans-Italic.ttf");
fontStyle: italic;
fontFamily: SparkVera;
embedAsCFF: true;
}
@font-face{
src: url("../../../Assets/Fonts/Open_Sans/OpenSans-BoldItalic.ttf");
fontWeight: bold;
fontStyle: italic;
fontFamily: SparkVera;
embedAsCFF: true;
}
global {
fontAntiAliasType: "normal";
fontFamily: SparkVera;
fontLookup: "embeddedCFF";
}
</fx:Style>
<fx:Script>
<![CDATA[
import mx.collections.ArrayList;
import mx.controls.Alert;
import mx.events.FlexEvent;
public var eventDispatcher:IEventDispatcher = null;
public function loadStyles():void
{
eventDispatcher = styleManager.loadStyleDeclarations("assets/testSheet.swf");
}
public function unloadStyles():void
{
styleManager.unloadStyleDeclarations("assets/testSheet.swf");
}
public function loadModule():void
{
mod_loader.url="assets/SkinModule.swf";
}
public function unloadModule():void
{
mod_loader.url="";
mod_loader.unloadModule();
}
public function loadModule2():void
{
mod_loader2.url="assets/SkinModule2.swf";
}
public function unloadModule2():void
{
mod_loader2.url="";
mod_loader2.unloadModule();
}
private var arr:Array =
[
{ label:'Newyork', data:10.00},
{ label:'Boston', data:15.00 },
{ label:'Chicago', data:3.50 },
{ label:'San Francisco', data:7.65},
{ label:'Las Vegas',data:12.35 },
{ label:'Orlando', data:00.00}
];
private var listArr :ArrayList = new ArrayList(arr);
protected function application1_creationCompleteHandler(event:FlexEvent):void
{
sparkList.dataProvider = listArr;
}
]]>
</fx:Script>
<s:layout>
<s:HorizontalLayout/>
</s:layout>
<s:Panel id="sparkPanel" title="Sparky Panel" >
<s:layout>
<s:VerticalLayout paddingLeft="5" paddingTop="5"/>
</s:layout>
<s:List id="sparkList" />
</s:Panel>
<mx:ModuleLoader id="mod_loader" />
<mx:ModuleLoader id="mod_loader2" />
<s:VGroup>
<s:Button click="loadStyles()" id="btn1" label="load fonts using css"/>
<s:Button click="unloadStyles()" id="btn2" label="unload css fonts"/>
<s:Button click="loadModule()" id="btn3" label="load module"/>
<s:Button click="unloadModule()" id="btn4" label="unload module"/>
<s:Button click="loadModule2()" id="btn5" label="load module2"/>
<s:Button click="unloadModule2()" id="btn6" label="unload module2"/>
</s:VGroup>
</s:Application>