A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Can someone explain this???

  1. #1
    Senior Member
    Join Date
    Jun 2001
    Location
    Virginia, USA
    Posts
    437
    Code:
    onClipEvent (enterFrame){
      value = substring(this.myInput, 1, 4);
      trace ("value: "+ value);
    }
    and
    Code:
    onClipEvent (enterFrame){
      value = substring(this.myInput, 0, 4);
      trace ("value: "+ value);
    }
    are the same? I got the same result for both codes.

    please note the different: 1 and 0

  2. #2
    Professional Nobody
    Join Date
    Jul 2001
    Location
    Portland, OR
    Posts
    46
    Is this just alternative syntax?
    I thought it was
    value = this.myInput.substring(0,4);
    What are you getting?

  3. #3
    Senior Member
    Join Date
    Jun 2001
    Location
    Virginia, USA
    Posts
    437
    The only thing different in this 2 codes in index number, one is 1 and one is 0, but both produce the same result.

    If my string is 123456, they both return: 1234and that's what got me confused.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center