-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathTextBox.as
More file actions
81 lines (66 loc) · 2.05 KB
/
TextBox.as
File metadata and controls
81 lines (66 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package componentStatic
{
import componentStatic.TextBoxEvent;
import flash.display.*;
import flash.events.*;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
import flash.text.SoftKeyboardType;
import flash.utils.Timer;
public class TextBox extends MovieClip
{
private var target:MovieClip;
public var value:String;
private var softKeyFormat:String,
priceMode:Boolean;
public function TextBox(target_p:MovieClip,value_p:String="",SoftKeyFormat_p:String = SoftKeyboardType.DEFAULT,clearAfterClicked_p:Boolean=false,PriceMode_p=false,ConvertArabic_p:Boolean=true,CorrectingArabicNumbers_p:Boolean=true,JustShowNativeText_p:Boolean=false)
{
target = target_p
value = value_p
softKeyFormat = SoftKeyFormat_p
priceMode = PriceMode_p
target.valueText.addEventListener(Event.CHANGE,changeTextBox_Fun);
FarsiInputCorrection.clear(target.valueText)
target.valueText.text = value
FarsiInputCorrection.setUp(target.valueText,softKeyFormat,ConvertArabic_p,CorrectingArabicNumbers_p,clearAfterClicked_p,JustShowNativeText_p)
}
private function setValueText_fun():void
{
this.dispatchEvent(new TextBoxEvent(TextBoxEvent.TEXT,target.valueText.text));
}
public function reset():void
{
target.valueText.text=""
setValueText_fun()
}
public function setValueTextByeCod_fun(Value_p:String):void
{
FarsiInputCorrection.clear(target.valueText)
target.valueText.text = Value_p
FarsiInputCorrection.setUp(target.valueText)
setValueText_fun()
}
public function setText(Value_p:String):void
{
target.valueText.text = Value_p
}
private function changeTextBox_Fun(evt:Event):void
{
if(priceMode)
{
setPrice()
}
else
{
setValueText_fun()
}
}
private function setPrice():void
{
var valueSrt:String = target.valueText.text
valueSrt = valueSrt.split(',').join('')
this.dispatchEvent(new TextBoxEvent(TextBoxEvent.TEXT,valueSrt));
target.valueText.text = SplitNumberRange.split(valueSrt,3,',',SplitNumberRange.RIGHT)
}
}
}