Hi,

DisplayObject's, such as Sprite, MovieClip have properties called "stage" and "root".

A flash/flex2 application can only have one stage but can have multiple roots (for each loaded SWF/Image).

Check out the DisplayObject API for stage and root properties.

 http://livedocs.macromedia.com/labs/1/flex/langref/flash/display/DisplayObject.html


-abdul


On 3/6/06, witchythewanderer <[EMAIL PROTECTED]> wrote:
How can I place a canvas or other object on the stage from a class?
I've tried the following

public class Window extends Sprite {

       private var c:Canvas;
       public function Window() {
            c = new Canvas();
            c.setStyle("borderStyle", "solid");
            c.setStyle("borderColor", "#FFABC4");
            c.width = 100;
            c.height = 100;
            var s:Stage = new Stage();
            s.addChild(c);

       }

}


Well, that doesn't work, but I'm somewhat lost at where to look next.
Any pointers in the right direction would be much appreciated.

Kind regards,

Sonja Duijvesteijn

ps. if this message was sent twice my apologies, i'm having some
trouble with my mail.





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to