A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Easing [acceleration/deceleration] PanO Image

Threaded View

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Posts
    2,467

    Easing [acceleration/deceleration] PanO Image

    Hi:

    Okay, I edited out all of my confusing commentary

    Can somebody please analyze the script below, and tell me why it runs choppy???

    It appears that it is too processor intensive at times, but I don't understand why that is.



    Actions on the clip:

    onClipEvent (load) {
    _x=0;
    _y=150;
    speed=0;
    targetSpeed=0;
    }


    onClipEvent (enterFrame) {
    _x+=Math.round(speed/3);
    if (speed < targetSpeed) {
    speed+=Math.round(10/8);
    }else if (speed > targetSpeed) {
    speed-=Math.round(10/8);
    }

    if (_x < 0) {
    _x=762;
    }else if (_x > 762){
    _x=0;
    }
    }


    Actions on the invisible hotspots/buttons [4 in all, each with different values]:


    on (rollOver) {
    _root.image1.targetSpeed=25;
    }
    on (rollOut) {
    _root.image1.targetSpeed=0;
    }


    Here is an example [no preloader, but only 55k]:

    http://www.ekigroup.com/360/hudsonPano.html


    BTW, if I just use a simple _x+=15, etc., there is no choppyness. The frame rate is 24fps.


    Thanks,

    James
    He is risen!!!
    Last edited by jamescover; 10-05-2002 at 07:37 PM.
    "God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life."

    Image Popup Scripting Engine | Thumb PopUp Script | HTML Anchors w/Flash | Popup Script Generator | Seq. Img Swap | Img Swap | Browser Shake | Rand. Img Swap | Inline Img Swap | Screen Res. PopUp | Screen Resolution Popup Script


Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center