开发者

Trace not working in Flash

开发者_StackOverflow社区

In have searched the forums and can't find the appropiate answer. I do not have the "omit traces" option checked in publish settings (I use flash CS5). Here is my code:

package 
{

 import flash.display.MovieClip;


 public class gr extends MovieClip
 {


  public function gr()
  {
   // constructor code
   var mc:MovieClip = new MovieClip();
   mc.graphics.beginFill(0xFF0000);
   mc.graphics.drawRect(0, 0, 100, 80);
   mc.graphics.endFill();
   mc.x = 200;
   mc.y = 60;
   addChild(mc);
   trace("hi")
  }
 }

}

The creation of a movieclip works fine, but the trace doesn't. This is the main class.


Try quitting your Flash CS5 and start with a fresh Fla document then your main class.

The code above works, so there must be something either in the options or your setup that is preventing the debugging from working.

Depending on which debugger you are using .. you should see the debugger option available in the control menu. Try using the debug option available in the CS5 menu.


In my experience, the compiled as3 clip never shows traces, even when the creation of the clip does. I always have a dynamic textbox somewhere on the stage that I just add text to when I want to view a variable in a compiled clip.


In my experience, the compiled as3 clip never shows traces, even when the creation of the clip does. I always have a dynamic textbox somewhere on the stage that I just add text to when I want to view a variable in a compiled clip.

That's right on, Joel. (I can't upvote as a noob on here so yeah...)

Use ctrl+shift+enter to run in debug mode (which WILL trace) instead of publishing (which does NOT trace in my experience).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜