unintended afterimage of player

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
JamesWebster
Posts: 25
Joined: Sun Aug 07, 2011 11:36 am

unintended afterimage of player

Post by JamesWebster » Tue Nov 29, 2011 6:38 pm

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
Attachments
deliberation_revival.livecode.zip
(3.42 KiB) Downloaded 252 times
Last edited by JamesWebster on Fri Dec 02, 2011 1:44 pm, edited 1 time in total.

cbodell
Posts: 61
Joined: Wed Nov 09, 2011 7:27 pm

Re: Using a Counter and a Next button

Post by cbodell » Wed Nov 30, 2011 1:21 am

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!

JamesWebster
Posts: 25
Joined: Sun Aug 07, 2011 11:36 am

Re: Using a Counter and a Next button

Post by JamesWebster » Fri Dec 02, 2011 1:43 pm

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

Klaus
Posts: 14193
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: unintended afterimage of player

Post by Klaus » Fri Dec 02, 2011 2:33 pm

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

cbodell
Posts: 61
Joined: Wed Nov 09, 2011 7:27 pm

Re: unintended afterimage of player

Post by cbodell » Fri Dec 02, 2011 11:34 pm

James,

Awesome, glad it worked for you!

Post Reply