Hi I am  creating ONE MCQ.

I have created one custom component.
In this component i have created four dynamic text.
i hav to get the data in this dynamic text through xml.

for this i hav created two class one is DisplayComponent and another
is DisplayXml.

code of DisplayComponent is:

package com
{
        import flash.display.MovieClip;
        public class DisplayComponent extends MovieClip
        {
                public var xmlObj:DisplayXml;
                public var comObj:mcqComponent=new mcqComponent();
                public function DisplayComponent()
                {
                        trace(comObj)

                        addChild(comObj);
                        comObj.x=300;
                        comObj.y=200;
                        xmlObj=new DisplayXml ;


                }
        }
}

where mcqComponent is our custom component.


code of DisplayXml is :

package com
{
        import flash.net.*;
        import flash.net.URLLoader;
        import flash.net.URLRequest;
        import flash.display.MovieClip;
        import flash.events.Event;

        public class DisplayXml extends MovieClip
        {

                var loader:URLLoader;
                var myXML:XML;
                public function DisplayXml()
                {
                        var url=new URLRequest("xmlData/ques.xml");
                        loader=new URLLoader(url);
                        loader.addEventListener(Event.COMPLETE,onLoadComplete);
                }
                function onLoadComplete(event:Event):void
                {

                        if (loader.data)
                        {
                                myXML=XML(loader.data);

                        }
                }
        }

}

-- 
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