Button/UiLoader Code just not working like I want it to.

Can anyone tell me why my forward button (next_btn3) isn't working?  I've got a uiLoader (printLoader) which loads three images.  Everything works fine, I can see the button but can't use it.  Thanks in advance.
next_btn3.addEventListener(MouseEvent.CLICK, nextImage3);
var imageNumber3:Number = 1;
function checkNumber3():void{
next_btn3.visible=true;
back_btn3.visible=true;
if(imageNumber3==3){
  trace(imageNumber3);
  next_btn3.visible = false;
  if(imageNumber3==1){
   trace(imageNumber3);
   back_btn3.visible = false;
checkNumber3();
function nextImage3(evtObj:MouseEvent):void{
imageNumber3++;
printLoader.source = "images/print_images/image"+imageNumber3+".jpg";
checkNumber3();
back_btn3.addEventListener(MouseEvent.CLICK, backImage3);
function backImage3(evtObj:MouseEvent):void
imageNumber3--;
printLoader.source = "images/print_images/image"+imageNumber3+".jpg";
checkNumber3();

Thanks for responding.
If I rename the back_btn instance to next_btn and the next_btn to back_btn and click the back button, this is the error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at david_fla::MainTimeline/nextImage()
Any suggestions?

Similar Messages

  • I want to cancel my subscription,  I just signed up and the conversion did not work like I wanted.  Please cancel asap.  thank you

    I want to cancel my membership ASAP, this conversion did not work and I want a refund.  How can I do this.
    Stan

    Hi estans66,
    I have been cancelled your subscription on 13 Oct,2014.
    It takes 7 business days in refund processing.
    You can contact our chat support :http://helpx.adobe.com/x-productkb/global/service-b.html
    Regards,
    Florence

  • Safari just not working like it used to

    I'll be the first to admit that I'm not on the leading edge with my software – I'm still running OS X 10.2.8 and Safari 1.0.3 on my Mirror Drive Door G4. But lately, Safari seems like it doesn't want to work with some web pages. For example, when I go to the Apple site, I get a big black void on the new iPhone landing page – I know there's supposed to be something there, but it's not showing up. On some other sites (particularly those using active server pages), some links are no longer clickable. Even Safari's pop-up blocker seems to get defeated more often lately. (For the record: I've got plug-ins, Java and Javascript enabled, and I'm always accepting cookies. I also clear the cache regularly and have cleaned up my permissions and preferences.) My current work-around is simply to browse troublesome pages in Firefox instead. But I'd like to continue using Safari.
    Am I correct in suspecting that there's nothing wrong with my machine or software, but that web technology is changing rapidly and that Safari 1.0.3 is just obsolete? I realize that Apple's "Help" says to always use the latest version of Safari. For me, I guess that means purchasing Tiger or Leopard. Maybe I just need to bite the bullet? Thanks.
    Power Mac G4   Mac OS X (10.2.x)  

    garp --
    I understand your situation.
    You would love Tiger, but given your current Jaguar
    here's a list of basic cleaning up things to do.
    Do these & report back, OK ?
    1. Empty your cache & History settings via the Safari menu
    2. Trash your Icons Folder:
    HD>Users>Home>YourName>Library>Safari -->Icons
    Restart Safari and a new folder will be automatically regenerated.
    (This folder saves favicons of all the sites you visit. Needs cleaning periodically -- or you can change that file's preferences to "Read Only"
    rather than "Read & Write." This will keep it from growing in size.)
    3. Unfortunately, you don't have Font Book with Jaguar. Do you have a font manager? You might want to check for duplicate fonts on your Mac. By adding new apps & peripherals, extra fonts have been added, and you may have duplicates or font conflicts which can slow things down considerably.
    Do not touch any fonts located in the HD>System>Library>Fonts folder.
    Question for you: Do you have internet apps SpeedDownload, iGetter, PithHelmet, Acid Search, Safari Enhancer ? Or Norton or Virex? Sometimes non-apple internet apps need updating or uninstalling. If you do, let us know which ones and which version, please.
    If you're still having problems:
    4. Shut down your computer . . . unplug the computer, modem, and router, if you have one. Let everything sit for 2-3 minutes. Plug everything back in, start up your modem & router, then restart your computer.
    Safari 1.0.3 is very old, and it is entirely possible that it's just not reading sites well. But if you do all of the above, at least it should be better.
    Hope this helps

  • Code not working like I want

    I have two date fields, "StartDate1" and "EndDate1".
    When I make the EndDate1 value less than StartDate1, the "button" remains VISIBLE, but INACTIVE, and I can move on to the next field.
    Why does the button remain visible, why is the button inactive, and how do I force the user to enter an EndDate1 value greater than that of StartDate1?
    Also, in the Validate code, if I remove the line
    " else xfa.host.messageBox("It Works"); "
    then I get a syntax error, which I don't understand.
    Can someone help clean up this mess?
    Thanks,
    Bernie
    ----- F.P1.EndDate1::exit - (FormCalc, client) --------------------
    if ($.isNull ne 1) then
    var nDays = Date2Num($.formattedValue, "MM/DD/YYYY");
    if (nDays <= 0) then
    xfa.host.messageBox("Please enter the date in MM/DD/YYYY format.");
    xfa.host.setFocus($.name);
    endif
    endif
    ----- F.P1.EndDate1::validate - (FormCalc, client) ---------------
    var DCV
    if (HasValue(StartDate1) and HasValue(EndDate1)) then
    DCV = Date2Num(EndDate1, "YYYY-MM-DD") - Date2Num(StartDate1, "YYYY-MM-DD");
    // xfa.host.messageBox (DCV);
    if (DCV<0) then
    xfa.host.messageBox("End Date must be greater than Start Date");
    xfa.host.setFocus($.name);
    else xfa.host.messageBox("It Works");
    endif
    else $ = null
    endif

    Thanks for responding.
    If I rename the back_btn instance to next_btn and the next_btn to back_btn and click the back button, this is the error:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at david_fla::MainTimeline/nextImage()
    Any suggestions?

  • Trying to disable a button and code does not work help?

    I am trying to disable a button.
    I created a button by adding a display item and placing the following
    in the Pre Element Text:
    <input type="button"
    onclick="clickFunction('Confirmation message goes here')"
    value="Text to display on button"
    title="Tooltip text to display"
    style="" />
    I am trying to disable the button by doing any of the following and they all
    work on P9_VID but not on P9_MY_BUTTON Why?
    1
    document.getElementById('P9_VID').disabled=true;
    document.getElementById('P9_MY_BUTTON').disabled=true;
    2
    $x_disableItem('P9_VID',true);
    $x_disableItem('P9_MY_BUTTON',true);
    3
    html_GetElement('P9_MY_BUTTON').disabled = true;
    html_GetElement('P9_VID').disabled = true;
    4
    html_HideElement('P9_MY_BUTTON');
    html_HideElement('P9_VID');
    5
    $x('P9_MY_BUTTON').disabled = true;
    $x('P9_VID').disabled = true;
    Thanks
    Howard
    Edited by: csphard on Apr 1, 2010 1:56 PM
    Edited by: csphard on Apr 1, 2010 1:56 PM

    Howard
    Specify an id attribute for the button you created. Set the value for the id to be 'P9_MY_BUTTON'
    <input type="button" id = 'P9_MY_BUTTON'
    onclick="clickFunction('Confirmation message goes here')"
    value="Text to display on button"
    title="Tooltip text to display"
    style="" />varad

  • Tclsh script not working like I want it to...

    Using this script, when I execute it, it stops at Erasing VLAN Database and sits there until I hit enter again, then it finishes the script and reloads the device. Thoughts on why?
    tclsh
    puts [open "flash:reset.tcl" w+] {
    puts "Erasing Configuration"
    typeahead "\r"
    puts [ exec "write erase" ]
    puts "Erasing VLAN Database"
    typeahead "\r"
    puts [ exec "del flash:vlan.dat" ]
    puts "Copying Base Configuration To Startup"
    typeahead "\r"
    puts [ exec "copy flash:baseline.cfg nvram:startup-config" ]
    puts "Reloading The Device"
    typeahead "\r"
    puts [ exec "reload" ]

    Did you tried adding another carriage return?
    typeahead "\r\r"
    I tested your original script in a switch and it worked.

  • Siri is not working like it should i ask it to play songs and it just says sorry i cant do that any ideas y

    siri is not working like it should i asked it to play songs and it just says sorry i cant do it any ideas y

    Debbie:
    deborahfromwindsor wrote:
    he advises restarting by inserting the OSX disc and pressing down the C button to reboot from there then selecting disk utility, hard disk and repair.... Does he mean me to hold down the C key on the alpha keyboard or the ctrl key?
    Should I just ask for my money back??? If it is a simple repair do I just literally push the disc in, push the power button and hold down the C button?
    That's where I would begin, too, with
    Repair Disk
    Insert Installer disk and Restart, holding down the "C" key until grey Apple appears.
    Go to Installer menu (Panther and earlier) or Utilities menu (Tiger) and launch Disk Utility.
    Select your HDD (manufacturer ID) in the left panel.
    Select First Aid in the Main panel.
    (Check S.M.A.R.TStatus of HDD at the bottom of right panel, and report if it saysanything but Verified)
    Click Repair Disk on the bottom right.
    If DU reports disk does not need repairs quit DU and restart.
    If DU reports errors Repair again and again until DU reports disk is repaired.
    If DU reports errors it cannot repair you will need touse autility like TechTool Pro,Drive Geniusor DiskWarrior
    First we need to determine if the issue you are experiencing with the computer is software or hardware based. Once we have gotten things sorted out there should be time enough to make you decision about keeping or returning it.
    cornelius

  • I am signed into the App Store on my iphone 4 and one of my apps need updating and my brother was signed into it but its like its locked to his Apple ID I have tried signing out and turning my phone off its just not working

    I am signed into the App Store on my iphone 4 and one of my apps need updating and my brother is signed into it because I didn't have any credit to make an ID so he signed in so I could download apps but its like its locked to his Apple ID I have tried signing out and turning my phone off its just not working please help.

    Apps are locked to the Apple ID that was used to download them. You will have to sign in as your brother in order to update it.

  • My phone died last night and when I plugged it in it wouldn't turn on.I tried restarting it but it has yet to turn on since last night,It was just a black screen,i try the on/off and home buttons together but its not working,What should I do?

    My phone died last night and when I plugged it in it wouldn't turn on.I tried restarting it but it has yet to turn on since last night,It was just a black screen,i try the on/off and home buttons together but its not working,What should I do?

    How long have you had your phone? Because if you've had it a long time, the battery in the phone might of died on you. Or have you dropped it in water, snow, from high up? All those things could of disconnected something internally in your phone, or permentaly damaged the internal hard drive its self, or the sims card.

  • Why this code is not working??? java script

    gen_validatorv2.js
         JavaScript Form Validator
    Version 2.0.2
         Copyright 2003 JavaScript-coder.com. All rights reserved.
         You use this script in your Web pages, provided these opening credit
    lines are kept intact.
         The Form validation script is distributed free from JavaScript-Coder.com
         You may please add a link to JavaScript-Coder.com,
         making it easy for others to find this script.
         Checkout the Give a link and Get a link page:
         http://www.javascript-coder.com/links/how-to-link.php
    You may not reprint or redistribute this code without permission from
    JavaScript-Coder.com.
         JavaScript Coder
         It precisely codes what you imagine!
         Grab your copy here:
              http://www.javascript-coder.com/
    function Validator(frmname)
    this.formobj=document.forms[frmname];
         if(!this.formobj)
         alert("BUG: couldnot get Form object "+frmname);
              return;
         if(this.formobj.onsubmit)
         this.formobj.old_onsubmit = this.formobj.onsubmit;
         this.formobj.onsubmit=null;
         else
         this.formobj.old_onsubmit = null;
         this.formobj.onsubmit=form_submit_handler;
         this.addValidation = add_validation;
         this.setAddnlValidationFunction=set_addnl_vfunction;
         this.clearAllValidations = clear_all_validations;
    function set_addnl_vfunction(functionname)
    this.formobj.addnlvalidation = functionname;
    function clear_all_validations()
         for(var itr=0;itr < this.formobj.elements.length;itr++)
              this.formobj.elements[itr].validationset = null;
    function form_submit_handler()
         for(var itr=0;itr < this.elements.length;itr++)
              if(this.elements[itr].validationset &&
         !this.elements[itr].validationset.validate())
              return false;
         if(this.addnlvalidation)
         str =" var ret = "+this.addnlvalidation+"()";
         eval(str);
    if(!ret) return ret;
         return true;
    function add_validation(itemname,descriptor,errstr)
    if(!this.formobj)
         alert("BUG: the form object is not set properly");
              return;
         }//if
         var itemobj = this.formobj[itemname];
    if(!itemobj)
         alert("BUG: Couldnot get the input object named: "+itemname);
              return;
         if(!itemobj.validationset)
         itemobj.validationset = new ValidationSet(itemobj);
    itemobj.validationset.add(descriptor,errstr);
    function ValidationDesc(inputitem,desc,error)
    this.desc=desc;
         this.error=error;
         this.itemobj = inputitem;
         this.validate=vdesc_validate;
    function vdesc_validate()
    if(!V2validateData(this.desc,this.itemobj,this.error))
    this.itemobj.focus();
              return false;
    return true;
    function ValidationSet(inputitem)
    this.vSet=new Array();
         this.add= add_validationdesc;
         this.validate= vset_validate;
         this.itemobj = inputitem;
    function add_validationdesc(desc,error)
    this.vSet[this.vSet.length]=
         new ValidationDesc(this.itemobj,desc,error);
    function vset_validate()
    for(var itr=0;itr<this.vSet.length;itr++)
         if(!this.vSet[itr].validate())
              return false;
         return true;
    function validateEmailv2(email)
    // a very simple email validation checking.
    // you can add more complex email checking if it helps
    if(email.length <= 0)
         return true;
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    var regexp_user=/^\"?[\w-_\.]*\"?$/;
    if(splitted[1].match(regexp_user) == null) return false;
    if(splitted[2] != null)
    var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
    if(splitted[2].match(regexp_domain) == null)
         var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
         if(splitted[2].match(regexp_ip) == null) return false;
    }// if
    return true;
    return false;
    function V2validateData(strValidateStr,objValue,strError)
    var epos = strValidateStr.search("=");
    var command = "";
    var cmdvalue = "";
    if(epos >= 0)
    command = strValidateStr.substring(0,epos);
    cmdvalue = strValidateStr.substr(epos+1);
    else
    command = strValidateStr;
    switch(command)
    case "req":
    case "required":
    if(eval(objValue.value.length) == 0)
    if(!strError || strError.length ==0)
    strError = objValue.name + " : Required Field";
    }//if
    alert(strError);
    return false;
    }//if
    break;
    }//case required
    case "maxlength":
    case "maxlen":
    if(eval(objValue.value.length) > eval(cmdvalue))
    if(!strError || strError.length ==0)
    strError = objValue.name + " : "+cmdvalue+" characters maximum ";
    }//if
    alert(strError + "\n[Current length = " + objValue.value.length + " ]");
    return false;
    }//if
    break;
    }//case maxlen
    case "minlength":
    case "minlen":
    if(eval(objValue.value.length) < eval(cmdvalue))
    if(!strError || strError.length ==0)
    strError = objValue.name + " : " + cmdvalue + " characters minimum ";
    }//if
    alert(strError + "\n[Current length = " + objValue.value.length + " ]");
    return false;
    }//if
    break;
    }//case minlen
    case "alnum":
    case "alphanumeric":
    var charpos = objValue.value.search("[^A-Za-z0-9]");
    if(objValue.value.length > 0 && charpos >= 0)
    if(!strError || strError.length ==0)
    strError = objValue.name+": Only alpha-numeric characters allowed ";
    }//if
    alert(strError + "\n [Error character position " + eval(charpos+1)+"]");
    return false;
    }//if
    break;
    }//case alphanumeric
    case "num":
    case "numeric":
    var charpos = objValue.value.search("[^0-9]");
    if(objValue.value.length > 0 && charpos >= 0)
    if(!strError || strError.length ==0)
    strError = objValue.name+": Only digits allowed ";
    }//if
    alert(strError + "\n [Error character position " + eval(charpos+1)+"]");
    return false;
    }//if
    break;
    }//numeric
    case "alphabetic":
    case "alpha":
    var charpos = objValue.value.search("[^A-Za-z]");
    if(objValue.value.length > 0 && charpos >= 0)
    if(!strError || strError.length ==0)
    strError = objValue.name+": Only alphabetic characters allowed ";
    }//if
    alert(strError + "\n [Error character position " + eval(charpos+1)+"]");
    return false;
    }//if
    break;
    }//alpha
              case "alnumhyphen":
    var charpos = objValue.value.search("[^A-Za-z0-9\-_]");
    if(objValue.value.length > 0 && charpos >= 0)
    if(!strError || strError.length ==0)
    strError = objValue.name+": characters allowed are A-Z,a-z,0-9,- and _";
    }//if
    alert(strError + "\n [Error character position " + eval(charpos+1)+"]");
    return false;
    }//if                
                   break;
    case "email":
    if(!validateEmailv2(objValue.value))
    if(!strError || strError.length ==0)
    strError = objValue.name+": Enter a valid Email address ";
    }//if
    alert(strError);
    return false;
    }//if
    break;
    }//case email
    case "lt":
    case "lessthan":
    if(isNaN(objValue.value))
    alert(objValue.name+": Should be a number ");
    return false;
    }//if
    if(eval(objValue.value) >= eval(cmdvalue))
    if(!strError || strError.length ==0)
    strError = objValue.name + " : value should be less than "+ cmdvalue;
    }//if
    alert(strError);
    return false;
    }//if
    break;
    }//case lessthan
    case "gt":
    case "greaterthan":
    if(isNaN(objValue.value))
    alert(objValue.name+": Should be a number ");
    return false;
    }//if
    if(eval(objValue.value) <= eval(cmdvalue))
    if(!strError || strError.length ==0)
    strError = objValue.name + " : value should be greater than "+ cmdvalue;
    }//if
    alert(strError);
    return false;
    }//if
    break;
    }//case greaterthan
    case "regexp":
                   if(objValue.value.length > 0)
         if(!objValue.value.match(cmdvalue))
         if(!strError || strError.length ==0)
         strError = objValue.name+": Invalid characters found ";
         }//if
         alert(strError);
         return false;
         }//if
    break;
    }//case regexp
    case "dontselect":
    if(objValue.selectedIndex == null)
    alert("BUG: dontselect command for non-select Item");
    return false;
    if(objValue.selectedIndex == eval(cmdvalue))
    if(!strError || strError.length ==0)
    strError = objValue.name+": Please Select one option ";
    }//if
    alert(strError);
    return false;
    break;
    }//case dontselect
    }//switch
    return true;
         Copyright 2003 JavaScript-coder.com. All rights reserved.
    example.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Example for Validator</title>
    <script language="JavaScript" src="gen_validatorv2.js" type="text/javascript"></script>
    </head>
    <body>
    <form action="" name="myform" >
    <table cellspacing="2" cellpadding="2" border="0">
    <tr>
    <td align="right">First Name</td>
    <td><input type="text" name="FirstName"></td>
    </tr>
    <tr>
    <td align="right">Last Name</td>
    <td><input type="text" name="LastName"></td>
    </tr>
    <tr>
    <td align="right">EMail</td>
    <td><input type="text" name="Email"></td>
    </tr>
    <tr>
    <td align="right">Phone</td>
    <td><input type="text" name="Phone"></td>
    </tr>
    <tr>
    <td align="right">Address</td>
    <td><textarea cols="20" rows="5" name="Address"></textarea></td>
    </tr>
    <tr>
    <td align="right">Country</td>
    <td>
         <SELECT name="Country">
              <option value="" selected>[choose yours]
              <option value="008">Albania
              <option value="012">Algeria
              <option value="016">American Samoa
              <option value="020">Andorra
              <option value="024">Angola
              <option value="660">Anguilla
              <option value="010">Antarctica
              <option value="028">Antigua And Barbuda
              <option value="032">Argentina
              <option value="051">Armenia
              <option value="533">Aruba     
         </SELECT>
         </td>
    </tr>
    <tr>
    <td align="right"></td>
    <td><input type="submit" value="Submit"></td>
    </tr>
    </table>
    </form>
    <script language="JavaScript" type="text/javascript">
    //You should create the validator only after the definition of the HTML form
    var frmvalidator = new Validator("myform");
    frmvalidator.addValidation("FirstName","req","Please enter your First Name");
    frmvalidator.addValidation("FirstName","maxlen=20",
         "Max length for FirstName is 20");
    frmvalidator.addValidation("FirstName","alpha");
    frmvalidator.addValidation("LastName","req");
    frmvalidator.addValidation("LastName","maxlen=20");
    frmvalidator.addValidation("Email","maxlen=50");
    frmvalidator.addValidation("Email","req");
    frmvalidator.addValidation("Email","email");
    frmvalidator.addValidation("Phone","maxlen=50");
    frmvalidator.addValidation("Phone","numeric");
    frmvalidator.addValidation("Address","maxlen=50");
    frmvalidator.addValidation("Country","dontselect=0");
    </script>
    </body>
    </html>
    documentation.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
         <title>JavaScript Form Validator Documentation</title>
    <Style>
    BODY, P,TD{ font-family: Arial,Verdana,Helvetica, sans-serif; font-size: 10pt }
    H1{ font-family: Arial,Verdana,Helvetica, sans-serif; font-size: 18pt; color : #000066}
    H3{ font-family: Arial,Verdana,Helvetica, sans-serif; font-size: 12pt; color : #000066 }
    A{font-family: Arial,Verdana,Helvetica, sans-serif;}
    B {     font-family : Arial, Helvetica, sans-serif;     font-size : 12px;     font-weight : bold;}
    CODE {font-family : Courier,monospace;font-size: 10pt;color : #800000;}
    CODE.htm {font-family : "Courier New", Courier, monospace;     font-size : x-small;     color : #000080;}
    </Style>
    </head>
    <body>
    <center>
    <table cellspacing="2" cellpadding="2" border="0" width="600">
    <tr><td>
         <h1>JavaScript Form Validations Made Easy!</h1>
         <h3>Documentation for JavaScript Form Validator</h3>
         <HR size=1>
         <P>
         The Form validation script is distributed free from JavaScript-Coder.com<br>
         You can use the script in your web pages for free.
         </P>
         <P>
         You may please add a link to JavaScript-Coder.com,
         making it easy for others to find this script.<br>
         Checkout the <A href="http://www.javascript-coder.com/links/how-to-link.php
         target="_blank">Give a Link & Get a Link!</A> page.
         </P>
         <P>
         <B>JavaScript Coder</B><br>
         It precisely codes what you imagine!<br>
         Grab your copy here: http://www.javascript-coder.com
         </P>
         <HR size=1>
         <P>
         Using client side JavaScript is an efficient way to validate the user input
         in web applications. When there are many fields in the form, the JavaScript
         validation becomes too complex.
         </P>
         <P>
    The JavaScript class presented here makes the form validations many times easier.
         </P>
         <P>
         The idea is to create a set of "validation descriptors" associated with each element
         in a form. The "validation descriptor" is nothing but a string specifying the type of
         validation to be performed.
         </P>
         <P>
         Each field in the form can have 0, 1, or more validations. For example, the input should
         not be empty, should be less than 25 chars, should be alpha-numeric, etc
         </P>
         You can associate a set of validation descriptors for each input field in the form.
         <a name="3"></a>
         <h3>Using The Script</h3>
         1.Include gen_validatorv2.js in your html file just before closing the HEAD tag<br><br>
         <CODE>
         <script language="JavaScript" src="gen_validatorv2.js" type="text/javascript"></script><BR>
         </head><BR>
         </CODE><br>
         2. Just after defining your form,
         Create a form validator object passing the name of the form<br><br>
         <CODE class='htm'>
          <FORM name='myform' action=""><BR>
          <!----Your input fields go here --><BR>
          </FORM><BR>
         </CODE><CODE>
          <SCRIPT language="JavaScript"><BR>
          var frmvalidator  = new Validator("myform");<BR>
         </CODE>
         <br>
         <br>
         3. Now add the validations required<br><br>
         <CODE>
              frmvalidator.addValidation("FirstName","alpha");
         </CODE><br><br>
         the first argument is the name of the field and the second argument is the
         validation descriptor, which specifies the type of validation to be performed.<br>
         You can add any number of validations.The list of validation descriptors are provided
         at the end of the documentation.<br>
         The optional third argument is the error string to be displayed if the validation
         fails.<br>
         <br>
         <CODE>
              frmvalidator.addValidation("FirstName","alpha");<br>
              frmvalidator.addValidation("FirstName","req","Please enter your First Name");<br>
              frmvalidator.addValidation("FirstName","maxlen=20",<br>
                   "Max length for FirstName is 20");          <br>
         </CODE>     <br>
         <br>
         4. Similarly, add validations for the fields where validation is required.<br>
         That's it! You are ready to go.
         <A name="3"></A>
         <h3>Example</h3>
         The example below will make the idea clearer<br>
         <CODE class="htm">
                   <form action="" name="myform" ><BR>
                   <table cellspacing="2" cellpadding="2" border="0"><BR>
                   <tr><BR>
                     <td align="right">First Name</td><BR>
                     <td><input type="text" name="FirstName"></td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right">Last Name</td><BR>
                     <td><input type="text" name="LastName"></td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right">EMail</td><BR>
                     <td><input type="text" name="Email"></td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right">Phone</td><BR>
                     <td><input type="text" name="Phone"></td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right">Address</td><BR>
                     <td><textarea cols="20" rows="5" name="Address"></textarea></td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right">Country</td><BR>
                     <td><BR>
                          <SELECT name="Country"><BR>
                             <option value="" selected>[choose yours]<BR>
                             <option value="008">Albania<BR>
                             <option value="012">Algeria<BR>
                             <option value="016">American Samoa<BR>
                             <option value="020">Andorra<BR>
                             <option value="024">Angola<BR>
                             <option value="660">Anguilla<BR>
                             <option value="010">Antarctica<BR>
                             <option value="028">Antigua And Barbuda<BR>
                             <option value="032">Argentina<BR>
                             <option value="051">Armenia<BR>
                             <option value="533">Aruba     <BR>
                         </SELECT><BR>
                        </td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right"></td><BR>
                     <td><input type="submit" value="Submit"></td><BR>
                   </tr><BR>
                   </table><BR>
                   </form><BR>
                   </CODE><CODE>
                   <script language="JavaScript" type="text/javascript"><BR>
                    var frmvalidator = new Validator("myform");<BR>
                    frmvalidator.addValidation("FirstName","req","Please enter your First Name");<BR>
                    frmvalidator.addValidation("FirstName","maxlen=20",<BR>
                        "Max length for FirstName is 20");<BR>
                    frmvalidator.addValidation("FirstName","alpha");<BR>
                    <BR>
                    frmvalidator.addValidation("LastName","req");<BR>
                    frmvalidator.addValidation("LastName","maxlen=20");<BR>
                    <BR>
                    frmvalidator.addValidation("Email","maxlen=50");<BR>
                    frmvalidator.addValidation("Email","req");<BR>
                    frmvalidator.addValidation("Email","email");<BR>
                    <BR>
                    frmvalidator.addValidation("Phone","maxlen=50");<BR>
                    frmvalidator.addValidation("Phone","numeric");<BR>
                    <BR>
                    frmvalidator.addValidation("Address","maxlen=50");<BR>
                    frmvalidator.addValidation("Country","dontselect=0");<BR>
                   </script><BR>     
         </CODE>
         <A name="4"></A>
         <h3>Some Additional Notes</h3>
         <LI type="disc">The form validators should be created only after defining the HTML form
         (only after the </form> tag. )<br>
         <LI type="disc">Your form should have a distinguished name.
         If there are more than one form
         in the same page, you can add validators for each of them. The names of the
         forms and the validators should not clash.
         <LI type="disc">You can't use the javascript onsubmit event of the form if it you are
         using this validator script. It is because the validator script automatically overrides the
         onsubmit event. If you want to add a custom validation, see the section below
         </LI>
         <A name="5"></A>
         <h3>Adding Custom Validation</h3>
         If you want to add a custom validation, which is not provided by the validation descriptors,
         you can do so. Here are the steps:
         <LI type="disc">Create a javascript function which returns true or false depending on the validation.<br>
         <CODE>
              function DoCustomValidation()<BR>
              {<BR>
                var frm = document.forms["myform"];<BR>
                if(frm.pwd1.value != frm.pwd2.value)<BR>
                {<BR>
                  alert('The Password and verified password does not match!');<BR>
                  return false;<BR>
                }<BR>
                else<BR>
                {<BR>
                  return true;<BR>
                }<BR>
              }<BR>
         </CODE><br>
         <LI type="disc">Associate the validation function with the validator object.<br>
         <CODE>
         frmvalidator.setAddnlValidationFunction("DoCustomValidation");
         </CODE><br>
         </LI>
         <P>
         The custom validation function will be called automatically after other validations.
         </P>
         <P>
         If you want to do more than one custom validations, you can do all those
         validations in the same function.
         </P>
         <CODE>
              function DoCustomValidation()<BR>
              {<BR>
                var frm = document.forms["myform"];<BR>
                if(false == DoMyValidationOne())<BR>
                {<BR>
                  alert('Validation One Failed!');<BR>
                  return false;<BR>
                }<BR>
                else<BR>
                if(false == DoMyValidationTwo())<BR>
                {<BR>
                  alert('Validation Two Failed!');<BR>
                  return false;<BR>
                }<BR>
                else<BR>
                {<BR>
                  return true;<BR>
                }<BR>
              }<BR>
         </CODE><br>
         where DoMyValidationOne() and DoMyValidationTwo() are custom functions for
         validation.
         <A name="6"></A>
         <h3>Clear All Validations</h3>
         In some dynamically programmed pages, it may be required to change the validations in the
         form at run time. For such cases, a function is included which clears all validations in the
         validator object.<br><br>
         <CODE>
         frmvalidator.clearAllValidations();
         </CODE><br>
         <br>
         this function call clears all validations you set.<br>
         You will not need this method in most cases.
         <a name="7"></a>
         <h3>Table of Validation Descriptors</h3>     
    <table cellspacing="2" cellpadding="2" border="1" width="520px">
    <tr>
    <td><FONT face=Arial size=2>
         required<BR>
         req </FONT>
         </td>
    <td><FONT face=Arial size=2>The field should not be
    empty </FONT>
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>
         maxlen=???<BR>
         maxlength=???
         </td>
    <td><FONT face=Arial size=2>checks the length entered data to the maximum. For
    example, if the maximum size permitted is 25, give the validation descriptor as "maxlen=25"
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>
         minlen=???<BR>
         minlength=???
         </td>
    <td><FONT face=Arial size=2>checks the length of the entered string to the
    required minimum. example "minlen=5"
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>
         alphanumeric /<BR>
         alnum </FONT>
         </td>
    <td><FONT face=Arial size=2>Check the data if it
    contains any other characters other than alphabetic or numeric characters
    </FONT>
         </td>
    </tr>     
    <tr>
    <td><FONT face=Arial size=2>num <BR>
         numeric </FONT>
         </td>
    <td><FONT face=Arial size=2>Check numeric data
    </FONT>
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>alpha <BR>
         alphabetic </FONT>
         </td>
    <td><FONT face=Arial size=2>Check alphabetic data.
    </FONT>
         </td>
    </tr>     
    <tr>
    <td><FONT face=Arial size=2>email </FONT>
         </td>
    <td><FONT face=Arial size=2>The field is an email
    field and verify the validity of the data. </FONT>
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>lt=???<BR>
         lessthan=???
         </td>
    <td><FONT face=Arial size=2>
         Verify the data to be less than the value passed.
         Valid only for numeric fields. <BR>
         example: if the
    value should be less than 1000 give validation description as "lt=1000"
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>gt=???<BR>
         greaterthan=???     </td>
    <td><FONT face=Arial size=2>
         Verify the data to be greater than the value passed.
         Valid only for numeric fields. <BR>
         example: if the
    value should be greater than 10 give validation description as "gt=10"
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>regexp=??? </FONT>
         </td>
    <td><FONT face=Arial size=2>
         Check with a regular expression the value should match the regular expression.<BR>
         example: "regexp=^[A-Za-z]{1,20}$" allow up to 20 alphabetic
         characters.
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>dontselect=?? </FONT>
         </td>
    <td><FONT face=Arial size=2>This
    validation descriptor is valid only for select input items (lists)
    Normally, the select list boxes will have one item saying 'Select One' or
    some thing like that. The user should select an option other than this
    option. If the index of this option is 0, the validation description
    should be "dontselect=0"
         </td>
    </tr>
    </table>
         <P>
              <table cellspacing="2" cellpadding="2" border="1" width="520">
              <tr>
              <td>
                   <B>NOTE:</B><br>
                   The HTML Form Wizard included in JavaScript Coder contains still more
                   number of validations
                   (comparison validations, check box & radio button validations and more)<br>
                   Using the wizard, you can add validations to your forms
                   without writing a single line of code! <br>
                   JavaScript Coder takes care of
                   generating the code and inserting the code in to the HTML file.<br>
                   <A href="http://www.javascript-coder.com/index.phtml
                   target="_blank">Read more about JavaScript Coder</A>
                   </td>
              </tr>
              </table>
         </P>
         <A name="8"></A>
         <h3>Example Page</h3>     
         See the <a href="example.html target="_blank"
         >JavaScript form validation example here</a>
    </td>
    </tr>
    <tr><td align="center">
         <HR><br>
         Copyright &copy; 2003 JavaScript-Coder.com. All rights reserved.
    </td></tr>
    </table>     
    </center>
    </body>
    </html>

    The code is not working because you made a mistake somewhere, duh! So figure out what (hint: firefox javascript console, it's your friend) and fix it!
    And next time when you post code: use the [ code ]  tags to pretty format your code, as it is now it's unreadable.
    http://forum.java.sun.com/help.jspa?sec=formatting

  • Flash CS5 code hinting not working?

    Just installed the new Flash CS5 trial and code hinting doesn't appear to be working! I have added all my custom class paths in to the AS3 source paths, but I don't get any code hinting for any of these just the same old code hinting you get in CS4. Am I doing something wrong or does it just not work?
    UPDATE: If it helps, in the code editor i get a small yellow triangle with an exclamation mark in, in the bottom right hand corner. When I have over this it advises me:
    " *** Unable to build code hint cache. Please save the associated FLA into a different folder. There are too many files on the classpath. *** "
    This error message appears no matter what FLA/Class i open, and moving it makes no difference.
    UPDATE: Problem solved, the "There are too many files on the classpath" was the clue! Slimmed down my library and all seems to work now.
    However, this does bring me on to another question.. does anyone know how many class files flash can comfortably cache? I use some fairly chunky libraries in my work and am wondering if i'm going to find myself constantly slimming them down after a while?

    The reason everyone gives for AS3 is that AS2 was buggy.
    I don't think so. AS3 is a better language, better designed, more consistent, more powerful. I would switch to AS3 for that, not because of bugs - but I don't know what's the reason behind everyone's choice.
    AS2 was not buggy, people were writing buggy scripts
    AS2 was buggy. Maybe people were writing buggy scripts too, but believe me it was buggy. However AS3 is at the very least equally buggy. It is better designed, more consistent, but equally buggy in its implementation.
    All software have bugs, but programming languages usually undergo a stricter and more thorough revision than other kinds of sofware because the consequences of bugs in a programming language are more disastrous.
    But that's not the case of ActionScript. Maybe because of its history and its legacy, or maybe because Adobe was always dedicated to completely different kinds of software, like PhotoShop, Premiere and the like, and suddenly dove into the business of developing a programming language without having the know-how.
    The level of bugginess of ActionScript is amazing. I work with actionscript daily and there's no day that I don't run 4 ot 5 times into some problem due to some bug. Not that I discover new bugs every day, just run into them - sometimes they are already reported, other times they are not.
    Why should something that took one line of code (clicking on a movieClip
    to move to a frame) now take 5 or more lines of code (creating a
    listener object, assigning a listener object, writing a function).
    It often happens that a language that is in the overall more elegant, consistent and compact, turns out to need a bit more of code for doing the simplest things. Maybe what could be done with 1 line of code now takes 5, but things that took 1000 lines of cumbersome awkward tricky and hacky code can now be done with just 100 of readable and simple-to-understand code.
    When I first learned Java I was surprised at the quantity of code I had to write just to make a program that would print "hello world", while in most dialects of Basic it was just:
    10 PRINT "Hello world"
    Would you say Basic is superior to Java in any sense?
    I teach Flash at a university, both beginner and advanced users. [...]
    I'll stick to AS2 in my classes.
    You should think about the damage you may be doing to your students. If they are going to use ActionScript professionally, they'll have to learn AS3, rather sooner than later. So why not save them the pain to do the effort twice? If instead you are teaching them AS just for didactic purposes (i.e. for learning programming in general) and don't care about practical applications and you don't like the way AS has evolved (i.e. AS3), then consider teaching them another language, instead of an obsolete version of a current one.
    AS3 is not more complicated, or difficult to learn, or less designer-friendly or non-programmer-friendly than AS2. Not at all; rather the opposite. It is more complicated and difficult to learn when you already know AS2, because you feel like everything you knew is useless - but the same can be said about learning AS2 when you already know AS3. Starting from scratch, AS3 is indeed simpler.
    But this have drifted OT, sorry. Back to the topic:
    It's not an app killer, just a minor inconvenience
    It's a major inconvenience if writing the same amount of code takes you three times the time it should take. That in 2010 you have to spell every single property/method/class name entirely from the first to the last letter, when most of the time it should be just a matter of typing a couple of characters and hit tab, is simply ridiculous. You may as well write your code with NotePad. Flash is (among other things) an IDE - something Adobe seemed to neglect up to recently; and when they finally decided to take a step into making it work like any other decent IDE, it does not work!!
    There are bigger things to complain about.
    On this you are definitely right.
    Using their pretty remarkable products (where would we be without PS or
    DW?) is not a right, it's a (sometimes frustrating) privilege.
    It's a privilege you pay for. That's when it becomes a right.
    So Adobe mods, we're frustrated but only because we're all loyal users who depend on your products
    (emphasis is mine)
    Exactly. That's the point.
    Note there's been no helpful answer from them yet: that's how much they care about loyal users who depend on their products.

  • Code hints not working in Flash CC

    I just downloaded the Flash CC trial and have been looking at the forums but I can't get code hints to work at all, when I begin to type a line I get "Building code hint cache" in bottom right of Actions panel with a warning icon - no more info available, no tool tip on rollover it apparently does nothing.
    I've looked for this problem in the forums and found many references to code hints not working and have tried all the support recommendations for deleting the CodeModel file, resetting preferences, deleting preferences, checking and unchecking preferences, changing the file cap in the registry and nothing seems to work - still no code hints at all.
    I'm on a windows 8 machine, I don't know if that has anything to do with it.

    SujaiS wrote:
    Hi Beadicakes,
    Have you saved your .as file  on the desktop of any common location with a large set of files? 
    -Sujai
    Hello Friends. I create simple button and when try to write simple addEventListener code hint don't work properly. I.e. when I write "Button1." code hint window don't popup. And when save project, only fla file have saved. No as files have saved.  Where is the location of the 'as' file??? This is the code of as3 file
    import flash.display.SimpleButton;
    import flash.events.Event;
    import flash.events.MouseEvent;
    Button1.addEventListener(MouseEvent.MOUSE_DOWN,go);
    function go(Event:MouseEvent):void
    trace("sdfsdfd");

  • Product code is not working

    hello there,
    i bought lightroom 4 today (the student version), installed it and wanted to type in the product code and got kind of confused.. my product code is XXXXXX-XXXX-XXXX-XXXX-XXXX (X=letters,numbers) but what i need to type in is six times four numbers or letters. so my product code that is written down is 2 numbers or letters short. i did try to type in in whatsoever but it did not work. thanks for the help

    Hello
    I just received CS6 with educational license, bought as a bundle, together with my new Macbook, but the product code does not work when I try to register at www.adobe.com/go/edu-apple.
    Kind Regards
    Allan Tang

  • My passbook on my iphone 5 works the same as it did for the iphone 4, its not working like it should. why?

    my pass book on my iphone 5 does not work like it should, it works just the same as it did on the iphone 4, i tryed the date an time trick like 5 times an still nothing. i tryed factory reset an nothing. i know it workds different on the iphone 5 then the 4. but i dont know what else to do.

    Can you be more specific about what isn't working?  Are you running iOS 6 or iOS 6.1?
    Did you read the support page on Passbook?  http://support.apple.com/kb/HT5483

  • Hi I have an iPhone 4 and suddenly it stopped working. Could here notifications and nothing on the diisplay. Wake up  button on top is not working. so unable to restart the phone. Wanted to try restore from iTunes but Find my iPhone (iCloud) is on.

    Hi I have an iPhone 4 and suddenly it stopped working. Could here notifications and nothing on the diisplay. Wake up  button on top is not working. so unable to restart the phone. Wanted to try restore from iTunes but Find my iPhone (iCloud) is on. How to recover or restart my Phone

    Follow these steps to log into your iCloud account on your computer and deactivate "Find my iPhone" on your device:
    Remove an iOS device or Mac on which you can’t turn off Find My iPhone
    If you can’t turn off Find My iPhone on the device, turn off the device so it goes offline, then remove it from Find My iPhone on iCloud.com.
    Note:    You can also remove your iOS device by first erasing it—just follow the instructions below for removing an iOS device you don’t have. You can later restore the device from an iCloud or iTunes backup.
    Turn off the device you want to remove.
    Sign in to icloud.com/#find on another computer with your Apple ID (the one you use with iCloud). If you’re using another iCloud app, click the app’s name at the top of the iCloud.com window, then click Find My iPhone.
    Click All Devices, select the offline device, then click Remove from Account. If you don’t see Remove from Account, click All Devices again, then click the Delete button next to the device. If the device comes online again, it will reappear in Find My iPhone. If your device reappears, turn off Find My iPhone on the device (follow the instructions above for removing a device by turning off Find My iPhone), or if it’s an iOS device and you no longer have it, follow the instructions below for removing an iOS device you no longer have.
    Remove an iOS device you no longer have
    If you no longer have the iOS device because you gave it away or sold it, you need to remotely erase it before you can remove it.
    Sign in to icloud.com/#find with your Apple ID (the one you use with iCloud). If you’re using another iCloud app, click the app’s name at the top of the iCloud.com window, then click Find My iPhone.
    Click All Devices, then select the device.
    Click Erase [device], then enter your Apple ID password. Because the device isn’t lost, don’t enter a phone number or message.
    Note:    If you’re trying to erase a family member’s device, that person will need to enter his or her Apple ID password on this device. If the device is offline, the remote erase begins the next time it’s online. You’ll receive an email when the device is erased.
    When the device is erased, click Remove from Account.All your content is erased, and someone else can now activate the device.
    copied from: iCloud: Remove your device from Find My iPhone

Maybe you are looking for