A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: A challenge for the experts

  1. #1
    Junior Member
    Join Date
    Feb 2001
    Posts
    19
    What kind of scripting can I use to make a movie clip scrub back and forth randomly through a timeline?
    (wants the effect of a fluxuating bar)

    Any help is appreciated... my e-mail is LuckyBoyConfuzed@aol.com

    Thanx, I'm still learnin'...

    Dust

  2. #2
    Senior Member sxdesign's Avatar
    Join Date
    Aug 2000
    Location
    Serbia
    Posts
    844
    for example, if you want that effect on main timeline, create blank movie clip... put it on scene in separate always-visible layer, and right click on it... choose actions... type:

    onClipEvent (load) {
    firstRandom = random(_root._totalframes) + 1;
    }
    onClipEvent (enterFrame) {
    if (_root._currentframe != firstRandom) {
    if (_root._currentframe < firstRandom) {
    _root._currentframe++;
    } else {
    _root._currentframe--;
    }
    } else {
    firstRandom = random(_root._totalframes) + 1;
    }

    hope it helps...


  3. #3
    Junior Member
    Join Date
    Feb 2001
    Posts
    19
    That doesn't work- I need something to go through and play all of the frames as it is jumping back and forth through the timeline- the effect of a bar on a digital equalizer- fluxating up and down randomly, but all frames are played in between. That script just played it through and through like there were no actions.

    ANYone want to wager a guess here??

    Dust

  4. #4
    Junior Member
    Join Date
    Apr 2001
    Posts
    11

    the answer is here

    put this in everyframe that you want to use

    -------------------------------------------
    numframe = Math.random ();
    numframe = Math.round (numframe * 10);
    gotoAndPlay (numframe);
    -------------------------------------------

    with this code you can only use 10 keyframes, so if you want to use more change the number "10" to whatever.

    *hint: change the number to the highest keyframe number in order to not have any errors

  5. #5
    Senior Member Leo Lima's Avatar
    Join Date
    Jul 2000
    Location
    São Paulo, Brazil
    Posts
    745
    At the bar clip:
    Code:
    onClipEvent(load) {
      upper_limit = 40;
      lower_limit = 400;
    }
    
    onClipEvent(enterFrame) {
      this._y = lower_limit - (random(lower_limit - upper_limit));
    }
    this give you the effect of flutuation or it should.

    Regards,
    Leo Lima

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