Flash Gallery | Flash Templates | Flash Menu | Flash Design | Flash Audio & Video

flash page flip

Actionscript 3.0 video tutorials

+ Reply to Thread
Results 1 to 1 of 1

Thread: Kinematics with Actionscript 3.0-example 1

  1. #1
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,609
    Rep Power
    9

    Kinematics with Actionscript 3.0-example 1

    flash templates

    So far we have seen how to use Actionscript 3.0 to create effects and animations.

    We have seen how trigonometry, the Pythagorean theorem, collisions and much more.


    Now I would like to open a chapter on the kinematics applied to Actionscript 3.0.

    For those who do not know, the kinematics is a branch of mathematics that deals with movements bodies / objects but without the use of force or the masses and posed the problem of finding the causes accounting for such movements.


    For those who want to deepen the discussion, leave a link to Wikipedia:

    http://en.wikipedia.org/wiki/Kinematics


    So this is speed and direction.

    It seems very simple (and actually we'll see it is ) but kinematics can reach extremely complex formulas.

    Often the kinematics is applied in 3D softwares but we'll see in 2D ( since Flash CS3 has not 3D engine) and will be a beautiful view.


    The kinematics is of two types: direct and inverse.

    The direct dealing with movements that originate at the base of the system and move on free end (like a segment).

    The inverse is handled to the contrary, the animation originates from free end and back at the base of the system.


    We see the first example that relates move as a segment ...


    How to move a segment.


    Let's start to see how to move a segment with Actionscript 3.0 .

    First of all I draw the segment.


    Transform it to MovieClip and give it instance name: "segment_mc".


    Give it the registration point at the left fulcrum point of the segment, see picture below:


    immagine 1


    Drag a Slider component on the stage and give it instance name "my_slider".

    Give it a vertical positio and minimum value 0 and maximum value 90.


    Add the THUMB_DRAG listener to the Slider and here we go:









    Used code:


    Code:
    import fl.controls.SliderDirection;
    import fl.events.SliderEvent;
    
    my_slider.direction=SliderDirection.VERTICAL;
    my_slider.rotation=270;
    my_slider.minimum=0;
    my_slider.maximum=90;
    my_slider.value=0;
    my_slider.addEventListener(SliderEvent.THUMB_DRAG,onChange);
    
    function onChange(evt:SliderEvent):void
    {
    	segment_mc.rotation=evt.target.value;
    }
    Source files:
    Attached Files

+ Reply to Thread

Similar Threads

  1. Kinematics with Actionscript 3.0-example 2
    By Flep in forum Tutorials
    Replies: 0
    Last Post: 21-10-08, 06:16

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts