<?xml version="1.0" encoding="utf-8"?>
<mx:Application backgroundColor="#FFFFFF" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="*" xmlns:objecthandles="com.roguedevelopment.objecthandles.*" height="100%" width="100%">
<mx:Metadata>
[Event(name="change", type="flash.events.Event")]
[DefaultTriggerEvent("change")]
/**
* Name of the CSS Style declaration to use for the styles for the TextArea.
* By default, the TextArea uses the RichTextEditor control's inheritable styles.
*/
[Style(name="textAreaStyleName", type="String", inherit="no")]
[IconFile("RichTextEditor.png")]
[Exclude(name="alignButtons", kind="property")]
[Exclude(name="boldButton", kind="property")]
[Exclude(name="bulletButton", kind="property")]
[Exclude(name="colorPicker", kind="property")]
[Exclude(name="defaultButton", kind="property")]
[Exclude(name="fontFamilyArray", kind="property")]
[Exclude(name="fontFamilyCombo", kind="property")]
[Exclude(name="fontSizeArray", kind="property")]
[Exclude(name="fontSizeCombo", kind="property")]
[Exclude(name="icon", kind="property")]
[Exclude(name="italicButton", kind="property")]
[Exclude(name="label", kind="property")]
[Exclude(name="layout", kind="property")]
[Exclude(name="linkTextInput", kind="property")]
[Exclude(name="toolBar", kind="property")]
[Exclude(name="toolBar2", kind="property")]
[Exclude(name="underlineButton", kind="property")]
</mx:Metadata>
<mx:Array id="fontFamilyArray">
<mx:String>_sans</mx:String>
<mx:String>_serif</mx:String>
<mx:String>_typewriter</mx:String>
<mx:String>Arial</mx:String>
<mx:String>Courier</mx:String>
<mx:String>Courier New</mx:String>
<mx:String>Geneva</mx:String>
<mx:String>Georgia</mx:String>
<mx:String>Helvetica</mx:String>
<mx:String>Times New Roman</mx:String>
<mx:String>Times</mx:String>
<mx:String>Verdana</mx:String>
<mx:String>ComicSansMS</mx:String>
</mx:Array>
<mx:Array id="fontSizeArray">
<mx:String>8</mx:String>
<mx:String>9</mx:String>
<mx:String>10</mx:String>
<mx:String>11</mx:String>
<mx:String>12</mx:String>
<mx:String>14</mx:String>
<mx:String>16</mx:String>
<mx:String>18</mx:String>
<mx:String>20</mx:String>
<mx:String>22</mx:String>
<mx:String>24</mx:String>
<mx:String>26</mx:String>
<mx:String>28</mx:String>
<mx:String>36</mx:String>
<mx:String>48</mx:String>
<mx:String>72</mx:String>
</mx:Array>
<mx:Script>
<![CDATA[
import mx.states.RemoveChild;
import com.roguedevelopment.objecthandles.ObjectHandles;
import mx.managers.PopUpManager;
public var obj:Object=new Object();
private var tObj:Object;
private function onClick(event:MouseEvent):void
{
tObj=(event.currentTarget as ObjectHandles).getChildByName("TA");
}
public function Tek():void
{
var tt:Rtext=new Rtext();
var obH:ObjectHandles=new ObjectHandles();
obH.visible=true;
obH.setStyle('borderStyle','solid');
obH.setStyle('borderColor','gray');
obH.setStyle('borderThickness',0);
obH.toolTip='DoubleClick Here';
obH.allowHMove=true;
obH.allowVMove=true;
tt.text='Text Here';
tt.focusEnabled=true;
tt.percentHeight=100;
tt.percentWidth=100;
tt.visible=true;
//textArea.addEventListener(MouseEvent.CLICK,eve);
tt.name='TA';
obH.x=80;
obH.y=60;
obH.width=100;
obH.height=20;
obH.doubleClickEnabled=true;
obH.addEventListener(MouseEvent.DOUBLE_CLICK,subtex);
obH.addEventListener(MouseEvent.CLICK,mouseeve);
can.addChild(obH);
obH.addChild(tt);
}
public function mouseeve(event:MouseEvent):void
{
obj=(event.currentTarget as ObjectHandles).getChildByName("TA") as Rtext;
tObj=obj;
}
public function subtex(event:MouseEvent):void
{
var pop:comsubText=new comsubText();
PopUpManager.addPopUp(pop,this,true);
PopUpManager.centerPopUp(pop);
pop.textArea.htmlText=Rtext(tObj).htmlText ;
}
public function img(event:MouseEvent):void
{
var addimg:comPop=new comPop();
PopUpManager.addPopUp(addimg,this,true);
PopUpManager.centerPopUp(addimg);
}
public function dlet(event:MouseEvent):void
{
can.removeChild((obj as Rtext).parent as ObjectHandles);
}
public function Bgimg():void
{
var Bgimg:Bgimage=new Bgimage();
PopUpManager.addPopUp(Bgimg,this,true);
PopUpManager.centerPopUp(Bgimg);
}
]]>
</mx:Script>
<mx:Canvas id="can" width="580" height="354" backgroundColor="#FFFFFF" borderStyle="solid" borderColor="black" borderThickness="0" horizontalCenter="59" verticalCenter="-65" shadowDirection="right" shadowDistance="20" dropShadowColor="#000000" dropShadowEnabled="true" cornerRadius="0" useHandCursor="true" buttonMode="true" verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:backgroundImage>@Embed(source='BGimg/background4.jpg')</mx:backgroundImage>
</mx:Canvas>
<mx:Canvas width="554" height="94" backgroundColor="#72B0DB" borderStyle="solid" borderThickness="2" horizontalCenter="59" verticalCenter="196" useHandCursor="true" buttonMode="true" shadowDirection="right" shadowDistance="10" dropShadowColor="#000000" dropShadowEnabled="true" borderColor="black" cornerRadius="15">
<mx:Button click="Tek()" x="341" y="9" label="Add Text" width="97" height="22"/>
<mx:VRule x="333" y="5" height="74"/>
<mx:VRule x="443" y="5" height="74"/>
<mx:Button click="img(event)" x="342" y="36" label="Image" width="97">
<mx:icon>@Embed(source='icon/image_cultured.png')</mx:icon>
</mx:Button>
<mx:Button click="dlet(event)" x="453" y="6" icon="@Embed(source='icon/gtk-close.png')" width="24" height="22"/>
<mx:Button click="expand.end();expand.play();" x="485" y="5" icon="@Embed(source='icon/zoom_in.png')" width="24" height="22"/>
<mx:Button x="516" y="4" icon="@Embed(source='icon/zoom_out.png')" width="24" height="22"/>
<mx:Button x="453" y="33" icon="@Embed(source='icon/Copy.png')" width="24" height="22"/>
<mx:Button x="481" y="33" icon="@Embed(source='icon/undo (1).png')" width="34" height="22"/>
<mx:Button x="516" y="33" icon="@Embed(source='icon/redo.png')" width="34" height="22"/>
<mx:ControlBar width="324" x="8" y="4" height="84" cornerRadius="15">
<mx:ToolBar id="toolbar" width="100%" horizontalGap="7">
<mx:ComboBox id="fontFamilyCombo" editable="true"
creationComplete="Rtext(tObj).getTextStyles();Rtext(tObj).lastCaretIndex = -1;"
dataProvider = "{fontFamilyArray}"
close="Rtext(tObj).setTextStyles('font');"
enter="Rtext(tObj).setTextStyles('font');"/>
<mx:ComboBox id="fontSizeCombo" editable="true"
paddingLeft="2" paddingRight="2"
dataProvider = "{fontSizeArray}"
close="Rtext(tObj).setTextStyles('size');"
enter="Rtext(tObj).setTextStyles('size');"/>
<mx:HBox id="toolBar2" horizontalGap="0">
<mx:Button id="boldButton" width="20" toggle="true"
icon="@Embed('assets/icon_style_bold.png')"
click="Rtext(tObj).setTextStyles('bold', event.currentTarget.selected);" />
<mx:Button id="italicButton" width="20" toggle="true"
icon="@Embed('assets/icon_style_italic.png')"
click="Rtext(tObj).setTextStyles('italic', event.currentTarget.selected);" />
<mx:Button id="underlineButton" width="20" toggle="true"
icon="@Embed('assets/icon_style_underline.png')"
click="Rtext(tObj).setTextStyles('underline', event.currentTarget.selected);" />
</mx:HBox>
<mx:ColorPicker id="colorPicker" width="22" height="22"
close="Rtext(tObj).setTextStyles('color');"/>
<mx:VRule height="{alignButtons.height}"/>
<mx:ToggleButtonBar id="alignButtons" buttonWidth="20"
itemClick="Rtext(tObj).setTextStyles('align', ToggleButtonBar(event.currentTarget).dataProvider.getItemAt(ToggleButtonBar(event.currentTarget).selectedIndex).action); " >
<mx:dataProvider>
<mx:Array>
<mx:Object icon="@Embed('assets/icon_align_left.png')" action="left"/>
<mx:Object icon="@Embed('assets/icon_align_center.png')" action="center"/>
<mx:Object icon="@Embed('assets/icon_align_right.png')" action="right"/>
<mx:Object icon="@Embed('assets/icon_align_justify.png')" action="justify"/>
</mx:Array>
</mx:dataProvider>
</mx:ToggleButtonBar>
<mx:Button id="bulletButton" width="20" toggle="true"
icon="@Embed('assets/icon_bullet.png')"
click="Rtext(tObj).setTextStyles('bullet', event.currentTarget.selected);" />
</mx:ToolBar>
</mx:ControlBar>
<mx:Button click="Bgimg()" x="341" y="62" label="BG Images" width="98" height="22"/>
</mx:Canvas>
</mx:Application>
<mx:Application backgroundColor="#FFFFFF" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="*" xmlns:objecthandles="com.roguedevelopment.objecthandles.*" height="100%" width="100%">
<mx:Metadata>
[Event(name="change", type="flash.events.Event")]
[DefaultTriggerEvent("change")]
/**
* Name of the CSS Style declaration to use for the styles for the TextArea.
* By default, the TextArea uses the RichTextEditor control's inheritable styles.
*/
[Style(name="textAreaStyleName", type="String", inherit="no")]
[IconFile("RichTextEditor.png")]
[Exclude(name="alignButtons", kind="property")]
[Exclude(name="boldButton", kind="property")]
[Exclude(name="bulletButton", kind="property")]
[Exclude(name="colorPicker", kind="property")]
[Exclude(name="defaultButton", kind="property")]
[Exclude(name="fontFamilyArray", kind="property")]
[Exclude(name="fontFamilyCombo", kind="property")]
[Exclude(name="fontSizeArray", kind="property")]
[Exclude(name="fontSizeCombo", kind="property")]
[Exclude(name="icon", kind="property")]
[Exclude(name="italicButton", kind="property")]
[Exclude(name="label", kind="property")]
[Exclude(name="layout", kind="property")]
[Exclude(name="linkTextInput", kind="property")]
[Exclude(name="toolBar", kind="property")]
[Exclude(name="toolBar2", kind="property")]
[Exclude(name="underlineButton", kind="property")]
</mx:Metadata>
<mx:Array id="fontFamilyArray">
<mx:String>_sans</mx:String>
<mx:String>_serif</mx:String>
<mx:String>_typewriter</mx:String>
<mx:String>Arial</mx:String>
<mx:String>Courier</mx:String>
<mx:String>Courier New</mx:String>
<mx:String>Geneva</mx:String>
<mx:String>Georgia</mx:String>
<mx:String>Helvetica</mx:String>
<mx:String>Times New Roman</mx:String>
<mx:String>Times</mx:String>
<mx:String>Verdana</mx:String>
<mx:String>ComicSansMS</mx:String>
</mx:Array>
<mx:Array id="fontSizeArray">
<mx:String>8</mx:String>
<mx:String>9</mx:String>
<mx:String>10</mx:String>
<mx:String>11</mx:String>
<mx:String>12</mx:String>
<mx:String>14</mx:String>
<mx:String>16</mx:String>
<mx:String>18</mx:String>
<mx:String>20</mx:String>
<mx:String>22</mx:String>
<mx:String>24</mx:String>
<mx:String>26</mx:String>
<mx:String>28</mx:String>
<mx:String>36</mx:String>
<mx:String>48</mx:String>
<mx:String>72</mx:String>
</mx:Array>
<mx:Script>
<![CDATA[
import mx.states.RemoveChild;
import com.roguedevelopment.objecthandles.ObjectHandles;
import mx.managers.PopUpManager;
public var obj:Object=new Object();
private var tObj:Object;
private function onClick(event:MouseEvent):void
{
tObj=(event.currentTarget as ObjectHandles).getChildByName("TA");
}
public function Tek():void
{
var tt:Rtext=new Rtext();
var obH:ObjectHandles=new ObjectHandles();
obH.visible=true;
obH.setStyle('borderStyle','solid');
obH.setStyle('borderColor','gray');
obH.setStyle('borderThickness',0);
obH.toolTip='DoubleClick Here';
obH.allowHMove=true;
obH.allowVMove=true;
tt.text='Text Here';
tt.focusEnabled=true;
tt.percentHeight=100;
tt.percentWidth=100;
tt.visible=true;
//textArea.addEventListener(MouseEvent.CLICK,eve);
tt.name='TA';
obH.x=80;
obH.y=60;
obH.width=100;
obH.height=20;
obH.doubleClickEnabled=true;
obH.addEventListener(MouseEvent.DOUBLE_CLICK,subtex);
obH.addEventListener(MouseEvent.CLICK,mouseeve);
can.addChild(obH);
obH.addChild(tt);
}
public function mouseeve(event:MouseEvent):void
{
obj=(event.currentTarget as ObjectHandles).getChildByName("TA") as Rtext;
tObj=obj;
}
public function subtex(event:MouseEvent):void
{
var pop:comsubText=new comsubText();
PopUpManager.addPopUp(pop,this,true);
PopUpManager.centerPopUp(pop);
pop.textArea.htmlText=Rtext(tObj).htmlText ;
}
public function img(event:MouseEvent):void
{
var addimg:comPop=new comPop();
PopUpManager.addPopUp(addimg,this,true);
PopUpManager.centerPopUp(addimg);
}
public function dlet(event:MouseEvent):void
{
can.removeChild((obj as Rtext).parent as ObjectHandles);
}
public function Bgimg():void
{
var Bgimg:Bgimage=new Bgimage();
PopUpManager.addPopUp(Bgimg,this,true);
PopUpManager.centerPopUp(Bgimg);
}
]]>
</mx:Script>
<mx:Canvas id="can" width="580" height="354" backgroundColor="#FFFFFF" borderStyle="solid" borderColor="black" borderThickness="0" horizontalCenter="59" verticalCenter="-65" shadowDirection="right" shadowDistance="20" dropShadowColor="#000000" dropShadowEnabled="true" cornerRadius="0" useHandCursor="true" buttonMode="true" verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:backgroundImage>@Embed(source='BGimg/background4.jpg')</mx:backgroundImage>
</mx:Canvas>
<mx:Canvas width="554" height="94" backgroundColor="#72B0DB" borderStyle="solid" borderThickness="2" horizontalCenter="59" verticalCenter="196" useHandCursor="true" buttonMode="true" shadowDirection="right" shadowDistance="10" dropShadowColor="#000000" dropShadowEnabled="true" borderColor="black" cornerRadius="15">
<mx:Button click="Tek()" x="341" y="9" label="Add Text" width="97" height="22"/>
<mx:VRule x="333" y="5" height="74"/>
<mx:VRule x="443" y="5" height="74"/>
<mx:Button click="img(event)" x="342" y="36" label="Image" width="97">
<mx:icon>@Embed(source='icon/image_cultured.png')</mx:icon>
</mx:Button>
<mx:Button click="dlet(event)" x="453" y="6" icon="@Embed(source='icon/gtk-close.png')" width="24" height="22"/>
<mx:Button click="expand.end();expand.play();" x="485" y="5" icon="@Embed(source='icon/zoom_in.png')" width="24" height="22"/>
<mx:Button x="516" y="4" icon="@Embed(source='icon/zoom_out.png')" width="24" height="22"/>
<mx:Button x="453" y="33" icon="@Embed(source='icon/Copy.png')" width="24" height="22"/>
<mx:Button x="481" y="33" icon="@Embed(source='icon/undo (1).png')" width="34" height="22"/>
<mx:Button x="516" y="33" icon="@Embed(source='icon/redo.png')" width="34" height="22"/>
<mx:ControlBar width="324" x="8" y="4" height="84" cornerRadius="15">
<mx:ToolBar id="toolbar" width="100%" horizontalGap="7">
<mx:ComboBox id="fontFamilyCombo" editable="true"
creationComplete="Rtext(tObj).getTextStyles();Rtext(tObj).lastCaretIndex = -1;"
dataProvider = "{fontFamilyArray}"
close="Rtext(tObj).setTextStyles('font');"
enter="Rtext(tObj).setTextStyles('font');"/>
<mx:ComboBox id="fontSizeCombo" editable="true"
paddingLeft="2" paddingRight="2"
dataProvider = "{fontSizeArray}"
close="Rtext(tObj).setTextStyles('size');"
enter="Rtext(tObj).setTextStyles('size');"/>
<mx:HBox id="toolBar2" horizontalGap="0">
<mx:Button id="boldButton" width="20" toggle="true"
icon="@Embed('assets/icon_style_bold.png')"
click="Rtext(tObj).setTextStyles('bold', event.currentTarget.selected);" />
<mx:Button id="italicButton" width="20" toggle="true"
icon="@Embed('assets/icon_style_italic.png')"
click="Rtext(tObj).setTextStyles('italic', event.currentTarget.selected);" />
<mx:Button id="underlineButton" width="20" toggle="true"
icon="@Embed('assets/icon_style_underline.png')"
click="Rtext(tObj).setTextStyles('underline', event.currentTarget.selected);" />
</mx:HBox>
<mx:ColorPicker id="colorPicker" width="22" height="22"
close="Rtext(tObj).setTextStyles('color');"/>
<mx:VRule height="{alignButtons.height}"/>
<mx:ToggleButtonBar id="alignButtons" buttonWidth="20"
itemClick="Rtext(tObj).setTextStyles('align', ToggleButtonBar(event.currentTarget).dataProvider.getItemAt(ToggleButtonBar(event.currentTarget).selectedIndex).action); " >
<mx:dataProvider>
<mx:Array>
<mx:Object icon="@Embed('assets/icon_align_left.png')" action="left"/>
<mx:Object icon="@Embed('assets/icon_align_center.png')" action="center"/>
<mx:Object icon="@Embed('assets/icon_align_right.png')" action="right"/>
<mx:Object icon="@Embed('assets/icon_align_justify.png')" action="justify"/>
</mx:Array>
</mx:dataProvider>
</mx:ToggleButtonBar>
<mx:Button id="bulletButton" width="20" toggle="true"
icon="@Embed('assets/icon_bullet.png')"
click="Rtext(tObj).setTextStyles('bullet', event.currentTarget.selected);" />
</mx:ToolBar>
</mx:ControlBar>
<mx:Button click="Bgimg()" x="341" y="62" label="BG Images" width="98" height="22"/>
</mx:Canvas>
</mx:Application>
SCREEN SHOT & DEMO HERE