WAY too many players on the stack!`

Jon jbondy at sover.net
Sat Jun 4 19:46:17 EDT 2005


Bjoernke

Actually, I clicked on the Tools menu and created the Player that way, 
but I only did it once.

When I want to open (play) a new file (music/video), I do the following:

===
  if the QTVersion is "0.0" then
    answer "Apple's QuickTime must be installed for this program to work 
correctly!"
    exit mouseUp
  end if
  answer file "Select a file" with filter "Sound Files, *.MP3, Movie 
Files, *.MPG"
  if it = empty then exit mouseUp
  set the fileName of player "myPlayer" to it
  set the looping of player "myPlayer" to true
  set the playselection of player "myPlayer" to false
  set the playrate of player "myPlayer" to 1
  set the playloudness of player "myPlayer" to 100
  send "mouseUp" to button "PlayButton"
===

PlayButton does this:

===
   local i
  Set the StartValue of the scrollBar "myProgressBar" to 0
  set the EndValue of the scrollBar "myProgressBar" to the duration of 
player "myPlayer"
  set the thumbPosition of the scrolLBar "myProgressBar" to the 
currentTime of player "myPlayer"
  
  start player "myPlayer"
 
---

:)

Jon




Björnke von Gierke wrote:

>
> On Jun 05 2005, at 00:53, Jon wrote:
>
>> I suddenly realized that I have perhaps a dozen Players on my stack, 
>> all named "myPlayer", as if somehow my original Player has been 
>> accidentally cloned.  What might I have accidentally done to cause 
>> this?  The number of Players might be roughly the same as the number 
>> of different files I have tried to open, but I'm intending to reuse 
>> the single Player each time, not have lots of Players running or even 
>> instantiated at one time.
>>
>> :)
>>
>> Jon
>
>
> I assume that you choose "import as control" or "new referenced 
> file"from the file menu to get a new player.
> If that is the case you should try to get the inspector of a player, 
> and then set the fileName property of it ("source" in the inspector, 
> right under the name)
>
> have fun
> Bjoernke
>


More information about the use-livecode mailing list