FORUMS: list search recent posts

Cant get fixed values from XML file

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Infected Cell
Cant get fixed values from XML file
on Jul 26, 2006 at 11:57:08 am

Greetings....

I am just trying to understand the following:
I Have written some XML file:




description="blabla1"
pic="url:link1" />

description="blabla1"
pic="url:link1" />

description="blabla1"
pic="url:link1" />





description="blabla2"
pic="url:link" />

description="blabla2"
pic="url:link2" />

description="blabla2"
pic="url:link2" />





Then in Flash:

var x:XML = new XML();
x.ignoreWhite = true;

var quantity:Number;
var mHolderPositY:Number=0;

var mface:Array = new Array();
var mname:Array = new Array();

var infon:Array = new Array();
var descriptionn:Array = new Array();
var pics:Array = new Array();

x.onLoad = function(success){
var mag:Array = this.firstChild.childNodes;
for (i=0;i mface.push(mag[i].attributes.mainpic);
mname.push(mag[i].attributes.magname);
quantity=0;
var mainHolder = this.attachMovie("holder","holder"+quantity,quantity);
mainHolder._x=0;
mainHolder._y=mHolderPositY;

trace(mface[0]);
trace(mname[0]);
trace(this.firstChild.childNodes[0].childNodes);

var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();

mclL.onLoadProgress = function(target,loaded,total){
var mount:Number = Math.round((loaded/total)*100);
mainHolder.loadbar._xscale = mount;
}

mclL.onLoadInit = function(){
mainHolder.loadbar._xscale = 0;
}

if (quantity quantity++;
loadNextContinfo;
}

mcl.addListener(mclL);
mcl.loadClip(mface[quantity],mainHolder.holder);
}


function loadNextContinfo() {
mHolderPositY = mHolderPositY+100;

var mainHolder = this.attachMovie("holder","holder"+quantity,quantity);
mainHolder._x=0;
mainHolder._y=mHolderPositY;

trace(mface[quantity]);
trace(mname[quantity]);
trace(this.firstChild.childNodes[quantity].childNodes);


var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();

mclL.onLoadProgress = function(target,loaded,total){
var mount:Number = Math.round((loaded/total)*100);
mainHolder.loadbar._xscale = mount;
}

mclL.onLoadInit = function(){
mainHolder.loadbar._xscale = 0;
}

if (quantity quantity++;
loadNextContinfo;
}

mcl.addListener(mclL);
mcl.loadClip(mface[quantity],mainHolder.holder);
}

x.load("myXML.xml");

If any mistakes in code, sorry, I wrote it quickly from work....

What I want to do as a result:
Flash find out all attributes (only 2 in XML file) and attach 2 buttons for attr.
if I click on button Flash find out all attributes and attach movieClips which equals to in concrete node.

So, I have trace it (see AS above) and:
trace(mface[0]); - filename.jpg
trace(mname[0]); - 1
trace(this.firstChild.childNodes[0].childNodes); - name="blabla1" description="blabla1" pic="url:link1" etc.......
works perfect. It shows me all values in required places

But when I try to trace it in


Return to posts index

lajoiet
Re: Cant get fixed values from XML file
on Jul 26, 2006 at 10:28:06 pm

I'm not sure if the xml formatting caused problems with your post or not, but from what I see, your XML file is not formatted correctly. I'm guessing that it didn't post completely, but without seeing the whole thing, there's no way to tell what's going on.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]