Hi!
My project has such u construction:
home.fla
- main file where I created my Website layout and menus with submenus
gallery.fla
(where I have all needed Movie Clips)with three classes:
1 - Miniaturka
which loads *.img
files
2 - Miniaturki
which loads *.xml
file
3 - Doc object
which has the functions stage.scaleMode
, stage.align
and Event.RESIZE
And when i publish the gallery.fla
to swf everything works fine.
But when i load by clickin one of my submenus the published gallery.swf then i get this error:
TypeError: Error #1088: The markup in the document following the root element must be well-formed.
at Miniaturki/onLoadXMLComplete()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
When i try to debug it i get in output also this:
Cannot display source code at this location.
The code where I load the xml file, looks so:
public class Miniaturki extends MovieClip {
private var mini:Array;
private var loader:URLLoader;
private var xml1:XML;
private var draging:Boolean = false;
public var count:Number = -1;
private var loadCompleteCount:int = 0;
private var savedImgs:Array = [];
public function Miniaturki():void
{
loader = new URLLoader();
loader.load(new URLRequest("obrazki.xml"));
loader.addEventListener(Event.COMPLETE,onLoadXMLComplete);
}
private function onLoadXMLComplete(event:Event):void
{
xml1 = new XML(URLLoader(event.target).data);
trace(URLLoader(event.target).data);
var i:Number;
mini = new Array(xml1.obrazek.length());
count = xml1.obrazek.length();
for (i=0;i<count;i++)
{
mini* = new Miniaturka(xml1.obrazek*.attribute("id"),i,callback);
}
MovieClip(parent).nazwa.text = xml1.obrazek[0];
MovieClip(parent).ilosc.text = "1/"+count;
MovieClip(parent).scro.buttonMode = true;
stage.addEventListener(MouseEvent.MOUSE_DOWN, beginDrag);
}
And the xml file looks so:
<?xml version="1.0" encoding="utf-8"?>
<obrazki>
<obrazek id="1"><![CDATA[Some text]]></obrazek>
<obrazek id="2"><![CDATA[Some text]]></obrazek>
<obrazek id="3"><![CDATA[Some text]]></obrazek>
<obrazek id="4"><![CDATA[Some text]]></obrazek>
<obrazek id="5"><![CDATA[Some text]]></obrazek>
<obrazek id="6"><![CDATA[Some text]]></obrazek>
<obrazek id="7"><![CDATA[Some text]]></obrazek>
</obrazki>
I,ve serched allredy a solution for this problem, and i tried to write the xml file again in Win8 notepad, in programs like EditPlus, and it didn’t solved it.
I also traced the (URLLoader(event.target).data)
value from line: xml1 = new XML(URLLoader(event.target).data);
And it traced me correct ale data from the Xml file.
Can anyone help?