Skip to main content
rajee331
Participant
September 9, 2015
Question

how can I control captivate slides in flash

  • September 9, 2015
  • 2 replies
  • 536 views

hi, I have created button in flash and wrote the below code  and placed it in first slide of Captivate. I am using captivate 6.  When I click that button it should go to captivate slide 4.

import flash.events.MouseEvent;

import flash.display.MovieClip;

//Get a reference to the Cp main movie

var myRoot:MovieClip = MovieClip(root);

var mainmov:MovieClip = MovieClip(myRoot.parent.root);

//Attach an eventlistener to your flash button

this.btn.addEventListener(MouseEvent.CLICK, btnClick_Handler);

//write the function to handle the click even of your button

function btnClick_Handler(e:MouseEvent):void {

  

              

    mainmov.rdcmndGotoSlide = 4;  

     return;

}

Please help me for this.

Thanks in Advance.

Reji.

This topic has been closed for replies.

2 replies

TLCMediaDesign
Inspiring
September 9, 2015

You have a couple of issues in your code.

1. In your function the "void" at the end means that the function is not expected to return anything, so you should remove "return".

2. You don't need "this" before the button instance name when adding the event listener.

3. When you go to the new slide the project will be paused.

CP still uses rdcmnd and cpCmnd syntax for certain commands.

I don't have CP6 on my current machine, but the following code should work for you. Make sure the your button has an instance name, in my example it is "myNext".

import flash.events.MouseEvent;

import flash.display.MovieClip;

var cpRoot:MovieClip = MovieClip(root);
var mainmov:MovieClip = MovieClip(cpRoot.parent.root);

myNext.addEventListener(MouseEvent.CLICK, nextClick);

function nextClick(e:MouseEvent):void
{
  if (mainmov.rdcmndGotoSlide)
  {
    mainmov.rdcmndGotoSlide = 4;
    mainmov.rdcmndResume = 1;
  }
  else
  {
    mainmov.cpCmndGotoSlide = 4;
    mainmov.rdcmndResume = 1;
  }
}

rajee331
rajee331Author
Participant
September 9, 2015

Thanks alot. Its working fine.

Lilybiri
Legend
September 9, 2015

Double post. Please, don't do that.

rajee331
rajee331Author
Participant
September 9, 2015

removed the first one.