Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

how can I control captivate slides in flash

New Here ,
Sep 09, 2015 Sep 09, 2015

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.

513
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 09, 2015 Sep 09, 2015

Double post. Please, don't do that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 09, 2015 Sep 09, 2015

removed the first one.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Sep 09, 2015 Sep 09, 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;
  }
}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 09, 2015 Sep 09, 2015
LATEST

Thanks alot. Its working fine.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources