Presentation is loading. Please wait.

Presentation is loading. Please wait.

NumericStepper Component You can use the numeric stepper anywhere you want a user to select a numeric value. You can use the numeric stepper anywhere you.

Similar presentations


Presentation on theme: "NumericStepper Component You can use the numeric stepper anywhere you want a user to select a numeric value. You can use the numeric stepper anywhere you."— Presentation transcript:

1 NumericStepper Component You can use the numeric stepper anywhere you want a user to select a numeric value. You can use the numeric stepper anywhere you want a user to select a numeric value. NumericStepper parameters: NumericStepper parameters: 1. Maximum: sets the maximum value that can be displayed in the stepper. The default value is Minimum: sets the minimum value that can be displayed in the stepper. The default value is 0.

2 NumericStepper Component 3. stepSize: sets the unit by which the stepper increases or decreases with each click. The default value is 1 4. Value: sets or gets the value displayed in the text area of the stepper. The default value is zero.

3 NumericStepper example Ex) this example shows how to use numeric stepper component to change the speed of moving movie clip symbol. Ex) this example shows how to use numeric stepper component to change the speed of moving movie clip symbol. 1. Create a new flash file 2. Create new movie clip symbol and give it (m) as instance name 3. Add a NumericStepper component from the component panel and name it (stepper) 4. Give it the range (-10 to 10) 5. Write the following action script in the action panel of the first frame:

4 NumericStepper example onEnterFrame = function() { m._x = m._x + 10; } You will notice that the symbol will move in a constant speed You will notice that the symbol will move in a constant speed Try to change the value of the stepper, you will notice that nothing will happen. Try to change the value of the stepper, you will notice that nothing will happen.

5 NumericStepper example 5. Now, write stepper.value instead of (10) You will notice that the speed of the symbol will change when the stepper value is updated

6 Loader Component You can use a loader whenever you need to retrieve content from a remote location and pull it into a flash application. You can use a loader whenever you need to retrieve content from a remote location and pull it into a flash application.

7 Loader Parameters autoload indicates whether the content should load automatically ( true ), or wait to load until the Loader.load() method is called ( false ). The default value is true. autoload indicates whether the content should load automatically ( true ), or wait to load until the Loader.load() method is called ( false ). The default value is true. contentPath: the path of the file to load into the loader. contentPath: the path of the file to load into the loader. scaleContent: indicates whether the content scales to fit the loader (true), or the loader scales to fit the contents (false). The default value is true. scaleContent: indicates whether the content scales to fit the loader (true), or the loader scales to fit the contents (false). The default value is true.

8 Loader Example Ex) This examples shows how to select an image name from a list and display it in a Loader. Ex) This examples shows how to select an image name from a list and display it in a Loader. 1. Create a new flash file 2. Add a list component into stage and give it (lst) as instance name. 3. Add a button component and give it (btn) as instance name 4. Add a Loader component and give it (lod) as instance name

9 Loader Example 5. Bring 4 images and put them beside the flash file (in the same folder). 6. Add the file names (without extensions) to the label parameter of the list. 7. Add the file names (with extensions) to the data parameter of the list. 8. In the action panel of the first frame add the following statement lst.selectedIndex=0; then test the movie and notice that the first item of the list is selected.

10 Loader Example 9. Add the following statement in the action panel of the first frame and notice the loaded image after playing the movie. lod.contentPath = lst.selectedItem.data 10. In the action panel of the first frame, add the following statements btn.onPress = function() { lod.contentPath = lst.selectedItem.data; }


Download ppt "NumericStepper Component You can use the numeric stepper anywhere you want a user to select a numeric value. You can use the numeric stepper anywhere you."

Similar presentations


Ads by Google