Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 625747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:20:36+00:00 2026-05-13T19:20:36+00:00

Im trying to build a script that attaches and positions an instance of a

  • 0

Im trying to build a script that attaches and positions an instance of a movieclip for each node of an xml sheet. However, I can’t seem to get it to loop properly. The script is simply attaching and positioning a single movieclip according to the last node in the xml file. Can anyone tell me what I am doing wrong?!!

Here is my script:

var myXML:XML = new XML();
myXML.ignoreWhite=true;
myXML.load("map.xml");
myXML.onLoad = function(success) {
if (success) {
var myPin = myXML.firstChild.childNodes;
for (i=0; i<myPin.length; i++) {

var imageNumber = i+1;

_root.attachMovie("box", "pin"+i, _root.getNextHighestDepth());
var xpos = myPin[i].attributes.xpos;
var ypos = myPin[i].attributes.ypos;
_x = xpos;
_y = ypos;

}
}
};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:20:36+00:00Added an answer on May 13, 2026 at 7:20 pm

    You are not getting the attached movieclip when positionning. Your mc are generated on _root with the name “pin” + i, so you need to use _root[“pin” + i] to get the related instance.

    Try this :

    _root.attachMovie("box", "pin"+i, _root.getNextHighestDepth());
    var xpos = Number(myPin[i].attributes["xpos"]);
    var ypos = Number(myPin[i].attributes["ypos"]);
    _root["pin" + i]._x = xpos;
    _root["pin" + i]._y = ypos;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build an MSBuild script that maps a network drive to a
Im trying to build a simple AJAX script that uses a form to send
I am trying to run an ant build script that compiles GWT. This script
I'm trying to build a script that counts the number of characters in an
I'm trying to build a little script that would let me do this: http://example.com/appicons.php?id=284417350
I'm trying to get the Build Script that's included in HTML5 BoilerPlate (http://html5boilerplate.com/) to
I am trying to build a script that retrieves a list of thumbnail images
So I'm trying to build a script that automagically prepends valid column names with
Here's what I'm trying to do: A single build script That script builds two
I have a simple image rotator script that I'm trying to build but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.