0

I've been looking for code for positioning the spectrum into the center of the flash screen, but unable to find it. I'm using the code below:

SoundMixer.computeSpectrum(liveBytes, false, 0);
var g:Graphics = this.graphics;
g.clear();
g.lineStyle(10, 0x000000);
g.beginFill(0x6600CC, 10);
for (var i:int = 0; i < 150; i++) {
drawSpectrum(liveBytes.readFloat() * 4, i);
}

the spectrum is displaying below the center of the screen(about 75% from top).

putoshop
  • 112
  • 3
  • 13

1 Answers1

0

You should use a child Shape or Sprite object's graphics property to draw on, because you then will be able to change the child's position to be the center of your stage or whatever area you designate.

var g:Graphics=spectrum.graphics; // "spectrum" is a child Shape

To further answer your question, it's required to see the drawSpectrum code. Also make sure drawSpectrum uses correct graphics object to draw upon.

Vesper
  • 18,599
  • 6
  • 39
  • 61