Flex Tour (1)

Source: Internet
Author: User
To find the best solution for web development, you can try flex3. We recommend that you try it all. Official Eclipse plug-in: plugin. As a simple example, server technology is not checked. This step is a little tricky. In fact, I just want to write a demo and there is no need to use the server. Complete the information. The goal is to compile flexdemo. mxml.
 
<? XML version = "1.0" encoding = "UTF-8"?> <Mx: Application xmlns: MX = "http://www.adobe.com/2006/mxml" layout = "absolute" creationcomplete = "onLoad ();"> <mx: SCRIPT> <! [CDATA [import MX. controls. alert; import flash. external. * Public Function onload (): void {alert. show ("Hello World") ;}]]> </MX: SCRIPT> <mx: button label = "Call JavaScript alert" Click = "externalinterface. call ('alert ', 'Hello World'); "x =" 120 "Y =" 171 "/> </MX: Application>

Creationcomplete is equivalent to the onload event in Javascript, and click is equivalent to onclick. By the way, we have observed that there is no on event here. It is a verb. For example, the click event we see is a click event, layout = "absolute" should be absolute positioning.

Why <! [CDATA []> because the. mxml file is an XML file, the script contains special characters that cannot be recognized by XML, so you must use them <! [CDATA []> if you don't talk about anything else, you can guess what they mean by name.

I think it is similar to writing Javascript. Here I have written two examples: one is to call flex's msgbox and the other is to call JavaScript's msgbox. Literally, calling Javascript is an external call to call external, the import method here is the same as the import method in Java, that is, the method definition is a little unacceptable, and the return type is written in the following code: If it is the same as Java, it will be harmonious.

Even HTML has a graphic designer. Of course, you need to add an image to show the workspace in the design mode.

HoweverProgramIt may take K... maybe I won't use it. It should be compressed.

Example address

Http://www.flashempire.com/myfe/upload/flash/166/1651500_1215941762.swf

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.