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

correcting programming

New Here ,
Apr 14, 2017 Apr 14, 2017

I did this programming, but it's not compiling. The user would enter two values, the program calculated and drew

I have no experience with Action Script, I did based on two programs that I found on the internet

var vt: Number = 0;
var w: Number = 2;
var f: Number = 60;
var amplitude1: Number;
var inicial1: Number;
var rad:Number;
var cosseno:Number;
var cos: Number;
var direçãoX: Number;
var direçãoY: Number;
var cosWaveColor:uint = 0x00FF00;
amplitude.text="";
inicial.text="";
var i:uint;
for(i = 1; i < stage.stageWidth; i++)


btn_enter.addEventListener(MouseEvent.CLICK, onClickHandler);

function onClickHandler(e:MouseEvent): void {
    switch(e.target.name){
        case "enter";
            if(amplitude.text != "")(inicial.text !=""){
                inicial1= parseFloat(inicial.text);                
                cosseno= w * i + inicial1;
                cos Math.cos(cosseno);                              
                amplitude1= parseFloat(amplitude.text !="");
                vt = amplitude1 * cos;               
                direçãoX=vt;
                direçãoY=i;
               
                graphics.beginFill(cosWaveColor);
                graphics.drawRect(i, cosWavePosition + cosPosY, 2, 2);
               
            }
        break;
    }       
}

TOPICS
ActionScript
178
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
LEGEND ,
Apr 14, 2017 Apr 14, 2017

There are a lot of errors in the code. Also, it looks like you added code in the wrong place. When you looked at the example online, did you manage to get their version to work ok?

What page did you get the example from?

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
New Here ,
Apr 14, 2017 Apr 14, 2017
LATEST

I did based on several videos

I have no experience with action script

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