Home > Default > Access XML array inside MovieClip. How ?!

Access XML array inside MovieClip. How ?!

November 30Hits:0
Advertisement
Hello,
Ok, I have a code to load Multiple XML files at once and save it to an array named xmlDocs like this:
//each xml file to load
var xmlManifest:Array = new Array();
//the xml for each file
var xmlDocs:Array = new Array();
//the xml file with all the xml files to be loaded.
var RSSWidgetRequest:URLRequest = new URLRequest("xml/rss-widget.xml");
var urlLoader:URLLoader = new URLLoader();
var docsXML:XML = new XML();
docsXML.ignoreWhitespace = true;
//when COMPLETE is loaded run function loadDocs
urlLoader.addEventListener(Event.COMPLETE,loadDocs);
urlLoader.load(RSSWidgetRequest);
//load the docs
function loadDocs(event:Event):void {
docsXML = XML(event.target.data);
//m21m is the name space defined in my doc m21m:feed... you don't need one.
var m21m:Namespace=docsXML.namespace("m21m");
//get all the feed nodes
var feeds=docsXML..m21m::feed;
for (var i:int=0; i < feeds.length(); ++i) {
  //add the feed to the xmlManifest array
  xmlManifest[xmlManifest.length] = feeds[i].attribute("feed");
//load the xml for each doc
loadXMLDocs();
//load all the XML files
function loadXMLDocs() {
if (xmlManifest.length>xmlDocs.length) {
  var RSSURL:URLRequest = new URLRequest(xmlManifest[xmlDocs.length]);
  var urlLoader:URLLoader = new URLLoader();
  var xmlDoc:XML = new XML();
  xmlDoc.ignoreWhitespace = true;
  urlLoader.addEventListener(Event.COMPLETE,getDoc);
  urlLoader.load(RSSURL);
  function getDoc(event:Event) {
   xmlDoc = XML(event.target.data);
   //hold all the xml of each doc in an array
   xmlDocs[xmlDocs.length] = xmlDoc;
   loadXMLDocs();
} else {
  trace(xmlDocs)
  //do something when all xml is loaded
How i can access xmlDocs array difinte on main timeline from insted MovieClip...?!
Regards,

Answers

It does not work. I used this code to display the data:
var xmlList:XMLList;
var xmlData:XML = new XML(MovieClip(this.parent.parent).xmlDocs[0].data);
xmlList = xmlData.class10;
sId10_btn.addEventListener(MouseEvent.CLICK, displayData);
function displayData(evt:MouseEvent):void
          for each (var grade:XML in xmlList)
                    if (myTextField.text == grade.st_id.text())
                              content10.sName10.text = grade.st_name;
                              content10.sQuran10.text = grade.quran;
                              content10.sIslamic10.text = grade.islamic;
                              content10.sArabic10.text = grade.arabic;
                              content10.sEnglish10.text = grade.english;
                              content10.sMath10.text = grade.math;
                              content10.sChemistry10.text = grade.chemistry;
                              content10.sPhysics10.text = grade.physics;
                              content10.sBiology10.text = grade.biology;
                              content10.sSocial10.text = grade.social;
                              content10.sSport10.text = grade.sport;
                              content10.sComputer10.text = grade.computer;
                              content10.sNesba10.text = roundNumber(Number(grade.nesba), 2);

Read other 11 answers

Tags:

Related Articles

  • Access XML array inside MovieClip. How ?!November 30

    Hello, Ok, I have a code to load Multiple XML files at once and save it to an array named xmlDocs like this: //each xml file to load var xmlManifest:Array = new Array(); //the xml for each file var xmlDocs:Array = new Array(); //the xml file with all

  • How to access XML files inside IDML?November 30

    Hi All, How to access the different XML files like designmap, story, masterspread, etc. found inside the IDML files? Pl. help. Thanks, PraveenAn External Library DC is only intended to include jars. Using a Java DC may be a better idea, unless you pu

  • How to access the array insideNovember 30

    public iterate(int ngens) {        int p=0;         int q=0;         for(int n=0; n<ngens; n++){             for(q=0; q<n; q++){                 for(p=0; p<m; p++){                     if(cells[(p-1+m)%m][(q+1+n)%n]==ALIVE){                      

  • How can I access xml document from javascript whithin a JSP pageOctober 11

    how can I access xml document from javascript whithin a JSP page? I have a JSP that receives an XML document from a JavaBean, so I can access it within the entire JSP, but I need to access it from the javascript inside the JSP... and I have no idea h

  • How to set variable value in an XML arrayOctober 11

    Hi, Please let me know how to set the value for a xml array element using assign activity inside a for-each block in BPEL 11g I tried to set the variable value for result element using the below condition but i encountered selection failure message $

  • Can I access a label inside of an MC and then go back to the main time lineOctober 11

    Here is my current set up. I have a labeled section on main time line which has icons of 12 different videos. Each icon acts as a button and brings a user to a labeled section with a FLV Video Playback component impemented to play the corresponding v

  • How can I fill structure from the line with contetnt of a XML file inside?November 30

    How can I fill structure from the line with contetnt of a XML file inside? I have array of lines with XML documents inside. All XML's have the same structure. I need to fill array of structures (with the same structure like given XML's) from data of

  • How to access XML elements by name in Extendscript??November 30

    I'm almost done the script that I've been working on, but something has been nagging me since I started. When I did start, I looked at the JS Tools Guide CS5 that comes with the extendscript ide to check how to access XML elements, children, attribut

  • Parsing an xml document inside a ThreadOctober 11

    Hi Friends I have to do some processing in my application for which i need to use multithreading. Inside every new thread created i have to parse an xml document using s parsing tool like castor or jibx. My question is that is it possible to parse a

  • Java Mapping with an xml array as inputOctober 11

    Hi Gurus, I have to perform a java mapping to map some input xml contained in an array with a target message type. I have found a good java mapping example here: Re: Please provide Java Mapping example but my mapping input is not a single XML, but an

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.782 s.