How Does Flex include classes defined by. As in mxml and call class functions in mxml?

Source: Internet
Author: User

For example, the class you write is called a inherited from uicomponent.
Write <local: A/> In mxml. If it is not in the same folder as the current file, specify xmlns: test = "package name" in MX: application"
Write <test: A/> In mxml.

If the sprite subclass is B
Write
<Uicomponent creationcomplete = "complete ()">
<Mx: SCRIPT>
Import package name
Function complete (): void {
This. addchild (New B );
}
</MX: SCRIPT>
</Uicomponent>

<Mx: script source = ". As"/>.

 

If it is a class
Import in
Then instantiate
Call again

First, you must import the corresponding classes.
For example, import com. Web. mouseutil;
Use the new operator in use
Private function Init (): void
{
VaR mu: mouseutil = new mouseutil ();
Mu. Play ();
}

Build an application using ActionScriptProgramHttp://help.adobe.com/zh_CN/as3/learn/WS5b3ccc516d4fbf351e63e3d118a9b90204-7fd6.html

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.