Hi Kamal,
Where are you placing your SWF? Is it on the same server where the XML is?
If no, then this is due to the cross-domain issue. You will have to place a
crossdomain.xml file on the server where the XML is and allow the domain
which is hosting your SWF to access this site. Otherwise your code seems to
be okay.

Regards,
Venkat
www.venkatv.com

On Fri, Sep 5, 2008 at 2:58 PM, kamal <[EMAIL PROTECTED]> wrote:

>
> i have used the following code to load the xml file, xml not getting
> loaded and got message(An actionscript error has occured) on the
> browser when i the run code. please help me. where i'm doing the
> mistake?
>
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> layout="absolute" creationComplete="init();">
>        <mx:Script>
>                <![CDATA[
>                    import flash.net.URLLoader;
>            import flash.net.URLRequest;
>            import mx.collections.ArrayCollection;
>            import mx.controls.Alert;
>            public var myXML:XML;
>            public var myXMLURL:URLRequest;
>            public var myLoader:URLLoader;
>                        //
>                public function init():void{
>                        myXML = new XML();
>                                                var XML_URL:String =
> "http://www.example.com/Sample3.xml";;
>                        myXMLURL = new URLRequest(XML_URL);
>                        myLoader= new URLLoader(myXMLURL);
>                        myLoader.addEventListener("complete", xmlLoaded);
>                               }
>                public function xmlLoaded(event:Event):void
>                       {
>                            myXML = XML(myLoader.data);
>                            //trace("Data loaded.");
>                }
>   ]]>
>        </mx:Script>
>
>
> </mx:Application>
>
> >
>

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