Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a little help! Plssssssssssssss!

Status
Not open for further replies.

DJErotix

Programmer
Mar 5, 2003
11
RO
i have this code:
i = 1;
pictures = new loadVars();
pictures.load("pic.txt", pictures);
pictures.onLoad = function() {
_root.poza.loadMovie(pictures.pic1);
_root.poza._x = 0;
_root.poza._y = 23;
};
stop();

i like to load some images wich adresses are in pic.txt at position pic1, pic2, pic3 etc. To load first image i write the line:
_root.poza.loadMovie(pictures.pic1);
but i like to increment i with 1 unit and the code must be something like this:
_root.poza.loadMovie(pictures.pic);
but when i do so flash try to load movie "pictures.pic" insted of position pic where my adress is located.
What can i do?
 
Havent tested it but this ought to work to load the jpgs into an empty clip at whatever x and y

pictures = new loadVars();
pictures.onload = function(){

numItems = myData.NumItems;
for (i=0; i<numItems; i++) {
var Name = eval(&quot;pictures.pic&quot;+i);
var xpos = eval(&quot;pictures.xpos&quot;+i);
var ypos = eval(&quot;pictures.ypos&quot;+i);
loadmovie(name +&quot;.jpg&quot;,clip);
_root.clip._x = xpos;
_root.clip._y = ypos;
}
}
pictures.load(&quot;pic.txt&quot;);



WITH pic.txt

&pic0=pic&xpos0=100&ypos=50&

&numitems=1&
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top