A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: simple mc _name question

  1. #1
    Senior Member
    Join Date
    Feb 2002
    Location
    UK
    Posts
    436

    simple mc _name question

    Hi there

    Im trying to use my mc names in some actionscript. However I want to take off the front of the name ie. moviename1 I want to only use the 1

    Ive read somewhere before how to do this but can no longer remember how

    could anybody remind me

    thanks a lot for your help!

    Nick

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    hi,

    check substr() in your help files.
    Code:
    myMovie="moviename1";
    end = myMovie.substr(9, myMovie.length);
    trace(end);
    gparis
    Last edited by gparis; 03-03-2007 at 05:35 PM.

  3. #3
    Senior Member
    Join Date
    Feb 2002
    Location
    UK
    Posts
    436
    thanks for that

  4. #4
    Senior Member
    Join Date
    Feb 2002
    Location
    UK
    Posts
    436
    Hi - Ive tried implementing the code but am still havent a slight problem - I have 22 buttons - when I click on one button I want to deactive the others (the loop code) but none of them seem to deactive Im guessing it must be something to do with the naming of the mc


    button code...

    on (release) {
    longname = this._name;
    end = longname.substr(7, longname.length);
    this._parent.navclick(longname);
    }




    function navclick(Mynext) {
    if (current<>Mynext) {
    for (loop=0; loop<=22; loop++) {
    this[loop].gotoAndStop(1);
    }
    this[Mynext].gotoAndStop(3);
    current = Mynext;
    }
    }

  5. #5
    Senior Member
    Join Date
    Feb 2002
    Location
    UK
    Posts
    436
    heres the fla - if anybody could help diagnose it would be most appreciated

    thanks a lot!
    Attached Files Attached Files
    Last edited by nickholl; 03-03-2007 at 07:43 PM.

  6. #6
    Senior Member
    Join Date
    Feb 2002
    Location
    UK
    Posts
    436
    As usual Ive worked it out -as it was just a stupid mistake by myself - doh!

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