Copy link to clipboard
Copied
I am new to flash and this error keeps happening and i don't know what is wrong with code i'd be glad if i got helped here is my code
package code
{
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.display.MovieClip;
public class Example extends MovieClip
{
public var answer:Number = 42;
public function showGreeting():void
{
var message:String = "Hello, world!";
trace(message);
}
var myTest:Example = new Example();
myTest.showGreeting();
}
Copy link to clipboard
Copied
My first guess would be that the two lines you have at the end are meant to be somewhere else other than the class file itself, such as in the main timeline of whatever file you are creating...
var myTest:Example = new Example();
myTest.showGreeting();
What is the complete error message?
Copy link to clipboard
Copied
Thx a lot for replying the full error says (Line 23:Acess of undefined property MyTest.)
Copy link to clipboard
Copied
Since the error shows it capitalized then you should check to make sure how you define it. And I still believe those last two line do not belong in the class file.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now