Beispiel #1
0
/* We do the following when open a new page (frame):
   1. Add all pending shape objects to the current frame
   2. Add current frame to the movie
   3. Advance movie by 1 frame
   4. Since in Flash, when you advance the movie to the next frame,
      all items in the previous frame will be preserved.
      To keep in accordance with R's plotting model, we need to
      remove the content of previous frame
   5. Create a new empty canvas (frame)
   6. Reset the clip layer
*/
void swfNewPage(const pGEcontext gc, pDevDesc dd)
{
#ifdef SWF_DEBUG
    Rprintf("newPage called\n");
#endif
    pswfDesc swfInfo = (pswfDesc) dd->deviceSpecific;
    SWFDisplayItem display = NULL;
    
    /* Add current frame to the movie */
    if(swfInfo->currentFrame)
    {
        SWFMovieClip_nextFrame(swfInfo->currentFrame);
        display = SWFMovie_add(swfInfo->m, (SWFBlock) swfInfo->currentFrame);
        SWFMovie_nextFrame(swfInfo->m);
    }
    /* To move to the next frame, we need to first clear the previous one */
    if(display) SWFMovie_remove(swfInfo->m, display);
    /* Create a new canvas(frame) for next plot() */
    swfInfo->currentFrame = newSWFMovieClip();
    SWFMovieClip_setNumberOfFrames(swfInfo->currentFrame, 1);
    /* Renew the clip layer */
    swfInfo->currentClip = NULL;
}
Beispiel #2
0
EXPORT BOOL WINAPI mc_setFrames(int totalFrames, int p2, int p3, int p4)
{
	lstrcpy(funcname, "mc_setFrames");
	SWFMovieClip_setNumberOfFrames(mhsp_movieclip, totalFrames);
	return 0;
}