Page 1 of 1

unintended afterimage of player

Posted: Tue Nov 29, 2011 6:38 pm
by JamesWebster
Hi everyone,

this time my goal is to create a stack which contains only three stacks but can use different arrays of Videos to process. That's why I'm always going from card 1 to 2 to 3 and back to card 1. After an Introduction one is supposed to see a Video, then rate it within a certain time limit and go on either by clicking a button or by the end of the counter. While everything seemed to work fine without the Counter and the Counter seems to work fine for counting as well, I always get an error message which tells me:
"Type Chunk: no such object
Object Trial1
Line put x into field "Counter.1"
Hint Counter.1"
I included the faulty code and attached the stack file. Can anybody help?

Code: Select all

global Videos
global Trialreihenfolge
global TrialreihenfolgeZeit
global Läufer
local filepath

On Preopencard
   put specialFolderPath("desktop") & "/deliberation/" & Videos[Trialreihenfolge[Läufer]] into filepath
   set the filename of player "Trial.1" to (filepath)
   show player "Trial.1"
   start player "Trial.1"
   put "" into field "Counter.1"
end Preopencard


On playStopped
   put the milliseconds into TrialreihenfolgeZeit[Läufer]
   repeat with x = 0 to 10
      wait for 1 second with messages
      put x into field "Counter.1"
   end repeat
end playStopped
best regards
James

Re: Using a Counter and a Next button

Posted: Wed Nov 30, 2011 1:21 am
by cbodell
Hi James,

That would mean your field control isn't named accordingly. Mak sure the field itself is named "Counter.1".
If that's not the case, then be more specific within the code, fld "Counter.1" of cd "card name"

Good Luck!

Re: Using a Counter and a Next button

Posted: Fri Dec 02, 2011 1:43 pm
by JamesWebster
Hey cbodell,

thank you, being more specific worked!,


but now I have another problem with the player: i'm going from card 1 to 3 and back to 1. On card 2 and 3 are videos. After I click the next button to get to the first card again the Player still shows for a few seconds and then vanishes. I don't think that's in the code, that's why don't have any idea how to solve this.

best regards
James Webster

Re: unintended afterimage of player

Posted: Fri Dec 02, 2011 2:33 pm
by Klaus
Hi James,

are you using LiveCode 5.x?
There are still some known issues with the player object.

But I would advice to not start a player on "preopencard" since at that time the card is not visible yet!

Maybe you should do something like this:

Code: Select all

global this and that...

on closecard
  stop player "Trial.1"
  set the filename of player "Trial.1" to empty
end closecard

On Preopencard
   put specialFolderPath("desktop") & "/deliberation/" & Videos[Trialreihenfolge[Läufer]] into filepath
   set the filename of player "Trial.1" to empty
   show player "Trial.1"
end Preopencard

On Opencard
   put specialFolderPath("desktop") & "/deliberation/" & Videos[Trialreihenfolge[Läufer]] into filepath
   set the filename of player "Trial.1" to (filepath)
   start player "Trial.1"
   put "" into field "Counter.1"
end Opencard
Best

Klaus

Re: unintended afterimage of player

Posted: Fri Dec 02, 2011 11:34 pm
by cbodell
James,

Awesome, glad it worked for you!