# ByteArray

**URL:** <https://forum.kirupa.com/t/bytearray/332366>\
**Category:** flash\
**Created:** [May 10, 2014, 1:28pm UTC](https://forum.kirupa.com/t/bytearray/332366 "2014-05-10T13:28:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottiescotsman](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@scottiescotsman](https://forum.kirupa.com/u/scottiescotsman)\
**Post date:** [May 10, 2014, 1:28pm UTC](https://forum.kirupa.com/t/bytearray/332366/1 "2014-05-10T13:28:18Z")

</div>

Hi have an oscilloscope type of thing for my mp3player… and it all works good apart from when the first cycle of the readFloat always originates from 0,0 and in the first piece of data it draws a little vertical line from 0,0 to first piece of data of 256.

How would I solve this ?

```auto

var spectrum:ByteArray = new ByteArray();
SoundMixer.computeSpectrum(spectrum);
sp.graphics.clear();
sp.graphics.moveTo(spX,spY+20);
for (var i:int = 0; i < 256; i++)
{
 spc = -20 + spectrum.readFloat() * 40;
 sp.graphics.lineStyle(1, 0x000000);
 sp.graphics.lineTo(i + spX, Math.abs(spc) + spY);
 addChild(sp);
}

```

Thanks in advance  
Steven :eek:
