Anyone know what I have to fill in for function getData() in my program? AdobeAnimate3.0 C++
This is the coding I made. But its missing something in order for the program to work, other wise the lblOutput will just give me N/A when calculating Velocity. Theres a function writtin below, and I have to get data somehow. Would anyone know what I have to fill in?
// Name:
// Date:
// Purpose: To calculate the velocity of an object
// This line makes the button, btnDisplay wait for a mouse click
// When the button is clicked, the displayVelocity function is called
btnDisplay.addEventListener(MouseEvent.CLICK, displayVelocity);
// These lines make the textinputs wait for a mouse click
// When any of these components are clicked, the clearLabels function is called
txtinDistance.addEventListener(MouseEvent.CLICK, clearLabels);
txtinTime.addEventListener(MouseEvent.CLICK, clearLabels);
// Declare Global Variables
var distance:Number; // distance
var time:Number; // time
// This is the displayVelocity function
// e:MouseEvent is the click event experienced by the button
// void indicates that the function does not return a value
function displayVelocity(e:MouseEvent):void
{
// declare the variables
var velocity:Number; // velocity
getData();
velocity = distance / time;
lblOutput.text = "The velocity is: " + velocity.toFixed(1) + " km/h.";
}
// This is the getData function
// It gets the distance and time from the user
function getData()
{ // get data <--This part right here.
// This is the clearLabels function
// e:MouseEvent is the click event experienced by the textInput
// void indicates that the function does not return a value
function clearLabels(e:MouseEvent):void
{
lblOutput.text = "";
}
here is the program I made, sorry its small, try to zoom in
