Please copy and paste your code into the editor here, not as a screenshot.
Here is my custom codes:
thewordcounter = 1
wordList = 
soundList = 
thedefcounter = 1
defList = 
thepronuncounter = 1
pronunList = 
thecontextcounter = 1
contextList = 
c = 250
i = 1
p = ""
s = ""
repeat while i <= c
if i < 10 then
p = "00" & i
else if i < 100 then
p = "0" & i
p = i
add wordList, "word - " & p
add defList, "def - " & p
add pronunList, "pronun - " & p
add contextList, "context - " & p
add soundList, i
i = i + 1
c = c + 1
On Mousedown me
wordCounter = 250
thewordcounter = 1
repeat while thewordcounter <= wordCounter
if thewordcounter < 251 then
thewordcounter = thewordcounter + 1
wordCounter = thewordcounter
thewordnumber = wordList[wordCounter]
theword = member(thewordnumber)
defCounter = thedefcounter
thedefnumber = defList[defCounter]
thedef = member(thedefnumber)
pronunCounter = thepronuncounter
thepronunnumber = pronunList[pronunCounter]
thepronun = member(thepronunnumber)
contextCounter = thecontextcounter
thecontextnumber = contextList[contextCounter]
thecontext = member(thecontextnumber)
set the member of sprite (2) = theword
set the member of sprite (3) = thepronun
set the member of sprite (4) = thedef
set the member of sprite (5) = thecontext
set the member of sprite (9) = thewordcounter
Alert "I am not doing what you want me to do"
wordCounter = wordCounter + 1
While lists are a powerful and useful tool, I think you can get by without them in your case.
Try the following behavior attached to your button:
global gCurrentCounter on beginSprite me gCurrentCounter = 1 end on mouseUp me if gCurrentCounter < 10 then p = "00" & gCurrentCounter else if gCurrentCounter < 100 then p = "0" & gCurrentCounter else p = gCurrentCounter end if sprite(2).member = member("word - " & p) sprite(3).member = member("def - " & p) sprite(4).member = member("pronun - " & p) sprite(5).member = member("context - " & p) sprite(9).member.text = gCurrentCounter -- ?? if ( gCurrentCounter < 250 ) then gCurrentCounter = gCurrentCounter + 1 end
Thank you for the suggested code, please tell me this:
why the question marks here?
sprite(9).member.text = gCurrentCounter -- ??
If the counters become cast members, I can list and hopefully list them with
same statement such as this below?
sprite(9).member = member("counter - " & p).
Is there a better and simple formatted code for this?
The question marks were because I couldn't tell what you were trying to do. If there are cast members named like you suggest ("counter - " & p) then your code should work - try it and see.
I used List and return functions because they bring all the associated
charisteistics listed in the fields together. With the counter, the sound
does not work. There are sounds associated with each field that I would like
to make sure they play.
So, just counting and moving through the casts does not fulfil what I want
I hope you can help.
I saw your sound list declared and filled, but nowhere was there code dealing with playing it, so I figured the list was a left-over from a previous attempt that had been abandoned. What's more, your sound list is filled with integers - I have no way of knowing how you were going to use these to play sounds.
There are buttons attached to the fronts of the fields with code such as
On MouseDown me
Puppetsound 1, sprt_sound
So what about something like:
global gCurrentCounter on mouseUp me sSoundName = gCurrentCounter & "a" sound(1).play(member(sSoundName)) end
This does not work exactly the way it should since logically, the mouseup
handler is mostly what this react to. The logics really needs to be more
grounded than what we have so far in order for this to work properly.
Trying to to count forward and back, the logic is messing up.
Your sugestions have been greatly motivating and very helpful. I have done,
thanks a lot.
Hey Sean_Wilson, I mean we have done it. It is working very well, I figured
out the sequence that will do exactly what I want it to do.
Thank you again.