WEB Any actionscript gurus here?

Discussion in 'OT Technology' started by BoostedBoogie, Mar 14, 2008.

  1. I'm trying to control the framerate of a movieclip within my flash project. I'm doing it by bytearrays values from a sound. so basically, i'm trying to speed up the framerate of something if the bass hits of a song. so this is what i have (actionscript 3)

    function spectrum(event:Event)
    if (beat3.hitTestObject(main) || beat1.hitTestObject(main) || beat2.hitTestObject(main)){
    a = 0;
    for(var i=0; i <256; i=i+12)
    a = ba.readFloat();
    var num:Number = a;
    main.width = 446 + num*100;
    main.height = 446 + num*100;
    speed.frameRate = 30 + num*100;
    main.width = 446;
    main.height = 446;
    speed.frameRate = 30;

    so pretty much what that's doing is taking the bytearray values from the sound and scaling up the movieclip file according to those bytearrays. it's also changing the framerate of a moving movieclip from 30 to 30 + those bytearray values, so technically it's supposed to speed up whenever the bass of a song hits.

    i'm tracing the speed.frameRate values and they are definitely changing between 30-120fps depending on the song, but the =movieclip stays a constant 30fps on the stage. any ideas? :dunno:

Share This Page