Answer the question
In order to leave comments, you need to log in
microphone sound indicator
We all know that if you create a listener for the enter_frame event, you can pull out the sound level values from the activityLevel.
I need to bind this to changing the width of the block and everything just happened. But I need to add an easing function to change the block width.
Here I do not know what to do, because with enter_frame easing simply does not have time to execute as it starts again.
How can I do this in this case? make a smooth microphone level indicator?
Answer the question
In order to leave comments, you need to log in
I don't really understand the question. EnterFrame is the frame entry event. There can be no redrawing between 2 EnterFrames, because redrawing is a frame change. Accordingly, changes made in the previous frame (for example, width) will be displayed only in the next one. Thus, if the easing function manages to execute within one frame, then there will be no smoothness.
In order to achieve smoothness, you can create a timer and take the microphone level value once, for example, per second on the TimerEvent.Timer event. About 24 frames change per second, so you can watch normal animation. Then you can set the interval to the required.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question