Hello Flasher
The document class "MainClass" has a variable that is a chapter. Each
chapter has a button for itself and
subbuttons for the movies that are in that chapter, the buttons are a
class called "GenericButton".
The chapter has an event handler that is called when one of the movie
buttons is pressed, it is this code here:
private function movieSelected(ev:flash.events.Event):void{
var buttonClicked:GenericButton =
GenericButton(ev.currentTarget);
if (this.selectedButton !== buttonClicked){
var selectedMovie:*=null;
if (this.selectedButton !== null){
this.selectedButton.selected = false;
}
this.selectedButton = buttonClicked;
this.selectedButton.selected = true;
selectedMovie =
this.data.chapters[this.selectedChapter].movies[buttonClicked.id];
MainClass.ACTIVATED_BUTTON = buttonClicked;
this.dispatchEvent(new MovieEvent("movieSelected",
selectedMovie.file, selectedMovie.subtitles));
this.dispatchEvent(new HistoryEvent("addHistory", "",
selectedMovie));
}
return;
}
The MainClass also has a variable called video which is of type
VideoDisplay, which is set in the event handler "getMovieSelection"
which is also in the MainClass, the code is this:
private function getMovieSelection(movEvent:MovieEvent):void{
video.video = movEvent.movie;
video.subtitle = movEvent.subtitle;
video.showVideo();
video.addEventListener("showSub", subFunction);
video.addEventListener("hideSub", subFunction);
return;
}
Both event handlers, "getMovieSelection" as well as "movieSelected"
are called when you click the button in the menu that will play the
corresponding movie.
Let me know if you need more code.
Thanks for your help!
Post by FlasherI need to see the button code, please
On Sun, 28 Feb 2010 05:32:08 -0800 (PST), nausikaa
Post by nausikaaHi
I am working on a flash app someone else has written and it uses up
all 32 audio channels.
Does anyone know how to prevent that from happening?
The app is a simple video player, it has a menu with 5 buttons, each
button loads and plays a
different movie. If you press the buttoms randomly 33 times, the whole
app goes mute.
I googled but didn't find anything useful about how to free flash
audio channels.
Thanks for any help!
gloria