Forum ActionScript 3.0 addchild not doing anything

Problems and discussions relating to ActionScript 3.0 here.

addchild not doing anything

Postby fritzcat12 » November 4th, 2015, 11:23 pm

I am trying to add a simple rectangle to my stage.
Code:
Code: Select all
private function makeBox(){
         
                        trace("Test");
         var myBox:Shape = new Shape();
         myBox.graphics.beginFill(0xFF0000);
         myBox.graphics.drawRect(50, 50, 150, 150);
         myBox.graphics.endFill();
         addChild(myBox);

         
      }


But it doesnt do ANYTHING. All I see is a black stage (My stage color is set to black)
It doesnt work with a textfield either...

And yes, my server is running. There are no errors in the console. This function is being run because the trace outputs to the console.

EDIT: I have been dealing with this for like 2 weeks. Please respond quickly D:
fritzcat12
 
Posts: 1
Joined: August 5th, 2015, 3:17 am

Return to ActionScript 3.0



cron