![Phân tích tư tưởng của nhân dân qua đoạn thơ: Những người vợ nhớ chồng… Những cuộc đời đã hóa sông núi ta trong Đất nước của Nguyễn Khoa Điềm](https://timtailieu.net/upload/document/136415/phan-tich-tu-tuong-cua-nhan-dan-qua-doan-tho-039-039-nhung-nguoi-vo-nho-chong-nhung-cuoc-doi-da-hoa-song-nui-ta-039-039-trong-dat-nuoc-cua-nguyen-khoa-136415.jpg)
Flex 3 with Java- P3
Số trang: 50
Loại file: pdf
Dung lượng: 634.57 KB
Lượt xem: 10
Lượt tải: 0
Xem trước 5 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Tham khảo tài liệu flex 3 with java- p3, công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả
Nội dung trích xuất từ tài liệu:
Flex 3 with Java- P3 Chapter 3The following example shows how to use a custom Error class in your application: try { throw new BreakFailureError(Breaks failure!!, 29); } catch (error:BreakFailureError) { trace(error.errorID + : + error.message) }Reserved words and keywordsReserved words are words that you cannot use as identifiers in your code becausethe words are reserved for use by ActionScript. Reserved words include lexicalkeywords which are removed from the program namespace by the compiler. Thecompiler will report an error if you use a lexical keyword as an identifier. Thefollowing table lists ActionScript 3.0 lexical keywords: as break case catch class const continue default delete do else extends false finally for function If implements import in instanceof interface internal is native new null package private protected public return super switch this throw to true try typeof use var void while withThere is a small set of keywords called syntactic keywords which can be used asidentifiers, but which have special meaning in certain contexts. The following tablelists ActionScript 3.0 syntactic keywords: each get set namespace include dynamic final native override static [ 87 ]Introduction to ActionScript 3.0There are also several identifiers that are sometimes referred to as future reservedwords. These identifiers are not reserved by ActionScript 3.0, though some of themmay be treated as keywords by software that incorporates ActionScript 3.0. Youmight be able to use many of these identifiers in your code, but Adobe recommendsthat you do not use them because they may appear as keywords in a subsequentversion of the language. abstract boolean byte cast char debugger double enum export float goto intrinsic long prototype short synchronized throws to transient type virtual volatileUsing ActionScript 3.0 with MXMLTo build a Flex application, you need to use a combination of MXML andActionScript 3.0 languages. For example, you may use MXML to layout and designyour user interfaces and write business logic in ActionScript. This is a commonpractice followed by Flex developers. In this section, we will see how to mixActionScript and MXML to build Flex applications.There are two ways to include an ActionScript file in your Flex application: • With the help of the tag • With the help of the include statementUsing the tagIn the Flex development environment, you can add ActionScript code in MXML fileby using the tag. See the following example: [ 88 ] Chapter 3 Notice that the above MXML code is using a tag to write ActionScriptcode to declare a variable and a function. You cannot use one script tag to specify asource attribute and include code within its body. The tag should beunder Application or any other top-level component tag. The term CDATA is used to represent the text data (in this case, its ActionScript code) that should not be parsed by the XML parser.This works well if your application requires less ActionScript code. But if yourapplication uses many MXML files and involves significant ActionScript code, thenthe best way is to separate your ActionScript code from MXML files and store it inexternal ActionScript file(s) with the .as extension.The tag lets you specify the source attribute that identifies the externalActionScript file to be included at that point in the application. The source attributesupports both absolute and relative paths. For example, the following script tagwill load an external ActionScript file named Util.as: Util.as: // ActionScript file private var color:String = «red»; private function calculateSum(x:Number, y:Number):Number { return x+y; } [ 89 ]Introduction to ActionScript 3.0The approaches above have no difference except that the second approach improvescode maintainability and readability. At the end of the day, the compiler copies theentire content of the external ActionScript file into the MXML application.Using the include directiveThe include directive is an ActionScript directive that copies the content of anexternal ActionScript file into your MXML application. The include directivecan only be used inside the tag and you can specify only a singleActionScript file for each include directive.Syntax: include file_nameThe following example includes Util.as: To create an ActionScript file to be included in Flex Builder, click on File | New |ActionScript File. This will create a blank file with an .as extension. You can startwriting your ActionScrip ...
Nội dung trích xuất từ tài liệu:
Flex 3 with Java- P3 Chapter 3The following example shows how to use a custom Error class in your application: try { throw new BreakFailureError(Breaks failure!!, 29); } catch (error:BreakFailureError) { trace(error.errorID + : + error.message) }Reserved words and keywordsReserved words are words that you cannot use as identifiers in your code becausethe words are reserved for use by ActionScript. Reserved words include lexicalkeywords which are removed from the program namespace by the compiler. Thecompiler will report an error if you use a lexical keyword as an identifier. Thefollowing table lists ActionScript 3.0 lexical keywords: as break case catch class const continue default delete do else extends false finally for function If implements import in instanceof interface internal is native new null package private protected public return super switch this throw to true try typeof use var void while withThere is a small set of keywords called syntactic keywords which can be used asidentifiers, but which have special meaning in certain contexts. The following tablelists ActionScript 3.0 syntactic keywords: each get set namespace include dynamic final native override static [ 87 ]Introduction to ActionScript 3.0There are also several identifiers that are sometimes referred to as future reservedwords. These identifiers are not reserved by ActionScript 3.0, though some of themmay be treated as keywords by software that incorporates ActionScript 3.0. Youmight be able to use many of these identifiers in your code, but Adobe recommendsthat you do not use them because they may appear as keywords in a subsequentversion of the language. abstract boolean byte cast char debugger double enum export float goto intrinsic long prototype short synchronized throws to transient type virtual volatileUsing ActionScript 3.0 with MXMLTo build a Flex application, you need to use a combination of MXML andActionScript 3.0 languages. For example, you may use MXML to layout and designyour user interfaces and write business logic in ActionScript. This is a commonpractice followed by Flex developers. In this section, we will see how to mixActionScript and MXML to build Flex applications.There are two ways to include an ActionScript file in your Flex application: • With the help of the tag • With the help of the include statementUsing the tagIn the Flex development environment, you can add ActionScript code in MXML fileby using the tag. See the following example: [ 88 ] Chapter 3 Notice that the above MXML code is using a tag to write ActionScriptcode to declare a variable and a function. You cannot use one script tag to specify asource attribute and include code within its body. The tag should beunder Application or any other top-level component tag. The term CDATA is used to represent the text data (in this case, its ActionScript code) that should not be parsed by the XML parser.This works well if your application requires less ActionScript code. But if yourapplication uses many MXML files and involves significant ActionScript code, thenthe best way is to separate your ActionScript code from MXML files and store it inexternal ActionScript file(s) with the .as extension.The tag lets you specify the source attribute that identifies the externalActionScript file to be included at that point in the application. The source attributesupports both absolute and relative paths. For example, the following script tagwill load an external ActionScript file named Util.as: Util.as: // ActionScript file private var color:String = «red»; private function calculateSum(x:Number, y:Number):Number { return x+y; } [ 89 ]Introduction to ActionScript 3.0The approaches above have no difference except that the second approach improvescode maintainability and readability. At the end of the day, the compiler copies theentire content of the external ActionScript file into the MXML application.Using the include directiveThe include directive is an ActionScript directive that copies the content of anexternal ActionScript file into your MXML application. The include directivecan only be used inside the tag and you can specify only a singleActionScript file for each include directive.Syntax: include file_nameThe following example includes Util.as: To create an ActionScript file to be included in Flex Builder, click on File | New |ActionScript File. This will create a blank file with an .as extension. You can startwriting your ActionScrip ...
Tìm kiếm theo từ khóa liên quan:
thủ thuật máy tính công nghệ thông tin tin học quản trị mạng computer networkTài liệu liên quan:
-
52 trang 439 1 0
-
24 trang 366 1 0
-
Top 10 mẹo 'đơn giản nhưng hữu ích' trong nhiếp ảnh
11 trang 328 0 0 -
Làm việc với Read Only Domain Controllers
20 trang 321 0 0 -
74 trang 309 0 0
-
96 trang 305 0 0
-
Báo cáo thực tập thực tế: Nghiên cứu và xây dựng website bằng Wordpress
24 trang 299 0 0 -
Đồ án tốt nghiệp: Xây dựng ứng dụng di động android quản lý khách hàng cắt tóc
81 trang 291 0 0 -
Tài liệu dạy học môn Tin học trong chương trình đào tạo trình độ cao đẳng
348 trang 291 1 0 -
EBay - Internet và câu chuyện thần kỳ: Phần 1
143 trang 278 0 0