This content has been marked as final. Show 6 replies
Try pasting the following into a behavior script and attaching it to
your #text sprite/s:
-- GPDL defined:
on isOKToAttach(me, sType, sNum)
if ( sType = #graphic ) then return (sprite(sNum).member.type = #text)
return [#myText: [#comment: "Text to appear:", #format: #string,
on beginSprite me
myMember = sprite(spriteNum).member
myOriginalText = myMember.text
myMember.editable = 1
myKeyDownCount = 0
on keyDown me
myKeyDownCount = myKeyDownCount + 1
if ( myKeyDownCount <= length(myText) ) then
myMember.text = myText.char[1..myKeyDownCount]
on endSprite me
myMember.text = myOriginalText
Thanks, but I'm getting the following Error message:
Script error: Operand expected
return [#myText:[#comment: "Text to appear:",#format:#string,?
The newsgroup probably inserted a rogue line break. That block should
three lines of code. There is one line for the 'on
getPropertyDescriptionList' and then one line of code, then the 'end' on
the 3rd line.
Thanks, changing the block to 3 lines of code worked & the Error code has gone.
But, when I play the movie and type in the text field the output from my actual keystrokes show, not the pre-defined "Text to appear:" from the behavior code.
Hope I'm not sounding like a complete dunce.
Make sure it is set as a behavior and make sure you put it on the text
sprite. It should work.
I was being a dunce!
I needed to add the text I wanted to appear to the text sprites Behaviour Parameters.
Working perfectly now.
Huge thanks for your help