Hi,

At 12:12 PM 5/15/2002 -0500, you wrote:


>>>There is nothing preventing you from putting 10 QT sprites in a frame, 
>>>but in the specific cases of QuickTime and Flash, it's not a good idea 
>>>to do so, because there will be performance problems on slower 
>>>computers. This can result in jerky animation or audio stutters.
>>
>>Does that mean that the music will not play properly?
>
>It might not.
>
>>But aren't you playing a QT file at a time?
>
>If your user has several of them going at once, no. If you have several of 
>them appear at once and have not explicitly paused them, no; or at least 
>not necessarily.



Again I do not understand. How  does the user have several of them going at 
once?

Why do you write, 'at least not necessarily'?  Users don't do such things.



>>>It was simply the way I chose to do that part of the behavior; there is 
>>>no deeper mystery involved. I mean there is no technical reason to 
>>>prefer doing it that way, just as there is no technical reason to us 'n' 
>>>for integer variables. It's a question of style.
>>
>>Am I to understand that you can do it with variables with spaces?
>
>You can put almost anything you want to into a variable, including spaces 
>-- but some data types won't accept some things, such as number or symbol 
>formats. They won't lat you use spaces. Symbols won't allow punctuation either.



The purpose of using variables then is to achieve a certain outcome? Which 
you wish to have?



>>>    on MakeRandomPhrase
>>>
>>>      lSubjects = [ "Noelle", "Howdy", "Lingo" ]
>>>      lVerbs = [ "sleeps", "eats", "creates" ]
>>>      nSubj = random ( lSubjects.count )
>>>      nVerb = random ( lVerbs.count )
>>>      sSubj = lSubjects[nSubj]
>>>      sVerb = lVerbs[nVerb]
>>>      put sSubj && sVerb & "."
>>>
>>>    END MakeRandomPhrase
>>
>>How would I use this script?  As a parent script?
>
>No, it's just a movie script. Nothing elaborate about it. After entering 
>it you can call it in the message window.

Yes, it works as you said it would.


>>>This creates two lists of words, one of nouns (subjects) and the other 
>>>of verbs. The simplest syntax for a legitimate English sentence is 
>>>subject and verb, and what this does is make very simple, but randomly 
>>>selected and grammatically valid, sentences -- which it then puts into 
>>>the message window. (Of course some of those sentences -- "Lingo eats" 
>>>-- are nonsensical, but they're still syntactically valid.)
>>
>>So the stringing of variables occur only at author-time?
>
>No, it occurs when the handler is called, whether in a projector or not. 
>But generally the only place you'll have a message window is in authortime.


When is this type of handler normally called?



>>>As you can see the 'put' statement uses both forms of concatenator, the 
>>>first to string together the subject and verb into a phrase, the second 
>>>to add a period to the end of the sentence.
>>>
>>>The script would be entered as a plain movie script, after which you 
>>>could call it from the message window to see the sentences it builds.
>>
>>What is the purpose of a string in this context?
>
>I was using the term to imply the way one places beads on a string to make 
>a necklace. In programming specifically, a string is any variable that is 
>made of words or sentences (braodly speaking). Strings are indicated by 
>double-quotes.


But in the code you wrote,

on InitializeMyProps me
  if voidP ( psMyName ) then
psMyName = "no_sprite_" & (me.spriteNum)
  end if

  END InitializeMyProps

 > >Should there be two && here?  Your answer was :

No, I wanted the variable to concatenate without a space, so I used the 
single &, not the double.

So the above is not a string? What is it then?




>>>The QuickTime behavior, it would seem, was not attached to the QuickTime 
>>>sprite, which prevented it from sending its own reference to the 
>>>communication behavior, thus preventing the communication behavior from 
>>>registering it as a QuickTime sprite.
>>
>>How may a behavior not be attached to a sprite?
>
>The simplest way is for it to not have been attached in the first place.


So how do I attach it in the first place?



>>>It's good practice to do so. Theoretically one does not have to 
>>>initialize variables like this, at least not especially rigorously, but 
>>>I've found it's a good habit to do so.
>>
>>To initialize a variable, I set it to zero?  Is it possible to initialize 
>>it to other  than  zero?
>
>You can initialize a variable to contain anything, as long as you're 
>taling about a valid type of data Director can handle. When I start with a 
>zero value it generally means I'm about to do something else with the 
>variable, such as put a nonzero in it. But I don't stick to zero. I do my 
>initialization based on what is more or less the null value for the data type.
>
>That is, a list variable's "empty" state would be to contain an empty 
>list, [] (or [:] for a property list). Hence these variables all have 
>conceptually the same value -- null or empty -- but their initialization 
>indicates the kind of data they're expected to hold later on:
>
>   lOneList = []
>   lAnotherList = [:]
>   sName = ""
>   nDay = 0
>   fBankBalance = 0.0
>   yIndex = #null

Why does lOneList = [] look like this while lAnotherList = [:] looks this ? 
Or rather, an empty list does not contain  properties as you define it?


There are other types of lists you have not mentioned?





>>When I set the breakpoint in the mouseUp handler,  this is the message I 
>>receive:
>>
>>me = <offspring ''''' 34802b8>
>>
>>psTargetName=  "a"
>>pyMyDirection = #up
>>spriteNum =11me = <offspring ''''' 34802b8>
>>
>>psTargetName=  "a"
>>pyMyDirection = #up
>>spriteNum =11me = <offspring ''''' 34802b8> psTargetName= "a" 
>>pyMyDirection = #up spriteNum =11
me = <offspring ''''' 34802b8> psTargetName= "a" pyMyDirection = #up 
spriteNum =11



>>on the left, it says onMouseUp
>>
>>This is for the increase volume button.
>>
>>Where is the error? The code does execute.
>
>You need to step through the code to see where it goes from there. Getting 
>the debugger to open is only the first part of that process.


Sorry, what do you mean?

If I set the breakpoint at

  on InitializeMyProps me
     if voidP ( pyMyDirection) then
       pyMyDirection = #down
     end if
     if voidP ( psTargetName ) then
       psTargetName = "no_sprite"
     end if
   END InitializeMyProps


this is the message I receive:
me = <offspring ''''' 4 47d89c>
  psTargetName= "a"
pyMyDirection = #down
  spriteNum =12

( breakpoint is at if voidP ( pyMyDirection) then)

beginSprite and  InitializemyProps appears in the left window.


if I set the breakpoint at
if voidP ( psTargetName ) then

his is the message I receive:
me = <offspring ''''' 4 480 614>
  psTargetName= "a"
pyMyDirection = #down
  spriteNum =12

beginSprite and  InitializemyProps appears in the left window.


Is there any  difference between this 4 47d89c and this 4 480 614?
I know that  one contains alphabets, the other does not.


Please advise me. What do I do next?

Do I need to set any more breakpoints?

I am lost.

Noelle

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/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!]

Reply via email to