A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: loop problem

  1. #1
    Senior Member
    Join Date
    May 2004
    Posts
    627

    loop problem

    I tried to play around with looping but I found some problems with this function
    This is something I want to achieve
    this.m1.mm1.prevFrame();
    .....
    this.m10.mm10.prevFrame();

    this["m"+j+".mm"+j].prevFrame();

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    try - this[["m"+j]["mm"+j]].prevFrame();

  3. #3
    Senior Member
    Join Date
    May 2004
    Posts
    627
    this.m1.mm1.nextFrame();
    this.m2.mm2.nextFrame();
    this.m3.mm3.nextFrame();
    this.m4.mm4.nextFrame();

    If I tried this script, This works for me,

    BUt whenever I use the loop method, it says".. TypeError: Error #1010: A term is undefined and has no properties."

  4. #4
    Senior Member
    Join Date
    May 2004
    Posts
    627
    Something I am trying but not working
    this[["m"+j]["mm"+j]].onEnterFrame = function() {
    trace("mm")
    };

    this[["m"+j+".mm"+j]].onEnterFrame = function() {
    trace("mm")
    };

    _root[["m"+j+".mm"+j]].onEnterFrame = function() {
    trace("mm")
    };


    m1.mm1.onEnterFrame = function() {
    //trace("mm")
    }

  5. #5
    Junior Member
    Join Date
    Oct 2008
    Posts
    27
    This worked for me...
    PHP Code:
    for(var i:int 1<= 4i++)
    {
        
    this["m" i].getChildByName("mm" i).nextFrame();

    getChildByName seams to work more often then "this" from my experience.

    And in your last post, did you switch to AS2? Because I thought onEnterFrame didn't work in AS3.

  6. #6
    Junior Member
    Join Date
    Jul 2009
    Posts
    1

    How to stop One function By another function in AS3

    Please if any one knows answer then reply me

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