flash actionscript:
I have a main movie (index.swf) that preloads my external SWF that is a menu button 4.swf My index.swf has background music (song1) that plays on load. I also have background music (song2) that plays on my 4.swf It works fine when I test 4.swf directly however when I load my main index.swf I do not hear the song2. I used stopAllSounds(); in my4.swf to stop the background music (song1) and then load my song2 stopAllSounds(); my_sound = new Sound(sound_loop); my_sound.loadSound("4.mp3",true); my_sound.start(0,100); This has gotten me to get both songs to play when the site is loaded and when I click on my menu for 4 button all the sound stops and my song2 never plays. My actionscript is not very good so any details you can give would be greatly appreciated. Thanks much!
All the files are in the same directory index.html, 4.mp3, index.swf, 4.swf
the code you showed is the code that plays when 4.swf loads and it works as expected?
Yes, 4.swf works as it should The main movie, index.swf has a menu bar with loads all the external swfs. Actually the button does nothing the loading is done the actionscript at loading. var movie:MovieClip = _root.StoredActions.Holder.Movies.Holder2.CMovie.duplicateMovieClip("CMovie" + n,n); loadMovie(n+".swf",_root.StoredActions.Holder.Movies.Holder2["CMovie"+n]); if(n>1){ _root.StoredActions.Holder.Movies.Holder2["CMovie"+n]._x = 3000; } var MovieLoaded = 0; percent = 0;
you mean 4.swf works without problem when you open 4.html in a browser window but when you open index.html in a browser window, 4.swf is loaded but its sound does not play? if yes, to above, using the correct paths, zip index.fla, 4.fla and 4.mp3 and post a link
here is frame 3 of my loader in index.fla var movie:MovieClip = _root.StoredActions.Holder.Movies.Holder2.CMovie.duplicateMovieClip("CMovie" + n,n); loadMovie(n+".swf",_root.StoredActions.Holder.Movies.Holder2["CMovie"+n]); if(n>1){ _root.StoredActions.Holder.Movies.Holder2["CMovie"+n]._x = 3000; } var MovieLoaded = 0; percent = 0; frame4 MovieLoaded = _root.StoredActions.Holder.Movies.Holder2["CMovie"+n].getBytesLoaded(); loadTotal = _root.StoredActions.Holder.Movies.Holder2["CMovie"+n].getBytesTotal(); percent = int(MovieLoaded/loadTotal*100); Bar.gotoAndStop(percent); loadingName = ("Loading... " + percent+ "%" + " of "+ n); Loadtext_txt.text = loadingName; if (loadTotal>10) { if (MovieLoaded>=loadTotal) { gotoAndPlay(6); } } frame6 if (n < _root.StoredActions.nMenus) { n++; gotoAndPlay(3); } else { gotoAndStop("Stopload"); _root.gotoAndPlay("Play"); } I know that the above code is loading all the external swf and causing the music to start after load. Is there a way to stop it from loading the sound?
you have a coding problem in index.fla. to determine what that is will require more than a little effort because your coding technique. there may be others in this forum that would be willing to help you without charge. but i'm unable to help you with this unless you want to hire me.
Don't see what you're looking for? Try a search.
|