0

Just recently, I've been trying to learn Actionscript 3 for Adobe Flash. Unfortunately, I cannot even get the most basic code to work. For some reason, when I run it, noting shows up in output, even though I have it set to trace the word "Hello". My Actionscript file IS seperate from my flash file.

My code is as follows. If you can help me identify the problem, I will be much thankful.

package { import flash.display.*; public class Test extends MovieClip { public function Test() { trace("Hello"); } } } 
3
  • did you set the fla's document class file as your Test{} class? If not, go to your publish settings, click on the "flash" tab, settings button beside 'script', and fill in the document class at the top with your class name Commented Dec 7, 2015 at 7:55
  • Also don't forget to instantiate at least one instance from that class : var instance:Test = new Test(); or if it's for a MovieClip in your library, you can also just drag and drop an instance to your stage ... Commented Dec 7, 2015 at 9:31
  • @bradley - to clarify, you only need to create a new instance of it if it's not your document class - that gets created once automatically when you run your app Commented Dec 7, 2015 at 9:44

1 Answer 1

1

Make sure you're running the debug player. Right-click on your SWF when it shows up - if you don't see an entry for "Debugger", then you're not running the debug player. You can download it from here: https://www.adobe.com/support/flashplayer/debug_downloads.html (run it once so it becomes the default)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.