I am working on a huge project. I have each page broken out into scenes. Intro, Step1-19, and outro. Here is what i have in scene 2. Keep in mind the swf file i am calling was generated with Macromedia Captivate and i dont have a way of editing through flash that I am aware of. I need some time of code that tells scene 2 to go to scene 3 when the external swf file is done playing at 737 frames. Ok here is what i have:
all on one frame
stop action
a label for navigation purposes
preloader action:
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);
myListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
var loaded:Number = Math.round((bytesLoaded/bytesTotal) * 100);
progressBar.gotoAndStop(loaded);
}
myListener.onLoadInit = function (target_mc:MovieClip) {
progressBar._visible = false;
}
myListener.onLoadStart = function (target_mc:MovieClip){
progressBar._visible = true;
}
myMCL.loadClip(“step2.swf”, “step2_container”);
preloader MC bar
container for the swf file to reside
images for look and feel.
Problem 1. I am using actionscript to call the external swf file. I have a preloader that is working somewhat. It preloads the movie with a bar and when it reaches around 60%-70% it starts playing the movie too soon and the bar doesnt go away till it is full. So you see the movie playing with the bar still loading for a bried time.
Problem 2 (bigger problem that 1). After the movie plays it stops and doesnt go to the next scene because I had to put a stop action on the first frame for the preloader to work. So it plays the external file in the container but doesnt move on to the next frame or scene.
I had a friend try this approach and got an error:
Make a MC that has an action script that says…
onClipEvent(enterFrame)
{
if (_root.step2_container._currentframe >= 737)
{
_root.gotoAndPlay(“step3”,1);
}
}
That sounds like logical but isnt working. The error I am getting is:
[FONT=Arial][SIZE=2][COLOR=navy][COLOR=navy][FONT=Arial]Error Symbol=loader_helper, layer=Layer 1, frame=1:Line 1: Clip events are permitted only for movie clip instances[/FONT][/COLOR][/COLOR][/SIZE][/FONT]
[FONT=Arial][SIZE=2][COLOR=navy][COLOR=navy][FONT=Arial]onClipEvent(enterFrame)[/FONT][/COLOR][/COLOR][/SIZE][/FONT]
reason why it isn’t working is because an onClipEvent only works when it’s on the mc.
A suggestion for your next project, try not to use scenes, it’s much easier to split everything in different swf and load them. Also instead of having everything in the same layer you should have a seperate layer for the actions and another layer for the labels that way everything is more organized and easy to find.
Thank you for your help. I tried the old code on the instance and the error went away but still didnt move to step3. I tried your code on the actions frame on the main timeline and/or in the MC. The error went away as well but still didnt go to step3
I have learned about not doing scenes while i was researching for this problem. I hate to go back and re-organize it. I will do so if it is my only hope to get this to work. Any thoughts on what i can do next?
Thank you for your help. I tried the old code on the instance and the error went away but still didnt move to step3. I tried your code on the actions frame on the main timeline and/or in the MC. The error went away as well but still didnt go to step3
I have learned about not doing scenes while i was researching for this problem. I hate to go back and re-organize it. I will do so if it is my only hope to get this to work. Any thoughts on what i can do next?
oh also everything is in a seperate layer all on the first frame
yeah i think it should too. i put this code on the instance of the MC and added traces and the trace “The Movie Clip is Working” pulls up a millions times till i close it. The other trace doesnt show up. I even tried shortening the frames to 200 to see if it would cut off early and it didnt.
onClipEvent(enterFrame)
{
trace (“The Movie Clip is Working”);
if (_root.step2_container._currentframe>=737)
{
trace (“The IF statement works”);
_root.gotoAndPlay(“step3”,1);
}
}
I feel that im limited to what i can do cuz the external file im loading is a captivate swf not a flash swf. I read that i might need to add a stop action on the swf so it wont play before it loads. but that is the other problem i am having. I cant seem to fix either one of them
i just thought about what i wrote. It should matter what the external file is or has. I could be calling a video or a jpg. The thing just needs to play and move on.
what does trace(_root.step2_container._currentframe); give you when you trace it inside of the onClipEvent ?? it should show you the current frame and if that number doesn’t move up that’s probably the reason why you’re if statement isn’t being met