A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: changing movie speed...

  1. #1
    Member
    Join Date
    Sep 2000
    Location
    Sydney
    Posts
    73
    does anyone know how i can adjust the frame rates of my movie?

    my objectives is making allowing user to adjust the movie..~!! let say i have a menu which is rotating....
    like the one at http://www.bodekaer.dk/ (under samples section) and depending on the postions of the mouse.... the menu will rotate fast to let user scroll thur it fast or rotate slow so user can see each item slower....

    or did http://www.bodekaer.dk/ used another method that has nothing to do with speed control?

  2. #2

    this should help

    Originally posted by remote
    does anyone know how i can adjust the frame rates of my movie?

    my objectives is making allowing user to adjust the movie..~!! let say i have a menu which is rotating....
    like the one at http://www.bodekaer.dk/ (under samples section) and depending on the postions of the mouse.... the menu will rotate fast to let user scroll thur it fast or rotate slow so user can see each item slower....

    or did http://www.bodekaer.dk/ used another method that has nothing to do with speed control?
    to my knowlege, you cannot adjust the frame rate dynamically, byt you can adjust it by going to "modify"->"movie" to do what I think you are talking about, attach this code to any movie clip.(this is origional code that I will allow you to use, you can thank me later)

    onClipEvent (load) {
    var thewidth = this._width;
    var distnum = 0;
    var middlepoint = 275;
    var bleft = 260;
    var bright = 290;
    var accel = 2;
    var topspeed = 10;

    // this will randomly position the mc delete if you dont
    //want that
    setProperty (this, _x, random(550));
    setProperty (this, _y, random(400));
    }
    onClipEvent (enterFrame) {
    var mouseXpoint = _root._xmouse;
    if (mouseXpoint<bleft) {
    var mousedist = (mouseXpoint-bleft-accel*10);
    }
    if (mouseXpoint>bright) {
    var mousedist = (mouseXpoint-bright);
    }
    if (mouseXpoint>=bleft && mouseXpoint<=bright) {
    var mousedist = 0;
    }
    var distnumcount = mousedist/-topspeed;
    if (distnum<distnumcount) {
    distnum += accel;
    }
    if (distnum>distnumcount) {
    distnum -= accel;
    }
    var boxX = this._x;
    if (boxX<=(0-thewidth/2)) {
    setProperty (this, _x, (549+thewidth/2));
    }
    if (boxX>=(550+thewidth/2)) {
    setProperty (this, _x, 1-(thewidth/2));
    }
    if (boxX<(550+thewidth/2) && boxX>(0-thewidth/2)) {
    setProperty (this, _x, boxX+distnum);
    }
    }



    sorry, I don't have time to comment this up, but if you need it, just send me an e-mail JRGweb@san.rr.com or IM me, JRGweb and we can go over it.

  3. #3
    Member
    Join Date
    Sep 2000
    Location
    Sydney
    Posts
    73
    i got a few questions..~!

    i understand what you are trying to do...

    you are detecting the mouse postion and accerelate the object across it's _x-axis....

    this is the kinda thing i want to do.~!!
    i want to detect the mouse postion and accerelate the frame rate.~~!
    becuz my menu is rotating therefore it's different from the script you give me.~!!
    and thx alot for the script.~! can i modifiy(try to anyway) so that i accerelate through the timeline.?

    you think just by replacing...

    var boxX = this._x;
    if (boxX<=(0-thewidth/2)) {
    setProperty (this, _x, (549+thewidth/2));
    }
    if (boxX>=(550+thewidth/2)) {
    setProperty (this, _x, 1-(thewidth/2));
    }
    if (boxX<(550+thewidth/2) && boxX>(0-thewidth/2)) {
    setProperty (this, _x, boxX+distnum);
    }


    with...

    gotoAndPlay (distnum);
    ======================================

    i'm not sure if this will work... since i'm home now and the movie is on my office's computer...

    anyway... i'll try and put the script in when i get to the office tomorrow.~!!

    thx for your script.. it really gived me good idea....

    ps: in this line --> var distnumcount = mousedist/-topspeed;

    what does the /- mean? is it mousedist divided by -ve topspeed???



  4. #4
    in that line, i am just dividing by the negative of the top speed because if you look at the if statement it is in the case that you want the mc to go the other way, basically it is if the mouse is to the left of the "0 point" which indicates that you want to move left. i do believe what you suggested would work, that is instead of making the output set a property, make it set a frame number, it may be helpful though to make a dynamic text box or two and watch the output so that you can calibrate it.

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