Copy link to clipboard
Copied
Class
package {
// importing classes
import flash.display.Sprite;
// end of importing classes
public class Main extends Sprite {
public function Main() {
trace("Welcome to Concentration");
}
}
}
I tested my file at the start. I would continue, but there is not any output (after pressing F2) ... where can be the problem?
You're using a package so clearly you're using an external .as file for the code. Make sure the code is either in the same folder as the FLA or that you told Flash where to find it via Publish Settings for AS3.0 in the Source Path tab.
Your class is named Main so your external actionscript file should also be named Main.as
When you click anywhere on the black canvas the properties panel shows properties for the document like FPS, width, height, etc. There is a field called "Class" with a text inp
...Copy link to clipboard
Copied
What have you done to tie this class file into the fla?
Copy link to clipboard
Copied
In the class, there is an area "target" and put the name of my fla
Copy link to clipboard
Copied
You're using a package so clearly you're using an external .as file for the code. Make sure the code is either in the same folder as the FLA or that you told Flash where to find it via Publish Settings for AS3.0 in the Source Path tab.
Your class is named Main so your external actionscript file should also be named Main.as
When you click anywhere on the black canvas the properties panel shows properties for the document like FPS, width, height, etc. There is a field called "Class" with a text input next to it. Simply enter this in there: Main
Do not put the .as file extension on it, just "Main"
Now hit the pencil icon next to the input you just typed Main in. It might ask you what application you want to edit the code in, if so just say Flash Professional. Otherwise it should open up your code and you should see your package and your trace statement. If you do, you have it set up correctly. Try that.
Also make sure in Publish Settings for SWF that you have not checked off to "omit trace statements" or you won't see the trace.
Copy link to clipboard
Copied
Well done! Thanks for your hepl
Copy link to clipboard
Copied
Glad you got it working, please mark it answered so it's filtered. Good luck!