Google Answers Logo
View Question
 
Q: Macromedia Director 'Lingo-script' problem!!! ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: Macromedia Director 'Lingo-script' problem!!!
Category: Computers
Asked by: purplepit-ga
List Price: $40.00
Posted: 30 Oct 2003 16:51 PST
Expires: 29 Nov 2003 16:51 PST
Question ID: 271298
Hi,
I am trying to create a basic 'User Input' screen interface, using
Director MX, requesting a Users: Name and "PIN number!!!"
can you tell me how to create the lingo code in the script box for the
"PIN Number" cast member, so that instead on the users actual "PIN
Number"(Integers) appearing when typed, it appears as ********
(Asterixs)
Thank you...Purplepit-ga
Answer  
Subject: Re: Macromedia Director 'Lingo-script' problem!!!
Answered By: andyt-ga on 30 Oct 2003 17:34 PST
Rated:5 out of 5 stars
 
Hi Purplepit-ga,

Luckily, what you require is pretty common, and there's several
solutions to the problem which require no Lingo programming on your
part.

The easiest, but least secure is to use a font that instead of letters
and numbers, just has all asterisks.  An example of this is shown at
http://www.lingoworkshop.com/code/widgets_password.asp which also
provides the source code to the Director files downloadable for free. 
Why this is insecure is because someone could copy this text into a
word editor, change the font and then they'd know the password. 
However, for your application (a user's pin number) I think this would
work out fine.

The next solution would be to use this lingo code which , checks for
RETURN/ENTER pressed, the correct password and replaces text with '*'.
--------------------------
property mytext
property password
property ok
global gpassword


on beginsprite me
ok = 0
gpassword = "password"
password = empty
pevents = empty
mytext = empty
sprite(me.spritenum).visible = 1
sprite(me.spritenum).member.text = empty
end



on exitframe me
if ok <> 1 then
go the frame
end if
end



on prepareframe me
txt = sprite(me.spritenum).member.text

if txt <> mytext then 
if txt.char[txt.char.count] = RETURN or txt.char[txt.char.count] =
ENTER then
txt = chars(txt,1,txt.char.count-1)
mytext = txt
sprite(me.spritenum).member.text = mytext

----------------------------------------
-- check for password after RETURN/ENTER
----------------------------------------
if password <> gpassword then
sprite(me.spritenum).member.text = empty
password = empty
mytext = empty
ok = 0
beep
else
ok = 1
go "admin"
end if
else
repeat with i = 1 to txt.char.count
newtxt = newtxt&"*"
end repeat
sprite(me.spritenum).member.text = string(newtxt)
mytext = newtxt
alter me, txt
end if
end if
end



on alter me, txt
password = password&txt.char[txt.char.count]
end 

------------------------------

A useful resource, where I obtained the above code, and in discussing
this problem can be found in a discussion thread at Macromedia
Director Forums:  http://webforums.macromedia.com/director/messageview.cfm?catid=187&threadid=695116&highlight_key=y&keyword1=password

Search terms used:
director mx lingo password field

I hope this answers your query, it has been a pleasure helping you. 
If you require any further assistance please don't hesitate to ask for
a clarification

Sincerely,
andyt-ga

Request for Answer Clarification by purplepit-ga on 31 Oct 2003 15:17 PST
Hi There,

Thanks for your answer so far.....

But I tried copying and pasting the given, code into the script box
associated with the sprite in question, in between "onmouseup
(Handler) and "End".... and it returns a script error saying:

(variable used, before assigned a value, property mytext)

Can you check this for me, If Im doing something wrong. Also  I cant
find the downloadable code(section) from the site you suggested!!!

Thanks and regards

purplepit-ga

Clarification of Answer by andyt-ga on 31 Oct 2003 17:28 PST
Purplepit-ga,

Perhaps that code is for an earlier version of Director.

Here's another free one that you can give a try, from mediamacros:
http://www.mediamacros.com/item/item-931463848/

For the font based example, the example download is right below the
working example, the line that says "You can download the Director 8
source files as either a SIT for ZIP Archive." (The links aren't
underlined)

The direct link for the SIT archive is
http://www.lingoworkshop.com/code/codelib/pwdentry.sit
The direct link for the ZIP archive is
http://www.lingoworkshop.com/code/codelib/pwdentry.zip

I hope that helps,
andyt-ga
purplepit-ga rated this answer:5 out of 5 stars
Thank you, very much

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy