Skip to main content
Legend
January 3, 2010
Question

AS3 Widgets and AddNoSkipFrame

  • January 3, 2010
  • 1 reply
  • 622 views

I'm trying to develop a CP4 widget and i'm studying the AS3 versions of the Certificate and Perpetual button widgets.  Both of these use AddNoSkipFrame.  Based on what the help says, it would seem that this is used to tell the pacemaker in CP to not skip the frame passed in as an argument.  However, when looking at the code for the Certificate and Perpetual button, the code desn't quite add up:

                    var slidestart = movieHandle.getSlideProps().startFrame;
                    var slideend = movieHandle.getSlideProps().endFrame;
                    pauseFrame = Math.ceil((slidestart  + slideend)/2);
                    var SlidePauseFrame = pauseFrame - slidestart + 1;
                    movieHandle.getSlideProps().slideHandle.AddNoSkipFrame(SlidePauseFrame);
                    addednoskipframe = true;
                }
                if(movieHandle.isWidgetVisible()  && mainmov.rdinfoCurrentFrame  == pauseFrame)
                {
                    mainmov.rdcmndPause = 1;
                }

I would think that you'd want to tell CP not to skip the frame you are wanting to check in your if condition where rdinfoCurrentFrame ==pauseFrame so you could reliably pause the movie.  But when doing the math, SlidePauseFrame and pauseFrame are very different numbers.  If startFrame was 90 and endFrame was 240, SlidePauseFrame = 76 and pauseFrame = 165.  Why AddNoSkipFrame for frame 76 when the if condition checks for frame 165?  A similar thing happens with the Perpetual button example.

The help description is a little fuzzy as well.  At one point it describes AddNoSkipFrame as "No frame is skipped at runtime."  So does that mean once AddNoSkipFrame is called, no frame from that point forward on the slide is skipped?  Then the help states: "AddNoSkipFrame

is used to ensure that pacemaker does not skip the specified frame." which would indicate that it only works for the specified frame passed in as an argument.

It would be greatly appreciated if someone could shed some light on this.

Thanks,

Jim Leichliter

This topic has been closed for replies.

1 reply

Legend
January 4, 2010

I figured it out.  AddNoSkipFrame is relative to the slide starting at one.  If only I had read a little closer.

The code I ended up with was:

movieHandle.getSlideProps().slideHandle.AddNoSkipFrame(3)

if(mainmov.rdinfoCurrentFrame  == 3 + slidestart)
            {

                    //Some code here

          }

rdinfoCurrentFrame is indexed starting from one.

slidestart and slideend for the slides reported as:

slide one: 0 to 5

slide two: 5 to 10

slide three: 10 to 15

When you check the totalframes for each slide, it reported as:

slide 1 = 6

slide 2 = 6

slide 3 = 6

This is obviously indexed from zero.  When added up, it's 18, but remember frames 5 and 10 are counted twice.

These calculations jive with the Adobe documentation on these variables and functions... and also the testing I did.  Hope this helps someone else.

Thanks,

Jim Leichliter