Minimun characters for input text field

  • Halo
  • Novice
  • Novice
  • User avatar
  • Posts: 19
  • Loc: Middle of nowhere

Post 3+ Months Ago

Hi, i have an input text field and i'd like to know how to set a minimun required amount of charactes in order to be able t move further in the timeline.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • devilwood
  • Silver Member
  • Silver Member
  • User avatar
  • Posts: 436

Post 3+ Months Ago

Try this Halo,


Code: [ Select ]

Selection.setFocus("_root.textfieldinstanceName");
mytxt = new Object();
mytxt.onChanged = function(eventObject) {
    if (_root.textfieldinstanceName.text.length == 9) {
        gotoAndStop(2);
    }
};
_root.textfieldinstanceName.addListener(mytxt);
  1. Selection.setFocus("_root.textfieldinstanceName");
  2. mytxt = new Object();
  3. mytxt.onChanged = function(eventObject) {
  4.     if (_root.textfieldinstanceName.text.length == 9) {
  5.         gotoAndStop(2);
  6.     }
  7. };
  8. _root.textfieldinstanceName.addListener(mytxt);
  • Halo
  • Novice
  • Novice
  • User avatar
  • Posts: 19
  • Loc: Middle of nowhere

Post 3+ Months Ago

thanks for the reply devilwood, im sure the code works but the problem im having with it is that i am working with flash 5 and AS 2.0
  • devilwood
  • Silver Member
  • Silver Member
  • User avatar
  • Posts: 436

Post 3+ Months Ago

Sorry it's still not working for you. Make sure you're referencing your textfield correctly and hopefully someone else can weigh in on why it's not working in flash5. I'm using flash8 and AS2 and I've found that alot of code works the same starting with flash5 thru MX and 8.

I know the moderators wanted people to start including their flash information when posting on this forum which is a good idea but I assumed it was really because there's alot of AS3 stuff floating out there now and I do know alot of commands have been revamped between AS2 and AS3. Anyway, just remember that for the future. I keep seeing what I can dig up for flash5.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 12 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.