Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Oct 29, 2015 Oct 29, 2015

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;

    

  

  }

}

}

TOPICS
ActionScript
297
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 29, 2015 Oct 29, 2015

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 29, 2015 Oct 29, 2015
LATEST

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();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines