Jump to content
  • Advertisement
Sign in to follow this  

[web] Big problem with XML and ActionScript 2.0 Game development

This topic is 3455 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I have a big problem. I have a mousecapture movieclip and xml attributes.x and attributes.y coordinates. I want to display randomly in every 7 seconds an attributes.item name and when clicked on the _root["box"+i].mcraadius add attributes.points to the score. The clicked point must give a points only when the attributes.item is equal to it. Also if do not click on the right point he gets minus score from the distance sqrt(a)+sqrt(b) = sqrt(c) attributes.item is town name and points are points displayed in xml file i have no clue how to connect them. I need : random item in 7 seconds connect item name with points distance from the mcraadius ( if the distance is farer it will be bigger minus points ) Can anyone help me please? Code: _root.mousecapture.onRelease = function(){ viga = -2; } swfArray = new Array(); var kaart_xml = new XML(); kaart_xml.ignoreWhite = true; kaart_xml.onLoad = function(success) { if (success) { var kaart = this.firstChild; Speed = kaart.attributes.speed; gametime = kaart.attributes.gametime; NUMOFPICS = kaart.childNodes.length; for (var i = 0; i<NUMOFPICS; i++) { swfArray.push(kaart.childNodes.attributes.item); mc.duplicateMovieClip("box"+i, i); _root["box"+i]._x = (Math.floor(kaart.childNodes.attributes.x)+15)-(kaart.childNodes.attributes.raadius/2); _root["box"+i]._y = (Math.floor(kaart.childNodes.attributes.y)+15)-(kaart.childNodes.attributes.raadius/2); _root["box"+i].mcraadius._width = kaart.childNodes.attributes.raadius; _root["box"+i].mcraadius._height = kaart.childNodes.attributes.raadius; //_root["box"+i].textfield.text = kaart.childNodes.attributes.item; X = (Math.floor(kaart.childNodes.attributes.x)+15)-(kaart.childNodes.attributes.raadius/2); Y = (Math.floor(kaart.childNodes.attributes.y)+15)-(kaart.childNodes.attributes.raadius/2); v = Math.sqrt(X)+Math.sqrt(Y); scored = Math.floor(kaart.childNodes.attributes.points); score.text = 0; _root["box"+i].mcraadius.onPress = function() { if (swfArray[timerarray]) {score.text = (Math.floor(score.text)+scored);} } } } } kaart_xml.load("linnad.xml");

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!