Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the commonly used Flex source code

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces the commonly used Flex source code, the article is very detailed, has a certain reference value, interested friends must read it!

12 commonly used Flex source code

1. Copy the contents to the system clipboard

Java code

System.setClipboard (strContent); System.setClipboard (strContent)

two。 Copy an ArrayCollectionFlex source code

Java code

/ / dummysolution (well,itworks) varbar:ArrayCollection=newArrayCollection (); foreach (vari:Objectinac) {bar.addItem (I);} / varbarbarfrog ListCollectionViewwords newListCollectionView (ListCollectionView (ac) .list); / / dummysolution (well,itworks) varbar:ArrayCollection=newArrayCollection (); foreach (vari:Objectinac) {bar.addItem (I);} / promoasticcards plausible var barbarCollectionViewwords newListCollectionView (ListCollectionView (CollectionView (ac) .list)

3. Open a new browser window

Java code

NavigateToURL (newURLRequest ('http://52friends.com'),'_blank'); navigateToURL (newURLRequest (' http://52friends.com'),'_blank');)

4. Refresh browser Flex source code

Java code

NavigateToURL (newURLRequest ("_ javascript:location.reload ();"), "_ self") navigateToURL (newURLRequest ("_ javascript:location.reload ();"), "_ self")

5. Close the browser Flex source code

Java code

NavigateToURL (newURLRequest ("_ javascript:window.close ()"), "_ self"); navigateToURL (newURLRequest ("_ javascript:window.close ()"), "_ self")

6. Set the background of the Alert window to transparent

Java code

Alert {modalTransparency:0.0;modalTransparencyBlur:0;} Alert {modalTransparency:0.0;modalTransparencyBlur:0;}

7. Take random color Flex source code

Java code

Lbl.setStyle ('color',0xffffff*Math.random ()); lbl.setStyle (' color',0xffffff*Math.random ())

8. Clear the space on the left side of the substring

Java code

PublicfunctionLTrim (s:String): String {vari:Number=0; while (s.charCodeAt (I) = = 32 | | s.charCodeAt (I) = = 13 | s.charCodeAt (I) = = 10 | | s.charCodeAt (I) = = 9) {returns.substring (iMagazine. Length);} publicfunctionLTrim (s:String): String {vari:Number=0; while (s.charCodeAt (I) = = 32 | | s.charCodeAt (I) = 13 | | s.charCodeAt (I) = 10 | | s.charCodeAt (I) = 9)

9. Clear the space on the right side of the string Flex source code

Java code

PublicfunctionRTrim (s:String): String {vari:Number=s.length-1; while (s.charCodeAt (I) = = 32 | | s.charCodeAt (I) = = 13 | s.charCodeAt (I) = = 10 | | s.charCodeAt (I) = = 9) {returns.substring;} publicfunctionRTrim (s:String): String {vari:Number=s.length-1; while (s.charCodeAt (I) = = 32 | | s.charCodeAt (I) = 13 | | s.charCodeAt (I) = 10 | s.charCodeAt (I) = 9) }

10. Clear the space on the left and right of the string

Java code

PublicfunctionTrim (s:String): String {returnLTrim (RTrim (s));} publicfunctionTrim (s:String): String {returnLTrim (RTrim (s));}

11. Get the data type Flex source code

Java code

GetQualifiedClassName (data) getQualifiedClassName (data)

twelve。 Generate a random string.

Java code

PrivatefunctionGenerateCheckCode (): String {/ / init varran:Number; varnumber:Number; varcode:String; varcheckCode:String= ""; / / get4radom for (vari:int=0;i

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report