|
-
little update
The txt files test0.txt and test1.txt look like this
xpositions=2,4,5,6,4,3,2,3,4,5,4,3,4
&ypositions=2,5,6,4,5,6,7,8,9,8,7,8,6
The complete code. (It's all in the first frame of the flash movie)
Code:
var loader:URLLoader = new URLLoader();
var xpos:Array = new Array();
var ypos:Array = new Array();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, loading);
function loading (event:Event):void {
xpos.push(loader.data.xpositions.split(","));
ypos.push(loader.data.ypositions.split(","));
}
for (var j:Number = 0; j < 2; j++){
loader.load(new URLRequest("test"+j+".txt"));
}
var bead_:Array = new Array();
for (var n:Number = 0; n < 3; n++) {
bead_[n] = new bead();
addChild(bead_[n]);
}
for (var k:Number = 0; k < 2; k++){
for (var i:Number = 0; i < 3; i++) {
bead_[i].x = xpos[k][i];
bead_[i].y = ypos[k][i];
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|