Well, there're couple of "strange" things you do...
1. You cannot set functions to be true or false, so, whenever you do:
draw = true or draw = false it wouldn't work (not even sure what have you tried to achieve by doing that).
2. I don't really understand why do you need to create some internal Sprite, UIComponent etc inside something that already extends Sprite (you could simply access Label's graphics property to draw on it...
3. are you intending to have line's size more than 0xFFFFFF (16777215 decimal) pixels (and never flip it?) why would you type size to uint?
4. Can you elaborate, what's "contained within itself"? The line is where you draw it... it belongs to the Graphics object of the display object containing it... once you draw it you can only clear it using Graphics#clear(). But untill you do it, it will remain the part of the display object where it is drawn.
What i'm trying to do is drawing inside a label or canvas ... width= 300 and heiht= 300 and not out
1- draw = false to stop drawing
2- i'am agree i can access label's graphic
3- maximum size is 80, i use int
4- I don't understand your answer, can you give me an example.
You cannot set function type variable to boolean value... well, no other language will let you do it... if you want to have a boolean variable you have to declare it as you did for other variables and set it to true / false when it is needed. Sealed method of the class cannot be changed / deleted / reassigned within that same class, assigning boolean to sealed class method should give you an error and should not compile (if it does compile for you somehow that's a compiler bug).
Well... I'll try a different approach... every sprite has a graphics property. This property is a reference to the instance of Graphics object this sprite internaly usues to render itself.
This object is somewhat different from other classes in a way:
- you cannot create new instances of such object.
- this object has no properties (only methods that eithier populate it with some visual info, or remove all info that was previously passed to it).
So, once you draw a line into the graphics you can either erase it together with the rest of the content of the graphics, or you can add something else to it. No controll over it's size and position of the line is possible after you draw it.