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

How can I change the function of a flash button?

Participant ,
Oct 15, 2011 Oct 15, 2011

Copy link to clipboard

Copied

Hello,

Not sure if this should go in the Flash forum or Captivate forum, but does anyone know how where to find ActionScript 3 commands for Captivate?

I downloaded a pre-made Flash button (source file) for Adobe Captivate that was originally made to make a video go to the next slide, when pressed. It does that fine, but I wanted to know how to use the ActionScript code in Flash Professional CS5 to have the button JUMP to a specific slide in Captivate, instead of just go to the NEXT slide. I know generally how code works, but have never really used it, and don’t know the specific command to make that happen. Currently the relevant part of the code in the Flash button reads:

function clicked(e:MouseEvent):void{

                var myRoot:MovieClip = MovieClip(root);

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

                mainmov.rdcmndNextSlide = 1;

I suspect that I just have to change the last line to something else and it should work, but I would need the command. Can anyone tell me what needs to be changed in the above code to make that happen?

The full code is below. Thanks.

code.JPG

TOPICS
Import export

Views

1.6K

Translate

Translate

Report

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

correct answers 1 Correct answer

Participant , Nov 28, 2011 Nov 28, 2011

Here's an answer for anyone out there trying to do the same thing.

To change the function, just change "rdcmndNextSlide = 1" to another command with its variable. The commands and variables can be found here:

http://www.cpguru.com/2010/07/20/adobe-captivate-5-system-variables/

Votes

Translate

Translate
Community Expert ,
Oct 16, 2011 Oct 16, 2011

Copy link to clipboard

Copied

Hello and welcome to the forum,

This is the Corner peel widget from Michael Lund, which normally moves to the next slide. Did not read the agreement... are you sure it is correct to change this, please ask Michael.

I'm not a coder at all, but bit acquainted with system variables and advanced actions. The used CP-variable here is rdcmndNextSlide. The variable that jumps to a slide is cpCmndGotoSlide and slide index start with 0. Perhaps it is also possible to use the slide label, but not sure.

Another possibility: there is a Flash button included in Captivate,  to which you can attach all possible actions that are available for interactive objects. You could also change that button in Flash.

Lilybiri

Votes

Translate

Translate

Report

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
Participant ,
Oct 17, 2011 Oct 17, 2011

Copy link to clipboard

Copied

You are awesome. Thank you. That was extremely helpful. Michael also gave me a list of variables to use. However, when I use:

cpCmndGotoSlide = 5

It always jumps to slide 9, regardless of the value I put in the place of the '5'. So it does jump to a slide, but I can't yet get it to jump to the slide I want. In other words,

cpCmndGotoSlide = 7

or

cpCmndGotoSlide = 13

or

cpCmndGotoSlide = 44

etc,

produces the same result: jump to slide 9. I followed the same format... Any idea why it wouldn't be working?

Here is the full script:

this.stop();

// Set up event listeners

main.btn2_mc.addEventListener (MouseEvent.MOUSE_OVER, over);

main.btn2_mc.addEventListener (MouseEvent.MOUSE_OUT, out);

main.btn2_mc.addEventListener (MouseEvent.MOUSE_DOWN, clicked);

// functions for eventlisteners

function over(e:MouseEvent):void{

    main.button1_mc.gotoAndPlay("s1");

};

function out(e:MouseEvent):void{

    main.button1_mc.gotoAndPlay("s2");

};

function clicked(e:MouseEvent):void{

    var myRoot:MovieClip = MovieClip(root);

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

    mainmov.cpCmndGotoSlide = 5;   

};

Votes

Translate

Translate

Report

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 ,
Oct 17, 2011 Oct 17, 2011

Copy link to clipboard

Copied

Hello,


As I told you before, I'm not a coder and have no idea what is going wrong. I would try with a slide label, but do not know how.

Lilybiri

Votes

Translate

Translate

Report

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
Participant ,
Oct 17, 2011 Oct 17, 2011

Copy link to clipboard

Copied

Okay, well thank you very much anyway. I'll post an answer when I get one.

Votes

Translate

Translate

Report

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
Participant ,
Nov 28, 2011 Nov 28, 2011

Copy link to clipboard

Copied

LATEST

Here's an answer for anyone out there trying to do the same thing.

To change the function, just change "rdcmndNextSlide = 1" to another command with its variable. The commands and variables can be found here:

http://www.cpguru.com/2010/07/20/adobe-captivate-5-system-variables/

Votes

Translate

Translate

Report

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