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

Example Analysis of Flex component Development

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces the example analysis of Flex component development, which is very detailed and has certain reference value. Friends who are interested must finish it!

Summary of Flex component development

The problems encountered in the usual Flex development process and the solutions are summarized as follows:

1. How do I monitor keyboard events?

PrivatefunctionsendKeyHandler (evt:KeyboardEvent): void {/ / enter if (evt.keyCode==13) {this.sendTxt (); return;}}

Code description: there are two types of keyboard events: KeyboardEvent.KEY_DOWN and KeyboardEvent.KEY_UP

The above is listening to the carriage return incident.

If you want to listen for key combinations, such as Ctrl+ enter, the code is as follows:

If (evt.keyCode==13&&evt.ctrlKey) {}

How to control the control bar of RichTextEditor in 2.Flex development?

Use the showControlBar property to control the control bar of the RichTextEditor, so that the entire control bar is closed

If you want to control each hosted control in the control bar separately, you can refer to the following code:

This.textEditor.alignButtons.height=0; this.textEditor.alignButtons.visible=false; this.textEditor.bulletButton.height=0; this.textEditor.bulletButton.visible=false; this.textEditor.linkTextInput.height=0; this.textEditor.linkTextInput.visible=false; this.textEditor._RichTextEditor_VRule1.height=0; this.textEditor._RichTextEditor_VRule1.visible=false; this.textEditor._RichTextEditor_VRule2.height=0; this.textEditor._RichTextEditor_VRule2.visible=false

Of course, you can also refer to this article.

Http://blog.minidx.com/2008/12/29/1841.html

Why didn't you respond to the control double-click event (DoubleClickEvent) in 3.Flex development?

PrivatefunctiondoubleClickHandler (evt:MouseEvent): void {Alert.show ("doubleClick");}

Code description:

The doubleClickEnabled property: specifies whether the object receives the doubleClick event. The default value is false, which means that doubleClick events are not received by default. If the doubleClickEnabled property is set to true, the instance receives the doubleClick event within its scope

How to insert characters in the cursor position of TextArea in 4.Flex development?

PrivatefunctioninsertString (insertStr:String): void {if (this.textEditor.selectionBeginIndex==this.textEditor.selectionEndIndex) {varstartPart:String=this.textEditor.text.substring (0Magnethis.textEditor.selectionBeginIndex); varendPart:String=this.textEditor.text.substring (this.textEditor.selectionEndIndex,this.textEditor.text.length); startPart+=insertStr; startPart+=endPart; this.textEditor.text=startPart;} else {this.textEditor.text=insertStr;}}

How to keep the scroll bar of the TextArea control at the bottom in 5.Flex development?

This.txt_content.addEventListener (FlexEvent.VALUE_COMMIT,VALUE_COMMITHandler); privatefunctionVALUE_COMMITHandler (evt:FlexEvent): void {txt_contenttxt_content.verticalScrollPosition=txt_content.maxVerticalScrollPosition;}

Code description: this code is to achieve the TextArea control scroll bar is always kept at the bottom, in order to facilitate users to view chat information

If the VBox control needs to achieve a similar effect, you can look at the following code:

PrivatefunctionupdateCompleteHandler (evt:FlexEvent): void {thisthis.vd.verticalScrollPosition=this.vd.maxVerticalScrollPosition;} above is all the content of the article "sample Analysis of Flex component Development". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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