0
votes
var c = new Cloud();
c.x = Math.random() * 350;
c.y = Math.random() * 700;
clouds.push(c);
stage.addChild(c);

This code is in my document class, I don't get any errors, tracing the x, y, or even c values show correct values. Alas the Cloud objects are not visible.

I have tried parent.addChild(c) and stage.addChild(c); nothing seems to show them.

(note my stage is 350 width and 700 height)

1
are you sure you're running in the DebugPlayer. Please also check what's in the constructor of your Cloud class and what is done in the class this code is in.Rick van Mook
How do I ensure I am using "DebugPlayer"> The constructor for Cloud is empty. This class is document class, it handles everything at the minute (moving one object around screen while spawning Cloud objects)R Bowen
Right click on your Flash player, if you have the Debugger You'll see Debugger in the contextmenu. If the constructor is empty it's no surprise it's not showing since there is nothing to show yet. Please paste the content of the Cloud class. So we can double check what's wrong.Rick van Mook
I think the problem is in the Cloud class, post it please so we can have a lookSr.Richie
You say the code is in your document class and you have "tried parent.addChild(c) and stage.addChild(c)", but in the document class, I would think doing simply addChild(c) would be the normal case, so to speak.Lars Blåsjö

1 Answers

1
votes

Try to add a sprite instance at (100, 100) and draw on it a black rectangle (width = 100, height = 100). If you see it then the problem with the cloud instance (the cloud white on the white background?), and you should check a drawing method of the Cloud class.