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 4 of 4

Thread: as motion tween

  1. #1
    Junior Member Settled In triad boy is on a distinguished road
    Join Date
    Dec 2008
    Posts
    2
    Rep Power
    0

    as motion tween

    flash templates
    Hi there people
    I have created an image scroller that reacts to the position of your mouse on the stage using the tween class.
    I would now like to modify it so it scrolls left to right smoothly without the need to react with the mouse.
    Any tips much appreciated
    Triad
    Here is my code:
    Code:
    onClipEvent (load)
    {
       xcenter=327;
       speed=1/60;
    }
    onClipEvent (enterFrame)
    {
       var distance=_root._xmouse-xcenter;
       _x+=(distance*speed);
       if (_x > 0.3) _x=-3278.3;
       if (_x < -3278.3) _x=0.3;
    }
    triad promotional merchandise
    Last edited by Flep; 05-12-08 at 13:25. Reason: add it to signature

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

    Re: as motion tween

    Are you using that code with Flash CS4 ?

  3. #3
    Junior Member Settled In triad boy is on a distinguished road
    Join Date
    Dec 2008
    Posts
    2
    Rep Power
    0

    Re: as motion tween

    No Im using flash 8 but I plan to move it over to CS3 later today
    as the computer i am on has only got flash 8

    Cheers

    triad promotional merchandise

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

    Re: as motion tween

    Try this:
    Code:
    onClipEvent (load)
    {
       xcenter=327;
       speed=1;
    }
    onClipEvent (enterFrame)
    {
       _x+=speed;
       if (_x > 0.3) speed*=-1;
       if (_x < -3278.3) speed*=-1;
    }

+ Reply to Thread

Similar Threads

  1. Motion tween using circle as path: ERROR msg
    By Senx in forum Flash English
    Replies: 0
    Last Post: 26-01-10, 14:56
  2. Disegnare immagine in motion
    By markuspedro in forum Actionscript 3.0 avanzato
    Replies: 0
    Last Post: 29-08-09, 10:39
  3. Motion-Tracking
    By SWFish in forum Actionscript 3.0 avanzato
    Replies: 3
    Last Post: 01-07-09, 12:20
  4. as motion tween
    By triad boy in forum CS4
    Replies: 3
    Last Post: 05-12-08, 13:41
  5. Replies: 3
    Last Post: 14-11-08, 08:36

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