View Full Version : Flash CS3 error:
var734
July 31st, 2007, 09:23 PM
I am new to AS 3 programming. I have written simple program in "sample.as" file and also saved "sample.fla" with a text box in it. I tried to test the movie, it displays nothing. I tried all possibilities to find the answer, can anybody help me? When i checked for the errors in code in sample.as file, it shows a message abt compiler errors, but doesn't display what kind of error it is. Any help will be greatly appreciated.
package flash.text {
public class MyClass {
public function myMethod() {
trace("I am here");
}
}
}
Bash321
August 1st, 2007, 06:21 AM
did you make this class the document class?
if so, try importing flash.text.Textfield
thatguythatsme
August 1st, 2007, 09:01 AM
Doesn't the constructor method have to have the same name as the class name? I'm sure I read that this was a requirement in AS3.
David
ven
August 1st, 2007, 09:10 AM
Yes, and the package path should be your own domain or something unique, rather than mix it up with the flash.text package.
Example:
package com.example.test {
public class MyClass {
public function MyClass ():void {
trace("Hello World too you");
}
}
}
This must be in the file MyClass.as and in the folder com\example\test
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.