Community

Actions Script help...

Posted Aug 18, '08 at 6:15am

forgottongaurdian

forgottongaurdian

12 posts

Iron - Serf

Hi all,

I need help with passwords in flash (of course) anyways i want to know how you would set the scripting to set up a password.

Like. I have the text box where they can type and its set to a password box. i have the button set to goto the next frame. but i need to know how when you type in a password incorectly into the box the button won't let them through and when you have in correct it lets you through to the next frame.

Posted Aug 18, '08 at 8:36am

LonLonRanch

LonLonRanch

151 posts

Gold - Squire

Well once you've stored you're text field into a variable say myPass you have to make a small check when you press the 'submit' button, or however you plan on doing that. This is what you would do:

submitBtn.onRelease = function(){
  if( myPass == "password"){
    gotoAndStop("accepted");
  }else{
    gotoAndStop("denied");
  }
}

For this to work you have to have a button with the instance name of submitBtn and frames with the names "accepted" and "denied".
Change this line :if( myPass == "password"){ to have whatever you want you're password to be

 

Posted Aug 19, '08 at 2:04am

forgottongaurdian

forgottongaurdian

12 posts

Iron - Serf

thanks

 

Posted Aug 19, '08 at 2:08am

forgottongaurdian

forgottongaurdian

12 posts

Iron - Serf

ummm this is what it says in the output panel..

**Error** Scene=Loading, layer=Password, frame=1:Line 1: Statement must appear within on handler
     submitBtn.onRelease = function(){

Total ActionScript Errors: 1      Reported Errors: 1

 

Posted Aug 19, '08 at 6:25am

forgottongaurdian

forgottongaurdian

12 posts

Iron - Serf

nevermind now it works now

oh and how would i get a clock that goes by real time into flash???

 

Posted Aug 21, '08 at 8:48am

LonLonRanch

LonLonRanch

151 posts

Gold - Squire

I've never made a clock myself but I would assume this would be how.

 

Posted Aug 24, '08 at 4:53am

forgottongaurdian

forgottongaurdian

12 posts

Iron - Serf

thanks for the link but would you know how to put it into Flash 8?

 

Posted Aug 25, '08 at 7:37am

forgottongaurdian

forgottongaurdian

12 posts

Iron - Serf

hey i was browsing through google on how to make a clock in flash 8 and i found this link... (digital clock)

IT'S A VIDEO TUTORIAL.

Link>> http://www.flashvista.com/details/item/2998/

 
Reply to Actions Script help...

You must be logged in to post a reply!