How to Develop components in Flash cs5 in collaboration with Flex

Source: Internet
Author: User

Make the SWC component in flash, and apply the SWC in flex.1. Use tools flash cs5 + flash builder 2. It is more convenient to use Flash Professional to create animations and content than to use flex. 3. problem: most of the UI elements in Flex are inherited from the uicomponent class.

Uicomponent> flexsprite> sprite> displayobjectcontainer> interactiveobject> displayobject
Architecture in Flash (inheritance relationship of Sprite classes)

Movieclip> sprite> displayobjectcontainer> interactiveobject> displayobject
In Flex, The movieclip component in Flash cannot be used directly. 4. method 1--flash = mc class binding movieclip class direct export SWC flex = directly put into lib folder use/Add SWC storage path to project flex project menu-> properties-> flex build path-> library path Flex is encapsulated once. For example, SWC contains the test component;
Import MX. core. uicomponent; private var UI: uicomponent; private var test: Test; Private function Init (): void {UI = new uicomponent (); test = new test (); UI. addchild (TEST) addelement (UI);} method 2-flash = convert a component into a flex Component tool (Flex component kit) select the test component in the library and select the command> convert the component to the flex component. Then, the flexcomponentbase SWC will be added to the library.

  • NOTE: If your symbol is not assigned to its custom class, you have completed the task at this step. However, because your symbol has a custom class assigned to it, you need to update the component class in Flash builder to change its extension to MX. flash. uimovieclip to replace the standard flash. display. movieclip. This is the task that this command is trying to complete, but when you have defined it in Flash builder, it cannot assign a base class. You can use a compromise to make simple changes to your script.

  • Return to the Flash builder.importThe statement is changed to the following statement:
    Import MX. Flash. uimovieclip;
    SetextendsThe class name after the keyword is changed from movieclip to uimovieclip
    Public
    Class character
    Extends uimovieclip

    Flex = uses the same method as method 1, but does not need to be encapsulated once.

    If you want to create a class package, you can create a class package, drag the class into the package, and release SWC again. (I don't know why, I always encounter errors when I create a class package ?)

    Reference: http://www.adobechinadeveloper.com/Newsletter/June2010/Essential_the_Articles/animation_flash_fbuilder_04.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.