Object
  ---> EventDispatcher
     ---> DisplayObject
        ---> InteractiveObject
            ---> DisplayObjectContainer
                ---> Sprite
                     ---> FlexSprite
                         ---> UIComponent
                            ---> Container
                                ---> Canvas

Above is the inheritance hierarchy of the objects we are talking about here
.... Flex framework starts at FlexSprite and basically all flex framework
classes don't really understand anything above that ...Sprite,
DisplayObject, TextField etc are player level classes that provide the basic
API to give instructions to the flash player .. all these classes are found
in the flash.*   package.

Flex Framework is a framework built on top of the Flash Player classes to
provide solutions to various common problems we face when building
applications that run in the flash player  ... the basic unit of visual
objects inside Flex Framework is the *UIComponent* more commonly known as a
"component" ... Canvas is a Container (a UIComponent itself) for
UIComponents ... a Canvas can only position UIComponents .. it does not
understand what a DisplayObject is and hence it does not know how to deal
with a TextField ... basically a Canvas uses APIs that only a UIComponent
has to position an object .. so you cannot add a DisplayObject/Sprite to a
Canvas.

Anything that inherits from UIComponent can be added to a Canvas ... A
UIComponent though can have Sprite children .. so wrapping your Sprite in a
UIComponent is an option ... but if you are dealing with just a text input
field ... there is already a class in Flex framework that does that ...
TextInput , which is a UIComponnet and can be added to a Canvas.

_
Mrinal
http://www.mrinalwadhwa.com













On Sat, Aug 22, 2009 at 9:56 AM, divya <[email protected]> wrote:
>
> hi , every one
> i am new in action script . i am creating a textinput in action
> script  class which extends sprite. . and want to add it at canvas in
> application. but its not working. while if i  am adding textfield its
> working. what is the basic reason behind it. how  can i know  which
> control can be  add to a conatiner and which is not.
> please help me . i will be highly obliged to u.
>
> thanks and regards
> divya singh
>
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to