Copy link to clipboard
Copied
Hey all, just can't get this to be as simple as it should be.
I am trying to learn more about loading movies so I can create a structure for an e-learning course.
I have read so much, but nothing explains why this does not work.
I have 2 movieclips on my main timeline. One is an animation that i just have a ball moving back
and forth. The other is simply a blue box converted to a movie clip.
The bluebox is called cc, its instance name is cc1
the animation movie is called insiderMovieClip and its instance name is insiderMovieClip1
Here the the code I wrote.
--------------------------------------------------------
insiderMovieClip1.onRollOver = function(){
this.play();
}
insiderMovieClip1.onRollOut = function(){
this.stop();
}
cc1.loadMovie("01-VOM_Meters_INTRODUCTION.swf");
cc1._width=50;
cc1._height=50;
trace("cc1="+cc);
cc1.onRollOver = function(){
this.play( );
}
cc1.onRollOut = function(){
this.stop( );
}
-------------------------------------------
The movie that I load is a box animations that simply moves a small black box back and forth.
So when I run it, I can mouse over the insiderMovieClip1 and it starts animating.
The cc1 movie clip does not react at all to anycode I give it. (such as cc1.stop();)
Its as if I have loaded it into the shell of cc1, but I don't have any control of it, inside there...
I have tried several variations of the loadmovide and loadclip. All of which I can get loaded,
but can't seem to stop or start the movie on my terms. (actually I can't get them to do anything
but load)
My goal is to load several movies at a time, allowing the user to page between them, but I don't
wan them to start until I say so. I want to write this so it pulls them from a table, so the range
can be dynamic. (ie 10 page, 300 page, etc..)
Why is loadclip and loadmovie such a pain ?
thanks in advance for your kind assistance... : ]
I cannot really follow all of what you are trying to do, but I will offer that if you want to control a loaded movie, you need to wait until it has loaded before trying to take action with it. BAsed on what I see of your code, you are not doing that. You really want to use loadClip to load the movie rather than loadMovie. The reason for this is that loadClip supports having an event listeners which you can use to detect when the file is finished loading, and then take whatever actions you int
...Copy link to clipboard
Copied
I cannot really follow all of what you are trying to do, but I will offer that if you want to control a loaded movie, you need to wait until it has loaded before trying to take action with it. BAsed on what I see of your code, you are not doing that. You really want to use loadClip to load the movie rather than loadMovie. The reason for this is that loadClip supports having an event listeners which you can use to detect when the file is finished loading, and then take whatever actions you intend with the event handler function.
If you look up MovieClipLoader.addListener in the Flash help documents, there is an example there that is fairly thorough for what you'll need to configure. The main difference being that you would use the onLoadComplete event rather than the onLoadInit.
Copy link to clipboard
Copied
I actually started with loadclip.
I have it working fine.
The issue arises after I have it loaded, it seems I cant tell the loaded clip to stop or start.
I also have issues with using _width and _height the movie just does not show up if I use those
_xscale and _yscale work fine.
What I am trying to do is load a movie from a file (*.swf) then STOP it. So that I can allow
the user to control it. (ie say I have 10 movies, load them all, and allow the user to start
them using a predefined set of controls in the main movie. (next, prev, replay etc.)
Each loaded swf is like a page in a book, when they hit next, it plays.
The example I have points out that you can do a onRollOver to a movie that is on the stage,
but if you do it to a movieclip that is on the stage, but its content was loaded with loadmovie,
it does not react the same way.
How do you tell a movie clip that you have loaded to STOP and PLAY on command from the
main timeline (button ,etc..)
Copy link to clipboard
Copied
As I said, you need to use loadClip and wait for the file to load before you can command it in any way. When you loadthe movie into the movieclip, it assumes the movieclip's name, but not any action you have assign to it such as rollOver, etc. You need to assign those after the movie has loaded, again, waiting for it to have loaded first. To tell something to stop(); and play(); is just those two commands... again, waiting for it to exist before trying to.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now