Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Jul 2010
    Posts
    32
    Thanks
    1
    Thanked 0 Times in 0 Posts

    How to resize display of audio waveform

    Hi All,

    I found the following code in Adobe Cookbooks for drawing an audio waveform from an MP3 file:
    http://cookbooks.adobe.com/post_Draw...ile-16767.html

    The MXML code to hold the display of the waveform is as follows:
    Code:
    <mx:Canvas id="graph" backgroundColor="0xFFFFFF" backgroundDisabledColor="0xFFFFFF" width="100%" height="100%" backgroundAlpha="0"> 
       <mx:UIComponent id="slate" height="100%" width="100%"/> 
    </mx:Canvas>
    I included in myMXML code a slider beneath the waveform display. Also, the display is inside a Group, which is itself inside a Canvas:
    Code:
    <s:Group id="grpAudioFile" width="98%" height="10%" top="0" left="10" right="10">
       <mx:UIComponent id="slate" width="100%" height="100%" left="0" right="0"/>
       <s:HSlider id="audioSlider_2" y="46" width="100%" left="0" right="0" minimum="0" liveDragging="true" thumbDrag="dragStartHandler(event)" thumbRelease="dragDropHandler(event)" changeStart="sliderChangeStartHandler( event )" changeEnd="sliderChangeEndHandler( event )" stepSize="0.25"/>
    </s:Group>
    The issue that I'm having is that the display of the waveform does not resize at all when the container window is being resized, even though it has the same left and right attributes set as the slider, which resizes properly. The first attachment shows a full-sized window, and hence the display of the waveform is fine. However, the second attachment shows a resized window; the waveform display remains static and hence has the other resized components go over it.

    I read the following:
    The UIComponent class is not used as an MXML tag, but is used as a base class for other classes.

    Hence I looked at all of the subclasses of UIComponent to see if one is suitable for my task. I tried Graphic, but it didn't work either.

    Your help is much appreciated!
    Bonnie
    Attached Thumbnails Attached Thumbnails How to resize display of audio waveform-full-sized_window_waveform_display_ok.jpg   How to resize display of audio waveform-resized_window_waveform_display_not_resized.jpg  


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •