Skip to main content
Participant
October 29, 2015
Question

Line 29, Column 9 1119: Access of possibly undefined property height through a reference with static type Class.

  • October 29, 2015
  • 2 replies
  • 318 views

package  {

  import flash.display.MovieClip;

  import flash.events.Event;

  import flash.media.Microphone;

  import flash.display.StageAlign;

  import flash.display.StageScaleMode;

  public class sound extends MovieClip {

  private var _mic:Microphone;

  private var _sx:Number=0;

  private var sb:Number =_sx;

  

  public function sound(){

  into();

  }

  private function into():void{

  _mic = Microphone.getMicrophone();

  _mic.setLoopBack(true);

      addEventListener(Event.ENTER_FRAME, onFrame);

  }

  private function onFrame(event:Event): void {

     _sx *=.9;

     _sx +=.4;

  _sx -=_mic.activityLevel * .05;

  big.height +=_sx;

    

  

  }

}

}

This topic has been closed for replies.

2 replies

Inspiring
October 29, 2015

Look like you try to work with microphone amplitude, show microphone data gain to bar. Maybe "big" is a display object like sprite. Try use graphics might help:

big.graphics.clear();

big.graphics.beginFill(0x00FF00);

big.graphics.drawRect(0, 0, _width, _sx);

big.graphics.endFill();

Inspiring
October 29, 2015

"big" has no height property.. what is the type of the "big" object?