1 / 8

Components

Components. Prepared flash items used to give flash documents more functionality. Windows  Development Panels-> Components: Some of these components are user interface components for building flash forms.

luke
Télécharger la présentation

Components

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Components • Prepared flash items used to give flash documents more functionality. • Windows  Development Panels-> Components: • Some of these components are user interface components for building flash forms. • Each component has a set of parameters that can be set to adjust the visual aspects of the component, how they operate, or what data they contain.

  2. TextInput Component • The TextInput component is a single-line text component to allow user to enter data to flash file. • The TextInput component is a single-line component. • Parameters in TextInput Component: • editable indicates whether the TextInput component is editable (true) or not (false). The default value is true • password indicates whether the field is a password field (true) or not (false). The default value is false • text specifies the contents of the TextInput component. The default value is (an empty string) • visible is a Boolean that indicates whether the object is visible (true) or not (false). The default value is true

  3. Example • Ex) this example shows how to insert a TextInput component onto the stage and manipulate it. • Create a new flash file. • Go to (Windows  Development Panels-> Components) • Insert a TextInput component onto stage, and give it (myText) as instance name. • Add a button onto the stage. • On the action panel of the first frame add the following code

  4. Example myText.visible = false; • Run the program (ctrl + Enter) • You will notice that the text input will disappear. Why?? • On the action panel of the button, add the following code: on(press) { myText.visible = true; myText.text = “Nice example”; } • Run the program

  5. Button Component Parameters used in Button Components: • icon adds a custom icon to the button. The value is the linkage identifier of a movie clip or graphic symbol in the library; there is no default value. • This can be done by: • Inserting an image to the library (File->import to library) • Inserting new empty movie clip symbol (Insert ->new Symbol) • Dragging and dropping the image onto the symbol area. • Giving linkage identifier to the symbol (right click on symbol then choose linkage • Assign this linkage identifier to the icon parameter of the button • label sets the value of the text on the button; the default value is Button.

  6. Button Component • selected if the toggle parameter is true, this parameter specifies whether the button is pressed (true) or released (false). The default value is false • toggle turns the button into a toggle switch. • If true the button remains in the down state when clicked and returns to the up state when clicked again. • If false the button behaves like a normal push button. • The default value is false. • visible is a Boolean value that indicates whether the object is visible (true) or not (false). The default value is true.

  7. Button Component • Ex) this example shows how to stop a moving movie clip symbol after pressing on a toggle button component. If you pressed again, it will continue moving • Create a movie clip symbol, give it (shape) as instance name. • Add a button from the component library. Give it an instance name (btn) • Change the button to toggle button using parameter panel. • In frame (1), add the following code:

  8. Button Component onEnterFrame = function() { if(btn.selected==false) shape._x = shape._x + 3; }

More Related