Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-24-2009, 11:22 AM   #1
phingko
Registered User
 
Join Date: Oct 2009
Posts: 8
Default passing class to xml

All wise people out there!!
screaming for help from a desperate student

I am making a game project using tiles.
I want to ask bout the xml.

I know how to load an xml data into the stage by using one class from library

However, rite now, I have 3 customer_mc with class for each:
char1,char2,char3

And i have this xml data called customer_xml that contents the customer name,order and payment.
So far i know how to call one class and do a for loop but i cant find a way to call three classes and put it into the for loop.


function init(xmlString:String):void {
customer_xml = new XML(xmlString);
for (var i:uint = 0; i<customer_xml.customer.length(); i++) {
var customer_mc:char1= new char1();
customer_mc.y = Math.random()*stage.stageHeight;
customer_mc.x = Math.random()*stage.stageWidth;
addChild(customer_mc);
customer_array.push(customer_mc);

}
}

The questions are:
how can i put three customer mc into the for loop? Do I put it in an array? Do you mind give me an example?

Second, I don't want it to be put randomly on the stage but only on the right corner of the stage. Is that mean, I put a precise coordinate for the customers mc?

Thanks in advanced
phingko is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:23 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.