action script xml parsing failed.
        Posted  
        
            by sabuj
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by sabuj
        
        
        
        Published on 2010-05-08T07:02:08Z
        Indexed on 
            2010/05/08
            7:08 UTC
        
        
        Read the original article
        Hit count: 272
        
actionscript-3
TypeError: Error #1088: The markup in the document following the root element must be well-formed.
action script read xml from a codeigniter controller function but it shows the upper error. what should be done. bellow is my full coding structure ->
import fl.transitions.easing.; import fl.transitions.;
var xml:XML; var xmlList:XMLList; var xmlLoader:URLLoader = new URLLoader (); var productLoader:URLLoader = new URLLoader();
var imageLoader:Loader; var bigImage:Loader = new Loader(); var imageText:TextField = new TextField();
xmlLoader.load(new URLRequest("http://outshinebd.com/shopmajik/flash/shopdata"));
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
function xmlLoaded(e:Event):void { xml=new XML(e.target.data); xmlList = xml.children();
imageLoader = new Loader();
imageLoader.load(new URLRequest(xmlList.elements("shopbanner").attribute("src")));
imageLoader.x = -220;
imageLoader.y = -187;
addChild(imageLoader);
}
imgLoader.alpha = 0;
textLoader.alpha = 0;
imgLoader2.alpha = 0;
imgLoader3.alpha = 0;
imgLoader4.alpha = 0;
imgLoader5.alpha = 0;
//Item button is working here...
btnProduct.addEventListener(MouseEvent.CLICK, showProduct);
function showProduct(event:Event):void
    {
            imgLoader.alpha = 0;
            textLoader.alpha = 0;
            imgLoader3.alpha = 0;
            imgLoader4.alpha = 0;
            imgLoader5.alpha = 0;
            imgLoader2.alpha = 0;
    var productLoader:URLLoader = new URLLoader();
    productLoader.load(new URLRequest("http://outshinebd.com/shopmajik/flash/productdata"));
    productLoader.addEventListener(Event.COMPLETE , onProductLoad);
    function onProductLoad(e:Event):void
    {
        var productLoader:XML = new XML(e.target.data);
        xmlList = productLoader.children();
        textLoader.text = xmlList.elements("productname");
        textLoader.alpha =0;
    }
}
//Item button is working here...
btnItem.addEventListener(MouseEvent.CLICK, showItem);
//btnItem.addEventListener(Event:event, showItem);
function showItem(event:Event):void
{   
        imgLoader.alpha =0;
        textLoader.alpha=0;
        imgLoader3.alpha=0;
        imgLoader4.alpha=0;
        imgLoader5.alpha=0;
        imgLoader2.alpha=0;
    var itemLoader:URLLoader = new URLLoader();
    itemLoader.load(new URLRequest("http://outshinebd.com/shopmajik/flash/productdata"));
    itemLoader.addEventListener(Event.COMPLETE , onItemLoad);
    function onItemLoad(e:Event):void
    {
        var myLoader:XML = new XML(e.target.data);
        xmlList = myLoader.children();
        textLoader.text = xmlList.elements("productname");
        textLoader.alpha =0;
    }
}
//Details button workings...
btnDetails.addEventListener(MouseEvent.CLICK, showDetails);
function showDetails(event:Event):void
    {
            imgLoader.alpha=0;
            textLoader.alpha=0;
            imgLoader3.alpha=0;
            imgLoader4.alpha=0;
            imgLoader5.alpha=0;
            imgLoader2.alpha=0;
    var detailsLoader:URLLoader = new URLLoader();
    detailsLoader.load(new URLRequest("http://outshinebd.com/shopmajik/flash/productdata"));
    detailsLoader.addEventListener(Event.COMPLETE , onDetailsLoad);
    function onDetailsLoad(e:Event):void
    {
        var myLoader:XML = new XML(e.target.data);
        xmlList = myLoader.children();
        textLoader.text = xmlList.elements("productdescription");
        textLoader.alpha =0;
    }
}
btnImages.addEventListener(MouseEvent.CLICK, showImages); function showImages(event:Event):void
{
    textLoader.alpha=0;
    textLoader.text="";
    imgLoader2.alpha= 1;
    var imagesLoader:URLLoader = new URLLoader();
    imagesLoader.load(new URLRequest("http://outshinebd.com/shopmajik/flash/productdata"));
    imagesLoader.addEventListener(Event.COMPLETE , onImagesLoad);
    function onImagesLoad(e:Event):void
        {
        var xml:XML = new XML(e.target.data);
        xmlList = xml.children();
        imgLoader2.x=-155;
        imgLoader2.y= -50;
        imgLoader2.load(new URLRequest(xmlList.elements("productimage").attribute("src")));
        }
    }
btnPay.addEventListener(MouseEvent.CLICK , showPage); function showPage(e:MouseEvent):void { navigateToURL(new URLRequest("https://www.paypal.com/")); }
© Stack Overflow or respective owner