Skip to main content
Known Participant
November 13, 2007
Question

Why error message?

  • November 13, 2007
  • 42 replies
  • 2873 views
I am attempting to learn to do in Flash some things I have typically done in Director. Needless to say, it's been a tough go. I have been using some of the Lynda.com stuff and it's been helpful, but I now have a problem I can't figure out. I am using a script that Lynda.com uses in their tutorial movies. I copied it (except using my names for things, of course) and from what I can tell, I did it correctly, but I keep getting an error message. Here is my action script (in it's own layer):

stop();

function onIntroClick(evt:MouseEvent):void {
gotoAndStop("intro");
}
introbut2jpg.addEventListener(MouseEvent.CLICK, onIntroClick);

It's just a graphic I turned into a button that should jump to the frame labeled "intro" and stop there. Works great in the tutorial, but I get:

Location: Scene = Scene 1, layer = Actions, frame=39, Line 3
Description: The class or interface 'MouseEvent' could not be loaded.
Source: function onIntroClick(evt:MouseEvent):void {
This topic has been closed for replies.

42 replies

kglad
Community Expert
Community Expert
November 14, 2007
are you applying the stop() method to your flvplayback instance just prior to all your start() methods?
kglad
Community Expert
Community Expert
November 14, 2007
do you have more than one flvplayback instance?
Participating Frequently
November 14, 2007
Yes-- I am now thinking that I should have only 1 instance, and just have it load different content at different keyframes, yes?

Edit: I have now changed it to only one instance of the FLVPlayback-- that does seem like the smarter way, but it still doesn't stop a selection from playing when you go to another.
November 14, 2007
I have tried putting the stop in a couple of places; but can't figure out where the stop should go. I was thinking a stop needed to be at the start of each instance, so that whatever is playing when the new instance is selected will stop. Am I looking at it wrong?
kglad
Community Expert
Community Expert
November 13, 2007
you should apply the stop() method to the flvplayback instance that's currently playing.
kglad
Community Expert
Community Expert
November 13, 2007
that "bit of code" means nothing in actionscript.
November 13, 2007
Oh well,that's what I get for poking around! :)

Is there a simple fix to globally stop whichever flv is playing so that the newly selected one plays alone?

Thanks!
eddiwill9Author
Known Participant
November 13, 2007
I found this bit of code "not_set_yet.stop", which looks like it wants me to enter a particular video to stop. I need something that stops whichever of the 5 that may be playing.
eddiwill9Author
Known Participant
November 13, 2007
Didn't think I would be back again so soon! Now that my nav button works, I have begun duplicating it. The only problem is, once you paly one movie and move to another, the first movie continues at the same time. I guess I need something to tell any previous movie to stop, while allowing the current selection to play.
kglad
Community Expert
Community Expert
November 13, 2007
if the timeline does not enter a frame that has code attached, the code will not execute. so, having stop() in a frame the plays prior to a frame that contains code will prevent the code from executing. having a stop() in the same frame as code, does not stop that code from executing.
eddiwill9Author
Known Participant
November 13, 2007
That's odd. If I have "stop()" even one frame prior to the script for my button, it won't execute. I don't get a message or anything, but the playhead doesn't jump. If I move my button script to the same frame, or a prior frame, all works fine.

I'll just keep them together for the time being, since that works.

I've taken up more than my share of your time today and don't want to wear out my welcome!
kglad
Community Expert
Community Expert
November 13, 2007
stop() stops your timeline from advancing, but does not stop code from executing. however, if you used "stop" instead of "stop()", the flash compiler may have thrown an error and refused to execute any code.