A
A
Alexander Borisovich2013-08-16 16:46:15
Apache Flex
Alexander Borisovich, 2013-08-16 16:46:15

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

1 answer(s)
I
Ilya Plotnikov, 2013-08-16
@Alexufo

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 question

Ask a Question

731 491 924 answers to any question