Nothing happens when debugging, blank output panel *AS3*
Copy link to clipboard
Copied
Sometimes when i debug my Air for Android application, nothing happens after the loader loads(my application wont show), and the output panel is blank, but if I try to debug it a second time, it will say "failed to launch test movie", but the 2nd time, it will work, and the output panel will say:
Test Movie terminated.
socket closed
help //<--trace items
X:175 Y:192 Height and Width:98 //<--trace items
X:330 Y:467 Height and Width:158 //<--trace items
Attempting to launch and connect to Player using URL C:/Documents and Settings/g.GLAPTOP/Desktop/Flash apps/Color Clicker/Color Clicker/Color Clicker-app.xml
Here are the codes for all of my actionscript files:
Document Class game.as:
package
{
import flash.events.MouseEvent;
import flash.display.MovieClip;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flashx.textLayout.formats.BackgroundColor;
public class Game extends MovieClip
{
public var myTimer:Timer = new Timer(5);
public var square:Square;
public var square2:Square;
public var background:Background;
public function Game()
{
background = new Background();
square = new Square();
square2 = new Square();
addChild ( background )
addChild ( square )
addChild ( square )
square.addEventListener(MouseEvent.CLICK, fl_click);
square2.addEventListener(MouseEvent.CLICK, fl_click);
myTimer.addEventListener(TimerEvent.TIMER, timerListener);
myTimer.start();
}
private function timerListener(e:TimerEvent):void
{
square.edgeCorrect();
}
private function fl_click(event:MouseEvent):void
{
square.moveDownABit();
}
}
}
Square.as:
package
{
import flash.geom.ColorTransform;
import flash.display.MovieClip;
public class Square extends MovieClip
{
var score:Number = 0;
public var square_x:Number;
public var square_y:Number;
public var square_height:Number = 0;
public function Square()
{
height = Math.round(Math.random() * 160 + 50);
width = height;
square_height = height;
square_x = Math.round(Math.random() * 385 + (width / 2));
square_y = Math.round(Math.random() * 700 + (height / 2));
x = square_x;
y = square_y;
trace("X:" + x, "Y:" + y, "Height and Width:" + height);
}
public function moveDownABit():void
{
trace("Object Clicked");
height = Math.round(Math.random() * 160 + 50);
width = height;
square_x = Math.round(Math.random() * 385 + (width / 2));
square_y = Math.round(Math.random() * 655 + (height / 2));
if (square_x + (width/2) > 480)
{
edgeCorrect();
square_x = square_x - 25;
}
if (square_y + (height/2) >750)
{
edgeCorrect();
square_y = square_y - 25;
}
if (square_x + (width/2) > 480)
{
edgeCorrect();
square_x = square_x - 25;
}
if (square_y + (height/2) >750)
{
edgeCorrect();
square_y = square_y - 25;
}
x = square_x;
y = square_y;
score = score + 1;
trace(score);
}
public function edgeCorrect():void
{
if (square_x + (width/2) > 480)
{
square_x = square_x - 10;
}
if (square_y + (height/2) >750)
{
square_y = square_y - 10;
}
if (x + (width/2) > 480)
{
x = x - 10;
}
if (y + (height/2) >750)
{
y = y - 10;
}
}
}
};
Background.as:
package {
import flash.display.MovieClip;
public class Background extends MovieClip {
public function Background() {
trace("help")
}
}
}
Can someone help me understand what is causing this "no debug" problem? It only works the second debug. My code may be wrong?
Also, each time i attempt to debug, two process build up in my task manager, right now, i have about 12 of process: simcontroller.exe, and also about 12 of svchost.exe in my task manager process list. I am running Win xp, on a crappy laptop.
Copy link to clipboard
Copied
It is not likely that the code is causing a problem with the IDE. It might be the computer if it is what you say it is. If the times when you do get an output do not indicate a problem with the code (meaning coding errors do not appear) then chances are there is nothing wrong with the code.

