Copy link to clipboard
Copied
Is it possible to pass a Show command back to Captivate from Flash? I have tried only to get a syntax error in Flash. What I am trying to do is only allow a Next button to become visible after an activity has been completed in an embedded Flash file. I have passed a variable back to Captivate indicating completion.
Copy link to clipboard
Copied
Skylark,
Are you using Cp4 and AcitionScript 2 or 3? I'm assuming the activity the user needs to complete is in the embedded flash file and the NEXT button in inside of the captivate project??
One way to do this would be to have the next button inside of your embeded flash file. If you're using AS3, you could attach an event listener to the button to move the Cp4 project to the next slide:
//Get a reference to the Cp main movie
var mainmov:MovieClip = MovieClip(root);
//Attach an eventlistener to your flash button
this.myButton.addEventListener(MouseEvent.CLICK, btnClick_Handler);
//write the function to handle the click even of your button
function btnClick_Handler(e:MouseEvent):void {
mainmov.rdcmndNextSlide = 1;
return;
}
The other way to do it, is to get a reference to the Cp NEXT button through flash and make the button visible.
Suppose your button was on slide 3 and you have your button a name of MyButton inside of Cp where the visible checkbox was unchecked for the button. In your flash interaction you could do:
//Get a reference to the Cp main movie
var mainmov:MovieClip = MovieClip(root);
//Make the button visible
mainmov.slide2__color_mc.MyButton.visible = true; //slides are zero indexed
if your slide was a question slide it would be slide2__question_mc.
if your slide was an image slide it would be slide2__image_mc.
HTH,
Jim Leichliter
Copy link to clipboard
Copied
There's a slight change in your original code if your using Captivate 5. When you get your reference to the main Captivate movie you need to do so using a proxy of root.
// Get reference to the Captivate Main Movie var myRoot:MovieClip = MovieClip(root); var mainmov:MovieClip = MovieClip(myRoot.parent.root);
If your trying to move to the next slide you would write:
var myRoot:MovieClip = MovieClip(root);
var mainmov:MovieClip = MovieClip(myRoot.parent.root);
mainmov.rdcmndNextSlide = 1;
Copy link to clipboard
Copied
Hi there,
I've tried using the revised code with no luck,
If I could briefyl explain what I'm trying to achieve and the porblems that are occuring.
I've been asked to create some Question slides, that have additional buttons. I know this isn't possible in Captivate as Question Sldies are "unique". My first thought was to create an SWF with these buttons, the buttons are to hide/show small animations and pictures relating to the question. However it appears that an animation inserted onto a question slidee will always appear below the Question Objects (question text, answers text, submit buttons, feedback etc)? Is this the case or is there a way round this?
So I decided to create a button in flash that redirectes the user to another screen where they can view the images/animations. The code on the button is as follows
import flash.events.*;
import flash.display.*;
var myRoot:MovieClip=MovieClip(root);
var mainmov:MovieClip=MovieClip(myRoot.parent.root);
ff_btn.addEventListener(MouseEvent.MOUSE_UP, mouseReleaseSlide1Btn);
function mouseReleaseSlide1Btn(event:Event):void {
mainmov.rdcmndGotoSlide = 4;
return;
}
adding the revised line for CP5 as you suggested seems to brig this error in Flash:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@10e57b51 to flash.display.MovieClip.
at faultfinding_fla::MainTimeline/frame1()
I'm using CP5 and Flash CS4 any help would be much appreciated!
Copy link to clipboard
Copied
Not sure why this isn't considered answered...this WORKED WONDERFULLY...much appreciation for your post! I used the first option, put a button in my flash movie and copied the movie into my CPT and it worked as intended...(I was skeptical because I've had a bit of a challenge with AS3 and CPT 4)...Thanks!
Cheers,
MJL
Copy link to clipboard
Copied
Hey all,
I had a similar problem getting a Flash button to control Captivate.
I used the method mentioned above with a slight tweak for Captivate 6 and Flash 5.5, had to add imports in the code in Flash, like so:
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.rdcmndPrevious = 1;
return;
}
Worked like a charm!
Thanks,
FDHjr2
Copy link to clipboard
Copied
If you are looking to have an embedded flash file hide/show the next button in the skin, try these respectively (AS2):
_root.cpPbcBar_mc.pbcBar_mc.pbcForward_mc._visible=false;
_root.cpPbcBar_mc.pbcBar_mc.pbcForward_mc._visible=true;
Note that when you import your swf into Cp, it will alert you that you are embedding a file that makes reference to the root of your project.
Which of course is exactly what we are trying to do here.
Hope that helps,
Russ
Copy link to clipboard
Copied
Thanks for all the great suggestions, I am using Capivate 4 an AS2. I am not using the default skin navigation buttons. Nothing I have tried has worked. Here are some of the things that I have tried. This can't be that hard.
This is attached to a button on the main timeline.
on (release) {
testbutton._visible = true;
testbutton.visible = true; ( I know this is AS3, I am just trying everything)
_root.testbutton._visible = true;
_root.testbutton.visible = true;
}
I have tried many other things, many so ridiculous I don't want to post. Nothing works. Again, thanks for the suggestions, I have tried them all.
Copy link to clipboard
Copied
So is your next button part of your embeded flash animation? Can you describe this more?
Thanks,
Jim
Copy link to clipboard
Copied
Yes, sorry for the lack of detail. It is a Flash file embedded in a Captivate presentation. This is a quick test that I created that had a one slide Captivate file with a button named "testbutton". I then created a Flash file with a button with the attached action and imported it into the Captivate file.
on (release) {
testbutton._visible = true;
testbutton.visible = true; ( I know this is AS3, I am just trying everything)
_root.testbutton._visible = true;
_root.testbutton.visible = true;
}
Again, I know this is a mess, just wanted to show some of the things that I have tried.
Copy link to clipboard
Copied
You are missing a reference to the slide. Try:
_root._slide0__color_mc.testbutton._visible = true; //the slide numbering in code starts from a zero based index so slide0__color_mc is slide 1.
or
_root.slide0__color_mc.testbutton._visible = true;
Can't remember since it's been so long since I've done AS2.
Thx,
Jim Leichliter