A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Predetermined scrubbing of a second flash animations

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    6

    Thumbs up Predetermined scrubbing of a second flash animations

    Hi all,

    Intro:
    For my thesis I'm busy to setup an experiment to test a new kind of Primary Flight Display interface (aircraft cockpit instrument). I want to do some performance tests on participants on the new one and the current one as control group. The participants are not giving any input, but are watching the instrument displaying different flight scenario's. So the airspeed and altitude are going up and down the whole time. I need to animate all these speed and alitude in- / decreasements myself.

    Problem:
    I already animated the airspeed indicator going slowly from 0 to 400 knots. Since the indicator is a bit more complicated than a normal one it would take ages to animate frame by frame if the speed goes i.e. slowly up/ fast up/ slow down/ fast down/ etc, as well as with the altitude tape. Is there a way to use my original animation object (going steady from 0 to 400 knots) and control via a second set of motion tweens or maybe coding. So i can for example let it first speed up from 100 to 200 knots in 20 seconds and afterwards, speed it up from 200 to 250 seconds in 30 seconds.

    It's like scrubbing my simple animation back and forwards on different speeds with a shuttle knob, only predetemined.

    Anyone a idea how i can do this within Flash?

    Otherwise I need scrub the forward and backward while screen capturing it. This only results in a non-flash file....

    PS: I'm using Flash CS5

  2. #2
    Member
    Join Date
    May 2012
    Posts
    51
    That should be doable. Instead of letting Flash run your animation, you manually go from frame to frame on a Timer event. You'll have something like gotoAndStop(Math.round(timeElapsed * currentFPS)) in the event handler. When the FPS is higher than normal, some frames will get skipped. As long as the motions are not large, the aliasing problem shouldn't be noticeable.

  3. #3
    Junior Member
    Join Date
    Jun 2012
    Posts
    6
    Many thanks,
    I'm going to do some more research on that specific area.

  4. #4
    Junior Member
    Join Date
    Jun 2012
    Posts
    6
    Now to be more specific: I've seen other people who manage to let the animation go to a frame number based on a variable.

    The airspeed are in accordance with the airspeed gauge frame number. Is there a way to let the animation go to the frame based on that airspeed values list? So i need a Gotoandplay(variable). And the variable must refresh itself i.e. every 30x per second according to the list of airspeed values.

    This makes it possible for me to let the flash airspeed instrument follow data from real flight (sim) sessions instead of animating all the flight scenarios manually.

  5. #5
    Member
    Join Date
    May 2012
    Posts
    51
    Well, it's just a matter of working out at what FPS the MovieClip should be playing at a given point. The math might be somewhat tricky but it's technically doable. Attached is a simple example.
    Attached Files Attached Files

  6. #6
    Junior Member
    Join Date
    Jun 2012
    Posts
    6
    Quote Originally Posted by cleong View Post
    Well, it's just a matter of working out at what FPS the MovieClip should be playing at a given point. The math might be somewhat tricky but it's technically doable. Attached is a simple example.
    This script works good and is exactly what i wanted in my first post. However I found out this way it would still take my ages if I want to animate a part of a flight.

    So I hope someone can point my in a good direction with this not working script. The airspeed indicator (speed) is a MC animated from 0 - 100%. It should feed the next value from the array in every i.e. 30/sec . So this way I can extract real airspeed values from a simulator and feed it automatically into flash without animating anything additional. This would definitely speed up my thesis progress.
    I've found some tutorials about arrays, but there they're loading multilpe array values into flash at the same time. I want to only load one variable from the txt at the time and load the next value every time the frame reloads itself (i.e. 30 fps)

    Code:
    var i:URLLoader = new URLLoader(new URLRequest("params.txt"));
    speed.gotoAndStop(i);
    params.txt example:
    Code:
    ...
    213
    214
    215
    214
    214
    215
    215
    216
    217
    219
    223
    236
    ...

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