1. Copy the content to the clipboard:
System . Setclipboard (strcontent );
2. Clone an arraycollection:
VaR bar: arraycollection = new arraycollection ();
For each (var I: Object In ac ){
Bar. additem (I );
}
VaR bar: listcollectionview =
New listcollectionview (AC). List );
3. Open the URL:
NavigatetoURL (
New URLRequest ('HTTP: // NTT. CC'), '_ blank ');
4. page reload:
NavigatetoURL (
New URLRequest ("Javascript: location. Reload ();"), "_ Self ");
5. Close the browser:
NavigatetoURL (
New URLRequest ("Javascript: window. Close ()"), "_ Self ");
6. Get the alert window with transparent Background:
Alert {
Modaltransparency: 0.0;
Modaltransparencyblur: 0;
}
7. Set the random color:
LBL. setstyle ('color', 0xffffff * Math . Random ());
8. Remove spaces on the left side of the string:
Public Function ltrim (s: String ): String {
VaR I: Number = 0;
While (S. charcodeat (I) = 32 | S. charcodeat (I) = 13
| S. charcodeat (I) = 10 | S. charcodeat (I) = 9 ){
I ++;
}
Return S. substring (I, S. Length );
}
9. Remove spaces on the right of the string:
Public Function rtrim (s: String ): String {
VaR I: Number = S. Length-1;
While (S. charcodeat (I) = 32 | S. charcodeat (I) = 13
| S. charcodeat (I) = 10 | S. charcodeat (I) = 9 ){
I --;
}
Return S. substring (0, I + 1 );
}
10. Remove the Left and Right spaces of the string:
Public Function trim (s: String ): String {
Return ltrim (rtrim (s ));
}
11. Obtain the Data Type:
Getqualifiedclassname (data );
12. Four Verification codes are generated:
Private function generatecheckcode (): String {
// Initialization
VaR ran: Number ;
VaR Number: Number ;
VaR code: String ;
VaR checkcode: String = "";
// Obtain four random numbers
For (var I: Int = 0; I <4; I ++ ){
Ran = Math . Random ();
// The expected result is 0.1234.
Number = Math . Round (Ran * 10000 );
If (Number % 2 = 0)
// 0 ASCII code 48
Code = String . Fromcharcode (48 + (Number % 10 ));
Else
// A's ASCII code 65
Code = String . Fromcharcode (65 + (Number % 26 ));
Checkcode + = code;
}
Return checkcode;
}