MX2004 Components (2) Accordion [Fold menu]

zhaozj2021-02-12  141

MX2004 Components (2) Accordion [Fold Menu] Inherited: UIObject -> Uicomponent -> View -> Accordion

Package: mx.containers.accordion

New components in 2K4 can be used to make a folding menu, or it can be used to make a user registration interface, just like the type on the MM station, the first step, the second step. . . Made a form of folding menu. Accordion components generally have three working methods: Accordion combined with Screen Objects Accordion combined with MovieClip uses AS2

Accordion combined with Screen Open Flash? New and SELECT FLASH FORM Application. Double-click Form1, and enter AddressForm We will use AddressForm as an Accordion submenu content. Check AddressForm, set Visible = false in the Properties panel, the role is to let AddressForm's content can be seen in the Accordion component, and make a similar user name, address form, etc. Take a paint pen to draw a point. Then arrange them, put the aligned a bunch of stapsides in the upper left corner of Addressform [AddressForm's left corner corresponding to the top left corner of the Accordion component menu, if not put, Can't see in myaccordion]

Repeat the B-> D step, create a checkOutForm to create a new form is AccordionForm, place the Accordion component. Drag an Accordion component to Accordionform. Named MyAcCordion's selected status, do the following settings in the Properties panel: addressform, addressform, checkoutform, the name we have just created] Childsymbols property indicates which form will be the child as myaccordion component. Menu content. The first and second uses the same addressform because the contents of these two submeni are the same in this example. You can also customize it. In the ChildNames property, fill in: ShippingAddress, BillingAddress, Checkout The three strings filling here are provided to the AS script, when you need AS to control the submenu of MyAcCordion, you can use these three string ChildLable properties to fill in : Shipping address, Billing Address, Checkout These three strings will be displayed as the title of the MyAcCordion menu.

i) Ctrl ENTER test

2) Accordion with MOVIECLIP A) Select File> New and Create a New Flash Document. B) Ctrl F8 (NEW SYMBOL) Named AddressForm, click the Advance button, select Export for ActionScript. And in AS2.0 The Class is filled in: mx.core.view. The purpose of this is to let the Accordion's submenu inherit the View class, so you can implement Tab ORDER, of course, the AS2.0 does not fill an Accordion component can also work hard to customize Tab Order.

c), drag a few button, Label components to Addressform this MC, arranged, and set the position of all elements to (0,0) [AddressForm (0,0, 0) coordinates to Accordion (0) coordinate]. D) Back to the main scene E) Repeat B, C step Creating a CheckoutForm f) Drag an Accordion component to the main scene, name myaccordion and edit the following properties Childsymbols: [AddressForm, AddressForm Checkoutform] ChildName: [ShippingAddress, BillingAddress, Checkout] Childlable: [Shipping Address, Billing Address, Check Out] g) Test

Use AS2

Select File> New and Create A New Flash Document. Drag an Accordion component to the main scene and name the MyAcCordion to drag a TextInput and a Label component to the main scene and delete them, the purpose of doing it is to import them into the library for The first frame of the main scene is written in AS:

// Create three Accordion submenu, which is SimpingAddress, BillingAddress, payment, and createChild, the following statement creates an instance of a View class, called ShippingAddress, and sets its Label properties (that is, title text) ) as "Shipping Address", other similar myAccordion.createChild ( "View", "shippingAddress", {label: "Shipping Address"}); myAccordion.createChild ( "View", "billingAddress", {label: "Billing Address" }); Myaccordion.createchild ("view", "payment", {label: "payment"});

// Create the contents of the first submenu, add the textInput, Label component to the submenu // here's CreateChild method to create an instance of a "textInput" component existing in the SHIPPINGADDRESS submenu, named " FirstName "other similar var o = myAccordion.shippingAddress.createChild (" TextInput "," FirstName "screen.width / 2) this.width = screen.width / 2" vspace = 2 border = 0>; var l = myAccordion.shippingAddress .createchild ("label", "firstname", {text: "firstname"}; l.move (0, 10) o.move (70, 10); O.SetSize (110, 20);

// Create the content of the second submenu o = myaccordion.billingaddress.createchild ("textInput", "Lastname" screen.width / 2) this.width = Screen.width / 2 "vSpace = 2 border = 0>; l = Myaccordion.billingaddress.createchild ("label", "lastname", {text: "lastname"}; l.move (0, 50); O.MOVE (80, 50); O.Setsize (150, 20); This is the basic usage of the Accordion component, and some other methods, attributes, you can check the help, and then try one by one, it is easy to understand.

转载请注明原文地址:https://www.9cbs.com/read-6312.html

New Post(0)