Hi List, I´m having a lot of trouble with this so I´m turning to you for
some help...
I´m importing a text file from the web which comes like this:
["square", 0, 0, 0, 156, 145, 145, "Gonzalo1"]
["square", 11, 0, 0, 97, 0, 104, "ray"]
["penta", 8, -7, 15, 145, 189, 228, "Gonzalo"]
["penta", -4, 0, 4, 158, 128, 109, "test_05"]
then on the first frame I´m calling a handler on a movie script which
(hopefully) is getting the text from the field converting it from a string
to a list setting the values of a property list and then creating (gbiglist)
a linear of all my property lists...
global graw, gbiglist, gblist
on assemble
gbiglist = []
gblist = [:]
repeat with i = 1 to the number of lines in filed("netTextResult")
graw = member("netTextResult").line[i]
graw = value(graw)
if not(field("netTextResult").line[i] = empty) then
gblist.setaProp(#shape,member(graw[1]))
gblist.setaProp(#hspeed,graw[2])
gblist.setaProp(#vspeed,graw[3])
gblist.setaProp(#rspeed,graw[4])
gblist.setaProp(#red,graw[5])
gblist.setaProp(#green,graw[6])
gblist.setaProp(#blue,graw[7])
gblist.setaProp(#name,graw[8])
end if
gbiglist.add(gblist)
-- updatestage
end repeat
end
at this point the problem is that gbiglist reads:
put gbiglist
-- [[#shape: (member 10 of castLib 2), #hspeed: -4, #vspeed: 0, #rspeed: 4,
#red: 158, #green: 128, #blue: 109, #name: "test_05"], [#shape: (member 10
of castLib 2), #hspeed: -4, #vspeed: 0, #rspeed: 4, #red: 158, #green: 128,
#blue: 109, #name: "test_05"], [#shape: (member 10 of castLib 2), #hspeed:
-4, #vspeed: 0, #rspeed: 4, #red: 158, #green: 128, #blue: 109, #name:
"test_05"], [#shape: (member 10 of castLib 2), #hspeed: -4, #vspeed: 0,
#rspeed: 4, #red: 158, #green: 128, #blue: 109, #name: "test_05"]]
only the last property list repeated 4 times.....
then I have 100 empty sprites channels 20 to 120
with the following behaviour attached..
global gbiglist
property my ,phspeed, pvspeed, prspeed, pname
on beginsprite me
my = sprite(me.spriteNum)
x = me.spritenum -19
my.member = gbiglist[x].shape
my.color = rgb(gbiglist[x].red,gbiglist[x].green,gbiglist[x].blue)
phspeed = gbiglist[x].hspeed
pvspeed = gbiglist[x].vspeed
prspeed = gbiglist[x].rspeed
pname = gbiglist[x].name
my.locH = random(600)
my.locV = random(500)
end if
end
on exitframe me
goh me
my.rotation = my.rotation + prspeed
end
on goh me
my.locH = my.locH + phspeed
if my.locH > 700 then
my.locH = -10
end if
if my.locH < -20 then
my.locH = 700
end if
end
the error here reads my.member = gbiglist[x].shape index out of range...
could you please tell me all the things I´m doing wromg?
thanks very much.
Gonzalo.
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]