Ask a Question related to Macromedia Director Lingo, Design and Development.
-
Gon2001 webforumsuser@macromedia.com #1
"Operand Expected" error
I am trying to create a "slider" function that works with a gauge needle. Basically, the lever moves vertically and with each pixel movement, the gauge needle needs to move so many degrees. I've received the following code from somewhere else, but I'm getting the "Operand Expected" error. Anyone have any idea what the deal is? What is wrong?
property thisSprite, animateMe, zeroPoint
property constraintSprite, constraintHeight
property dialSprite, minRotation, maxRotation
on getPropertyDescriptionList
myPropList = [:]
myPropList.addProp(#constraintSprite, [#comment: "enter the constraint sprite number:", #format: #integer, #default: 5])
myPropList.addProp(#dialSprite, [#comment: "enter the dial sprite number", #format: #integer, #default: 10])
myPropList.addProp(#minRotation, [#comment: "select the minimum dial rotation value:", #format: #integer, #range: [#min: 0, #max: 90], #default: 0])
myPropList.addProp(#maxRotation, [#comment: "select the maximum dial rotation value:", #format: #integer, #range: [#min: 180, #max: 270], #default: 180])
return myPropList
end
on beginSprite me
thisSprite = me.spriteNum
zeroPoint = sprite(constraintSprite).bottom
constraintHeight = sprite(constraintSprite).height
animateMe = 0
end
on mouseDown me
animateMe = 1
end
on mouseUp me
animateMe = 0
end
on mouseUpOutside me
animateMe = 0
end
on prepareFrame me
if (animateMe) then
sprite(thisSprite).locV = constrainV(constraintSprite, the mouseV)
sprite(dialSprite).rotation = ((zeroPoint -
sprite(thisSprite).locV)/float(constraintHeight)*(maxRotation - minRotation)) + minRotation
end if
end
Gon2001 webforumsuser@macromedia.com Guest
-
#39588 [NEW]: unpack("a*", "abc\0") does not work as expected
From: pprasse at actindo dot de Operating system: linux 2.6.10 PHP version: 4.4.4 PHP Bug Type: Scripting Engine problem Bug... -
Whats a "operand"
**Error** Scene=Page 1, layer=17, frame=2:Line 10: Operator 'add' must be followed by an operand t add tilenumber add .tilepick = myArrayb I... -
"Acrobat PDF file format is having difficulties expected a non-negative integer"
Posted this in a wrong folder before. Opening many of my AI 10 docs in AI CS is getting me this error message: "Acrobat PDF file format is having... -
"Expected a dict object" with Acrobat Prof 6.0 = lock up
Trying to view a PDF from a website (www.skidmorednagenealogy.com)(PDF entitled "Family Genetics Project") Using Adobe Acrobat Professional 6.0... -
execute + ArraySearch causes "Expected end of statement" error - Why?
Here is the function ArraySearch: '-------------------------------------------------------------------------------------- 'ArraySearch will... -
Mark A. Boyd #2
Re: "Operand Expected" error
On 02 Dec 2003, "Gon2001" [email]webforumsuser@macromedia.com[/email] wrote:
[snip]> I am trying to create a "slider" function that works with a gauge
> needle. Basically, the lever moves vertically and with each pixel
> movement, the gauge needle needs to move so many degrees. I've
> received the following code from somewhere else, but I'm getting the
> "Operand Expected" error. Anyone have any idea what the deal is? What
> is wrong?
I'm guessing you have a word-wrap problem there. The last three lines> on prepareFrame me
> if (animateMe) then
> sprite(thisSprite).locV = constrainV(constraintSprite, the mouseV)
> sprite(dialSprite).rotation = ((zeroPoint -
> sprite(thisSprite).locV)/float(constraintHeight)*(maxRotation -
> minRotation)) + minRotation
> end if
> end
beginning with 'sprite(dialSprite).rotation =' are probably supposed to be
on one line or used with the line continuation character. As it is now,
'zeroPoint -' is missing the operand that the subtraction operator is
supposed to use.
on prepareFrame me
if (animateMe) then
sprite(thisSprite).locV = constrainV(constraintSprite, the mouseV)
sprite(dialSprite).rotation = ((zeroPoint -\
sprite(thisSprite).locV)/float(constraintHeight)\
*(maxRotation - minRotation)) + minRotation
end if
end
But I have doubts as to the validity of that '+ minRotation' at the end.
--
Mark A. Boyd
Keep-On-Learnin' :)
Mark A. Boyd Guest
-
Gon2001 webforumsuser@macromedia.com #3
Re: "Operand Expected" error
Well, I too was COMPLETELY oblivious to the validity of the '+ minRotation' at the end also. I didn't even realize that the lines were thrown off by not paying attention continuation character. I've looked at what I have now and I think that is causing me a problem.
I've posted this issue at 5 different forums and you're the only one that has responded. Let's just hope it works or functions in some way by tomorrow. (thats when the assignment is due) No matter the outcome, I appreciate the feedback.
Still learning :o)
Gon2001 webforumsuser@macromedia.com Guest



Reply With Quote

