TypeError: Error #1090: XML parser failure: element is incorrect.

So I try to do a carousel 3D Vertical using Flash CS3, ActionScript 3, a program called TweenMax and XML. The site that I got a tutorial is a dead site, so no help there.

Here is the error I get:

TypeError: Error #1090: XML parser failure: element is incorrect.
at outrageouslycooltitlescreennoerrors_fla::MainTimeline/xmlLoaded()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()

And here is the actionscript code that I have:

Import TweenMax
Import gs.*;

Path to the XML file
var xmlPath:String = " " http://download139.mediafire.com/ugg079ku9srg/7h8ki2fbhti272b/cookies.XML ";

Store the XML file in a variable
var xml;

Create a loader and load the XML. When finished, call the function xmlLoaded
var loader = new URLLoader();
Loader.Load (new URLRequest (xmlPath));
loader.addEventListener (Event.COMPLETE, xmlLoaded);

Call the function
function xmlLoaded(e:Event):void {}

Make sure that the variable is not null
If ((e.target as URLLoader)! = null) {}

Create a new XML object with the XML data that is loaded
XML = new XML (loader.data);

Call the function that creates the menu
createMenu();

}

}

Need to know how many items on the stage
var numberOfItems:uint = 0;

An array that contains all menu items
var menuItems:Array = new Array();

Set the focal length
var focalLength:Number = 350;

Set the vanishing point
var vanishingPointX:Number = stage.stageWidth / 2;
var vanishingPointY:Number = stage.stageHeight / 2;

Calculate the angleSpeed in the ENTER_FRAME listener
var angleSpeed:Number = 0;

Radius of the circle
var radius: Number = 128;

This function creates the menu
function createMenu (): void {}

Get the number of menu items, as we have
numberOfItems = xml.items.item.length ();

Calculate the difference in angle between the elements of menu in radians
var angleDifference:Number = Math.PI * (360 / numberOfItems) / 180;

Use a meter to see how menus have been created
var: County: uint = 0;

Performs a loop over all the < button > < / button > nodes in the XML document
for each {(var point: XML dans xml.items.item)}

Create a new menu item
var menuItem:MenuItem = new MenuItem();

Calculate the angle of departure for the menu item
var startingAngle:Number = angleDifference * count;

Define an attribute "currentAngle" for the menu item
menuItem.currentAngle = startingAngle;

Position of the menu item
menuItem.xpos3D = 0;
menuItem.ypos3D = RADIUS * Math.sin (startingAngle);
menuItem.zpos3D = RADIUS * Math.cos (startingAngle);

Calculate the ratio of scale for the menu item; the further question, the ratio of scale
var scaleRatio is focalLength /(focalLength + menuItem.zpos3D);.

Scale of the item of menu according to the scale ratio
menuItem.scaleX = menuItem.scaleY = scaleRatio;

Position of the menu item to the stage (from 3D to 2D coordinates coordinates)
menuItem.x = vanishingPointX + menuItem.xpos3D * scaleRatio;
menuItem.y = vanishingPointY + menuItem.ypos3D * scaleRatio;

Add text to the menu item
menuItem.menuText.text = item.label;

Add a variable "linkTo" for the URL
menuItem.linkTo = item.linkTo;

Say the text field do not intercept mouse events
menuItem.mouseChildren = false;

Affect the MOUSE_OVER, MOUSE_OUT, then click event for the menu item listeners
menuItem.addEventListener (MouseEvent.MOUSE_OVER, mouseOverItem);
menuItem.addEventListener (MouseEvent.MOUSE_OUT, mouseOutItem);
menuItem.addEventListener (MouseEvent.CLICK, itemClicked);

Add the menu item to the array of menu items
menuItems.push (menuItem);

Add the menu item to the stage
addChild (menuItem);

Assign an initial alpha
menuItem.alpha = 0.3;

Add a blur at the element
TweenMax.to (menuItem, 0, {blurFilter: {blurX:1, blurY:1}});}})

Update County
Count ++;

}

}

This function is called when a mouse is over an element
function mouseOverItem(e:Event):void {}

Interpolation of element properties
TweenMax.to (e.target, 0.1, {alpha: 1, glowFilter: {color: 0xffffff, alpha: 1, blurX:60, blurY:60}, blurFilter: {blurX:0, blurY:0}});}})

}

This function is called when a mouse is over an element
function mouseOutItem(e:Event):void {}

Interpolation of element properties
TweenMax.to (e.target, 1, {alpha: 0.3, glowFilter: {color: 0xffffff, alpha: 1, blurX:0, blurY:0}, blurFilter: {blurX:1, blurY:1}});}})

}

This function is called when the user clicks on an element
function itemClicked(e:Event):void {}

Navigate to the URL that is assigned to the menu item
var urlRequest:URLRequest = new URLRequest (e.target.linkTo);
navigateToURL (urlRequest);

}

Add a listener to EVENT_FRAME for animation
addEventListener (Event.ENTER_FRAME, moveCarousel);

This function is called in each frame
function moveCarousel(e:Event):void {}

Calculate the angular position mouseY speed
angleSpeed = (mouseY - stage.stageHeight / 2) * 0.0002;

To loop through the menu items
for (var i: uint = 0; i < menuItems.length; i ++) {}

Store the menu at a local variable item
var menuItem:MenuItem = [i] menuItems like MenuItem;

Update the current angle of the question
menuItem.currentAngle += angleSpeed;

Calculate a ratio scale
var scaleRatio is focalLength /(focalLength + menuItem.zpos3D);.

Scale of the element according to the scale ratio
menuItem.scaleX = menuItem.scaleY = scaleRatio;

Set of new 3D coordinates
menuItem.xpos3D = 0;
menuItem.ypos3D = radius * Math.sin (menuItem.currentAngle);
menuItem.zpos3D = radius * Math.cos (menuItem.currentAngle);

Update the coordinates of the element
menuItem.x = vanishingPointX + menuItem.xpos3D * scaleRatio;
menuItem.y = vanishingPointY + menuItem.ypos3D * scaleRatio;

}

Call the function that sorts the elements so that they overlap correctly
sortZ();

}

This function sorts the items so that they overlap correctly
function sortZ (): void {}

Sort the table so that the element that has the highest
z position (= further) is the first in the table
menuItems.sortOn ("zpos3D", Array.NUMERIC |) Array.DESCENDING);

Define the new index for the item children
for (var i: uint = 0; i < menuItems.length; i ++) {}
setChildIndex (menuItems [i], i);

}

}

the problem is in your xml file.

Tags: Adobe Animate

Similar Questions

Maybe you are looking for