Docstoc

NumericStepper Component

Document Sample
NumericStepper Component Powered By Docstoc
					        NumericStepper Component
l You can use the numeric stepper
  anywhere you want a user to select a
  numeric value.
l NumericStepper parameters:
    l    Maximum: sets the maximum value that can
         be displayed in the stepper. The default
         value is 10.
    l    Minimum: sets the minimum value that can
         be displayed in the stepper. The default
         value is 0.
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.
        NumericStepper example
l   Ex) this example shows how to use numeric
    stepper component to change the speed of
    moving movie clip symbol.
    l   Create a new flash file
    l   Create new movie clip symbol and give it (m) as
        instance name
    l   Add a NumericStepper component from the
        component panel and name it (stepper)
    l   Give it the range (-10 to 10)
    l   Write the following action script in the action panel
        of the first frame:
        NumericStepper example
onEnterFrame = function()
{
    m._x = m._x + 10;
}
l You    will notice that the symbol will move
    in a constant speed
    l Try  to change the value of the stepper, you
      will notice that nothing will happen.
      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
         Loader Component
l You can use a loader whenever you need
 to retrieve content from a remote location
 and pull it into a flash application.
             Loader Parameters
l   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.
l   contentPath: the path of the file to load into
    the loader.
l   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.
               Loader Example
l   Ex) This examples shows how to select
    an image name from a list and display it
    in a Loader.
    l   Create a new flash file
    l   Add a list component into stage and give it
        (lst) as instance name.
    l   Add a button component and give it (btn) as
        instance name
    l   Add a Loader component and give it (lod) as
        instance name
          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.
        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;
}

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:3
posted:7/14/2013
language:simple
pages:10