FORUMS: list search recent posts

Controlling external swf problem

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
mark2741
Controlling external swf problem
on Jan 4, 2006 at 6:59:31 pm

I thought I had this figured out, but still no luck...

I'm creating some Captivate-based tutorials. Once they are created, I export them as swf movies.

I then have a main navigation movie that contains an empty movie clip named 'content_mc'. Also, I have in the main navigation movie, some buttons: pause_btn, back_btn, and next_btn. The pause button is supposed to be a toggle button that stops and starts the swf that is loaded into content_mc.

Problem is I cannot get my pause button to work (never mind the other two buttons...I figure if I can just get one working, I'll be able to get the other two working). When i click on the pause button nothing happens. I tried tracing it out and the variables are set properly. It just doesn't stop. It's as if my targeting of the external loaded swf is no correct but I've tried everything - _parent, _parent._parent, _root, this., and with no target prefix (as it is now). I put together a test shell like this before and it worked, so i figured this would be a piece of cake....ugh. I'm thinking perhaps it has to do with me not preloading the captivate swf? I don't know how to create a preloader but if that is the problem I guess I could figure it out. Any help is GREATLY appreciated. Here is the code I have on the first frame (the only frame) of the main navigation movie. Disregard the array at the top for now. I plan on populating that with the starting frame numbers of each of the steps in the captivate swfs (so it'll have to be changed for each captivate tutorial, which is fine). Take a look at my pause_btn and hopefully someone can point me in the right direction:

loadMovie("returns_workstationInstall_CD_122705.swf",content_mc);

//vars
//enter in the starting frame number for each step in the array below
_root.steps = [1,100,200,300,400,500,600,700,800,900,1000,1100,1200];
_root.currentStepIndex = 0;

var toggle:Number=0;
_global.x;

//begin play/pause button code

this.pause_btn.onRelease = function() {

if (toggle !==1) {
content_mc.stop();
toggle=1;
_root.content_mc.x=_currentFrame;
} else {
_root.content_mc.play(x);
toggle=0;
}
}

//end of play/pause button code

//next button

this.next_btn.onRelease = function() {
if (currentStepIndex<=steps.length) {
_root.currentStepIndex++;
content_mc.gotoAndPlay(_root.steps[_root.currentStepIndex]);
}
}

//back button

this.back_btn.onRelease = function() {
if (currentStepIndex<=steps.length) {
_root.currentStepIndex--;
content_mc.gotoAndPlay(_root.steps[_root.currentStepIndex]);

}
}




Return to posts index

mark2741
Re: Controlling external swf problem
on Jan 4, 2006 at 7:52:55 pm

I just changed the loaded swf and it works....this is driving me nuts.

To clarify...

In the code I posted I was loading in a Macromedia Captivate swf (screencam software, for those that don't know) and then trying to control it, with no success, from the main movie's navigation buttons.

Now, before trying this with the Captivate SWF, I was doing something similar with a simple swf I generated previously that just displays the current frame number in a dynamic text field via an onEnterFrame script. It worked then.

So I just changed the code in the main movie to load in this simple test swf (the one showing just the current frame number increasing) instead of the Captivate swf. Bam. My pause/play toggle button, and my fast-forward and rewind buttons now work.

So something is unique about the swf's generated by Captivate? This is not making sense to me. Ugh!



Return to posts index

mark2741
Re: Controlling external swf problem
on Jan 4, 2006 at 8:20:15 pm

Looks like my suspicion was correct...

At first I thought it was the lack of a preloader (as you can probably tell, I know enough to be dangerous but that's about it : ) So I looked in my invaluable Moock book and got the code for a simple preloader and added it to the first two frames of the captivate swf that I had previously imported into flash and then exported as a swf (I had done this previously because up to this point I had all of the navigation controls embedded into each captivate/tutorial - I'm externaliziing the navigation from the content now).

It worked. So at first i thought it must be the preloader...but then I remembered that I was now working with a swf exported directly from flash and not from captivate. So I took out the preloader and put my code in my main movie back to the way it was when I posted it here. Only this time I didn't use the Captivate exported swf as the loadMovie, I used the swf of the captivate that I exported directly out of flash. In theory it should make ZERO difference. Bam. it works. Unbelievable. Time to search the Captivate support forum on macromedia's site to see if this is a known issue.



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]