A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Checking the current frame of a movieclip in an array

  1. #1
    Member
    Join Date
    Jan 2018
    Posts
    31

    Checking the current frame of a movieclip in an array

    I would like to know how I should frame the syntax so as to access the currentframe of a movie clip in an array. Here's my take on it....
    Code:
    Segment1:array = mc1, mc2, mc3, mc4
    
    for (i=0 , i < segment1.length, i++) {
      var seg1_item = segment1[i]
      seg1_item.addEventlistener (Event.ENTER_FRAME, revealerlogic);
    }
    
    Function revealerlogic (e:Event){
       if (seg1_item.currentFrame == 8){  //is this syntax right?
           revealer.y +=(revealer.y+ 253)/4
     }
    }

  2. #2
    Senior Member
    Join Date
    May 2016
    Posts
    451
    in swish max like this

    PHP Code:
    onSelfEvent (enterFrame) {
            for (var 
    1<= 4i++) {   
      if( 
    this["mc"i]._currentframe== 8){
          
    trace"ok" )
     }
    }


  3. #3
    Member
    Join Date
    Jan 2018
    Posts
    31
    Thanks for the reply, but I don't think I understand your code, is it php or as3?

  4. #4
    Senior Member
    Join Date
    Feb 2005
    Posts
    1,834
    swish max uses actionscript so kofa's code is actionscript 2. Your code looks like as3. I'd suggest trying: trace(seg1_item.currentFrame); This will give you feedback on what's happening.
    .

Tags for this Thread

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