zoukankan
html css js c++ java
FLEX光标定位和插入文本
因为目前的FLEX的RichTextEditor不支持图文混编,所以,只能自己动手了,实现最核心的部分,光标定位插入文本。
Code
1
<?
xml version="1.0" encoding="utf-8"?gt;
2
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"gt;
3
<mx:Script>
4
<![CDATA[
5
6
[Bindable]
7
private var textAreaString:String = "textAreaString";
8
[Bindable]
9
private var insertString:String = "|insert|";
10
11
private function insertHandler():void {
12
if (textArea.selectionBeginIndex == textArea.selectionEndIndex) {
13
var startPart:String = textAreaString.substring(0,textArea.selectionBeginIndex);
14
var endPart:String = textAreaString.substring(textArea.selectionEndIndex,textAreaString.length);
15
startPart+=insertString;
16
startPart+=endPart;
17
textAreaString = startPart;
18
}
19
}
20
21
private function changeInsertHandler():void {
22
insertString = insertInput.text;
23
}
24
]]>
25
</mx:Script>
26
<mx:TextArea id="textArea" x="10" y="21" width="298" height="158" text="{textAreaString}"/gt;
27
<mx:Button x="316" y="20" label="Insert" click="insertHandler();"/gt;
28
<mx:TextInput id="insertInput" x="316" y="50" text="{insertString}" change="changeInsertHandler();"/gt;
29
</mx:Application>
30
查看全文
相关阅读:
12 EF Core 私有字段的映射
11 EF Core 表拆分
10 EF Core 继承类关系映射
9. EF Core数据库索引与备用键约束
8. EF Core 外键的删除模式
7. EF Core 导航属性配置
C# 单例模式
JS中将XML转为JSON对象
MVC特性
测试sql语句执行速度
原文地址:https://www.cnblogs.com/zack/p/1434500.html
最新文章
tp5中url使用js变量传参方法
PHP解决ajax跨域的问题
使用@media响应式适配各种屏幕
UINavigationController先pop再push
改变 UITableViewCell删除按钮样式
UIFont all families
UIWebView with progress
设置uinavigationbar导航条透明,并去除下面那条莫名其妙的线
-[AVCaptureMetadataOutput setMetadataObjectTypes:] – unsupported type found. Use -availableMetadataObjectTypes.
oc和swift混编关键
热门文章
Xcode 5 + iOS 7免证书(iDP)真机调试与生成IPA全攻略
cocos 2d CCSprite 触摸识别 非常有用!!!!!
ios7 hiden status bar
MYsql数据库----之-----单表查询
MYsql数据库----之-----基础知识(初识)
test
2.依赖注入对象的作用域
1.依赖注入-服务注册、移除、替换
MediatR基本使用
Polly重试,熔断,超时,隔板,回退 基本使用
Copyright © 2011-2022 走看看