blob: 2a91b0e068b832091aedbae8db540ad6d7fbae2e [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"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="800" minHeight="600"
xmlns:comps="comps.*">
<fx:Style source="../../../../../Assets/Fonts/VeraFontStyles.css" />
<fx:Style>
@namespace mx "library://ns.adobe.com/flex/mx";
@namespace s "library://ns.adobe.com/flex/spark";
s|RichEditableText
{
fontFamily: MyVeraSpark;
fontLookup: embeddedCFF;
fontAntiAliasType: normal;
backgroundColor:#00FF00;
focusedTextSelectionColor:yellow;
}
global{
fontFamily: MyVeraHalo;
fontAntiAliasType: normal;
kerning: "off";
}
</fx:Style>
<fx:Declarations>
<!-- Define XML objects to use with TLF format. -->
<fx:XML id="tfText1">
<TextFlow xmlns="http://ns.adobe.com/textLayout/2008">
<div>
<p color="0x336699"><span>The Text Layout Framework is an extensible library, built on the new text engine in Adobe Flash Player 10, which delivers advanced, easy-to-integrate typographic and text layout features for rich, sophisticated and innovative typography on the web.
</span>
</p>
</div>
</TextFlow>
</fx:XML>
<fx:XML id="tfText2">
<TextFlow xmlns="http://ns.adobe.com/textLayout/2008">
<p>Text Using <span fontWeight="bold">Text Layout Framework</span> Markup</p>
</TextFlow>
</fx:XML>
<fx:XML id="tfText3">
<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><p fontFamily='MyVeraSpark'>This is TLF markup with paragraphs.</p><p color='0x663399'>The root TextFlow tag is included.</p>
</TextFlow>
</fx:XML>
<fx:XML id="tfText4" source="./assets/large_content.xml">
</fx:XML>
<!-- Define a String to use with HTML and plain text format. -->
<!-- <b> not recognized [CDATA[<p>Text containing <b>HTML</b> markup</p>]]-->
<fx:String id="htmlText1"><![CDATA[<p>Text containing HTML markup</p>]]></fx:String>
</fx:Declarations>
<fx:Script>
<![CDATA[
import flashx.textLayout.elements.InlineGraphicElement;
[Embed(source="../../../../../Assets/Images/smallredrect.jpg")]
[Bindable]
public var imgClass:Class;
public function insertNewText(ret:RichEditableText, newText:String):void {
ret.insertText(newText);
}
public function appendNewText(ret:RichEditableText, newText:String):void {
ret.appendText(newText);
}
/*
public function toggleLineBreak():void
{
if (chk.selected)
ret1.setStyle('lineBreak', 'explicit');
else
ret1.setStyle('lineBreak', 'toFit');
}
public function toggleMirroring():void
{
if (chk2.selected){
ret1.setStyle("direction","rtl");
ret1.layoutDirection="rtl";
chk2.label="rtl";
}
else
{
ret1.setStyle("direction","ltr");
ret1.layoutDirection="ltr";
chk2.label="ltr";
}
}
*/
public function addInLineImg(ret:RichEditableText, imgClass:Class):void
{
var p:ParagraphElement = new ParagraphElement();
var inlineGraphicElement:InlineGraphicElement = new InlineGraphicElement();
inlineGraphicElement.source = imgClass;
inlineGraphicElement.width=32;
inlineGraphicElement.height=32;
p.addChild(inlineGraphicElement);
ret.textFlow.addChild(p);
}
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout/>
</s:layout>
<comps:HellowWorldRET id="myRET1" />
<comps:TextFlowRET_ContentBinding id="retTFBinding1" />
<comps:ContentRET1 id="retContent1" />
<comps:EditableRET1 id="retEditable1" />
<s:RichEditableText id="myRET2">Hello <s:span fontWeight="bold">World!</s:span></s:RichEditableText>
<s:RichEditableText id="myRET3" height="100" width="200">
<s:textFlow>
<s:TextFlow>
<s:p>This is paragraph 1.</s:p>
<s:p>This is paragraph 2.</s:p>
</s:TextFlow>
</s:textFlow>
</s:RichEditableText>
<s:VGroup id="vg1" paddingLeft="20" paddingRight="20" paddingTop="20" paddingBottom="20" width="50%" height="50%">
<comps:TextFlowRET2 id="myRET4"/>
</s:VGroup>
</s:Application>