ActionScript 2.0 :: [FMX] Controlling Sounds Across Multiple .SWFs?

Apr 10, 2003

I need a little advice. I've got a set of swfs that are all part of one training, and within these movies are a few sound effects attached to button instances. I want the user to be able to click a button to turn the sound on or off at any time during the training.

My first idea was to create a variable called wantSound, which each sound instance checks before deciding to play. This is working perfectly. There's a toggle switch on the main timeline that sets sound to on or off, and when a sound is supposed to play, it checks to see if wantSound=true, and plays, or if it is false, it does not.

This works fine on each individual .swf, but when a new .swf loads in, the sound defaults back to true, and the user has to turn it off again. I imagine this could be fixed by loading each movie into different levels instead of loading them into level0 or root, but as this is not how I originally created the file, that will take a lot of work to handle aligning the loaded movies and parking them (making sure none of the buttons are active on the level below). I'm lazy, what can I say? :-)

I've been looking around at similar questions, and found a decent tutorial on Macromedia's site about using javascript to pass a variable from flash to HTML. I went through that, and managed to get Flash to send my wantSound variable to HTML with no problem. Check here for the tutorial.

The only problem is that in macromedia's example for sending data from HTML back to Flash, they use a text field for getting the variable. I just want to take the variable sent from Flash to HTML and send it back to Flash when requested (at the beginning of the next SWF.)

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Controlling Sounds With Buttons?

Mar 22, 2011

I'm making a section in my production with 4 audio files which are controlled with a play and stop button. I've managed to make the first one work on the page with this code -

Code:
import flash.media.SoundChannel;
var mySoundReq:URLRequest = new URLRequest("audio/track1.mp3");
var mySound:Sound = new Sound();

[Code].....

What would I need to copy to control 3 other files the same way? (i.e "audio/track2.mp3" with play_btn2/stop_btn2). I've tried copying part of the code and changing the instant names but I keep getting errors so I'd rather ask somebody who knows what they're doing.

View 3 Replies

ActionScript 2.0 :: Controlling All Sounds Via Slidebar?

May 6, 2005

[URL]

.. but I'd like to be able to control all audio with this slidebar. I have various streaming sounds through a movie, along with background music and one specific voiceover that is loaded via:

m = "track";
createEmptyMovieClip( m, 1 );
s = new Sound( eval(m) );

[Code]....

View 1 Replies

ActionScript 2.0 :: Controlling 2 Sounds In Flash?

Feb 7, 2007

I have some strange problem while using more than one sound that I want control.

Code:
var myMusic:Sound = new Sound();
myMusic.attachSound("music1");
myMusic.start(0, 999);
myMusic.setVolume(50);

[code]....

When I try to reduce sound volume of 1 sound, volume of all sounds is beeing reduced?!The same situation is when I use tween comands like: this.myMusic.volumeTo(5, 1, "linear");

View 1 Replies

ActionScript 2.0 :: Controlling Objects (Sounds) Across MovieClips

Sep 9, 2003

I have a few movie clips running swf's and I need a play/stop button in one clip to control the audio in another clip. The buttons are in the _root clip and the audio is contained in an swf I load into an empty 'content' movie. I have labelled the frame containing the audio but can't seem to use the object hierarchy to access it. On a somewhat similar note, is there a way to have the root movie display the bytes loaded/bytes total of a swf loading over top of the root movie, i.e. in a content empty movieclip?

View 1 Replies

ActionScript 3.0 :: Loading Multiple .swfs Into Multiple .swfs?

Aug 13, 2010

I am loading multiple .swfs into multiple .swfs, but the .swf are never being properly unloaded. I thought they were unloading until I started monitoring my Page File Usage and seeing it increase everytime I loaded another external swf.
 
In using this function to load my content, what would be the proper way/function to unload the content?

[Code]...

View 2 Replies

ActionScript 3.0 :: Mute All Sounds In A Swfs Except One?

Mar 31, 2010

To stop all sounds in a swf, I'm using the following [code]...

This mutes all sounds. Now there is an issue, I want to stop all sounds but one (i.e. "music.mp3").

View 3 Replies

ActionScript 3.0 :: Overlapping Sounds With SWFs With Embedded Audio?

Aug 11, 2010

I am using an xml based slide navigation shell that uses next and back buttons to page through content.

If I use SWFs with embedded audio (which I need to do sometimes) the audio will overlap after I leave the slide, SoundMixer.stopAll() is not doing the trick. I think removeChild may be the direction I need, but I'm not sure how to implement so far.

View 3 Replies

ActionScript 3.0 :: Share Sounds Between Parent And Child Swfs?

Jan 18, 2011

Is there a way I can share sound assets between parent and child swfs?

Currently, I have a parent swf that loads a child swf (and each have preloaders) and some of them have the same sound assets. I would rather only load the sounds once... can I reference a sound even if it 'lives' in another swf?

View 1 Replies

ActionScript 3.0 :: Control Multiple Sounds In Multiple Timelines

Mar 10, 2009

Here's the setup:

-I have a music score that will be streamed in via actionscript

-I also have multiple short sounds (SFX) in multiple nested MCs

-these SFX sounds are customized using the ide edit interface, so it would be a pain to use actionscript to play each sound

What I need: To have 1 mute button for the music, and 1 mute button for the SFX, both on the root timeline.[code]...

View 7 Replies

ActionScript 2.0 :: Possible To Controlling Loaded Swfs?

Apr 21, 2004

What I'm trying to do is create buttons in one swf that load another swf and also give instructions to begin playing from a certain frame in that swf. The target swf has a preloader on frame 1 and then a movie clip that contains a video in frame 2. Depending on which button the user presses the video will be cued up ready to play at different frames. think it may need an if statement ie if x=34 then goto frame 34, but I can't seem to pass the variables to the loaded swf.In the zip file is an example of what I'm trying to do.

View 10 Replies

ActionScript 1/2 :: Controlling Embedded Captivate SWFs

May 25, 2006

I have a SWF (SWF A) that I'm loading into a movieclip (Movieclip C)which is part of another SWF (SWF B). Basically, SWF B functions as a player, with play and pause controls. These controls control Movieclip C where the external SWF A is loaded into.Normally, I have had no problem with this and it always works. At run time, when you click the pause button on SWF B, a stop() command is issued to Movieclip C, which stops the play of
the external movieclip (SWF A) loaded into it.However, I did a screen capture with Captivate and published it as a SWF. I loaded this SWF (SWF A) into Movieclip C in SWF B at run time. However, clicking the controls on SWF I created has NO EFFECT on the SWF I created in Captivate. It just keeps playing.I guess all SWFs are NOT created equal. How can I make this work?

View 4 Replies

ActionScript 2.0 :: Controlling External Swfs Loaded Into An MC

Mar 23, 2005

what actionscript could i use to make an movies loaded into a movieclip play. tried _root.holderMC.play(); holderMC being the movieclip the external swf is loaded into, doesn't seem to work! searched the internet too but no lucky

View 2 Replies

ActionScript 2.0 :: Attaching/controlling External .swfs?

Mar 11, 2003

load/attach and 'control' external .swfs, i.e. loading them into a MC and then applying actions, masking, etc.

View 2 Replies

ActionScript 2.0 :: Controlling Dynamically Loaded Swfs?

Jun 24, 2003

how can you controll them as they are coming in? For example: i want to load three swfs but i want them to sit invisible until the user clicks a button to change visibility and see the content. The problem seems to be that you can't control it until it's all there... here's the code i have been trying.[AS]function

goMovie(xMovie, xLevel){
loadMovieNum(xMovie, xLevel);
mytry=false;

[code]....

View 3 Replies

ActionScript 2.0 :: Controlling External Swfs Loaded Into An MC?

Mar 23, 2005

what actionscript could i use to make an movies loaded into a movieclip play. tried _root.holderMC.play(); holderMC being the movieclip the external swf is loaded into, doesn't seem to work! searched the internet too but no lucky

View 2 Replies

ActionScript 3.0 :: Controlling Slideshow From Withing External SWFs?

Jul 27, 2010

What I have is a SWF file that calls out to 3 different SWF files via the following code:

// Array of external clips to use. Variable index refers to next clip to be displayed.var clips:Array = ["page1.swf", "page2.swf", "page3.swf"];var index:int = 0;
// Stuff to load swf filesvar thisLoader:Loader = new Loader();

[code].......

View 11 Replies

ActionScript 2.0 :: Controlling Order Of Loading External SWFs

Mar 22, 2004

Is it possible without looping to control which of 12 or so external swfs loads first when they all have to load on the same frame of the main movie? For example, we have a main movie which creates classes where the class is itself in an external movie. When we load locally, the movies all load fast enough that the classes are created correctly, however when we move to loading from the server some of the class movies are not loaded into their levels before the main movie tries to create the class with of course the result being the class is not generated and the movies do not function correctly.

View 2 Replies

ActionScript 2.0 :: Controlling And Preloading Separate SWFs On A Website?

Jul 14, 2005

My Website opens, its written in HTML... There is a "Navigation" FLash at the top of the page which opens up HTML documents into the "Main Frame" below.Ok now... When the Website first loads up, In the Main frame of the page I want a flash swf to play as an intro to the website (Its a band website). Once the (intro) Swf ends I want it to tell the Navigation Flash Menu Swf to go ahead and show the buttons so people can navigate.Thats my first problem, or task to solve.2nd... If it is possible to control Swf's from an external one it must be possible to preload them aswell right? So what I want to do, is the site to load up... and all the preloading done from the Navigation Swf to account for both Swfs (Intro and Navigation)

View 2 Replies

ActionScript 2.0 :: Controlling The Order Of Loading External Swfs?

Mar 22, 2004

It could be that using loops is the only way to do what we want, however ever the optimist I'll ask the question anyways.

Is it possible without looping to control which of 12 or so external swfs loads first when they all have to load on the same frame of the main movie?

For example, we have a main movie which creates classes where the class is itself in an external movie. When we load locally, the movies all load fast enough that the classes are created correctly, however when we move to loading from the server some of the class movies are not loaded into their levels before the main movie tries to create the class with of course the result being the class is not generated and the movies do not function correctly.

View 2 Replies

ActionScript 2.0 :: Loading SWFs Into Scenes - Controlling Position On Screen

Dec 4, 2002

I have several buttons, that link to several scenes, containing swf files. Using the loadmovie command I can get these swf's playing on-screen. That's good.

-How can I control where they appear on my document (I'd guess these require some x or y values, but not sure how this is done) as they all appear in the top left-hand corner.
- When I mouse over another button (link to scene/swf) how can I remove the previous swf from the page, then load the new swf -as they all appear in the same spot/all over each other? Is this an unload movie command?

I was hoping to counter this problem by using different scenes (no luck there) and all I really need to do is remove the previously loaded swf, when the new one is loaded.

View 6 Replies

Sound: Set Different Volumes For 2 Or Multiple Sounds?

Jan 19, 2003

Iam searching vor solution so adjust different volumes for multiple sounds. That means:

Sound1 Volume 100
Sound2 Volume 20

I have tried that with the following script:

DayNature = new Sound();
DayNature.attachSound("Day_Nature01");
DayNature.setVolume(100);

[Code].....

View 4 Replies

ActionScript 3.0 :: How To Play Multiple Sounds

Aug 5, 2010

I am making a slide show, for every image i want sound on it. For example if it the "Tiger" in the image, it says "Tiger". I have all the voice in .wav format.
 
Right now my slide show is xml based and in as3, i have made another attribute for voice.
 
Let me know how i can play different sounds for different images.

View 5 Replies

ActionScript 2.0 :: Playing Multiple Sounds From Different MCs?

Sep 3, 2010

Working on a project with multiple sounds (all contained in different MCs) played by different key board events. Most of it works, but when I try to use simultaneous 2 button combinations to call upon a different sound, all 3 sounds play at once. The 3 sounds are as follows: the sound associated with the first button, the sound associated with the second button, and the sound associated with the 2 button combo. I've made several different true/false statements to override different events and states, but they don't affect the playing of the MCs. I've also tried using attachSound but I don't like the results I'm getting from that either.

How can I stop the first 2 sounds from being played, so only the 3rd sound can be heard?

View 2 Replies

ActionScript 2.0 :: Add Multiple Sounds Of Movie?

Nov 11, 2005

im am using this script in my current movie to attach sound using acttion script it also has a stop/start button but i need to now how to add multiple sounds in this way.

[Code]...

View 2 Replies

ActionScript 3.0 :: Preloading The Multiple Sounds?

Jun 11, 2009

In my app, scenes on the stage play based on user interaction, and are accompanied by sound clips that are loaded through a soundLoader class (see below). I can play the correct track from the model, but I can't figure out how to correctly write a loadTracks function that will proload all of the track options for a given scene, and then play the correct one based on what the user clicks without a pause. How would I preload and store those sounds in a way that I can use them when needed?

Code:
package mvc
{
import flash.display.*;
import flash.media.*;
import flash.events.*;

[code]....

View 2 Replies

ActionScript 2.0 :: Adjusting Volumes With Multiple Sounds?

Apr 27, 2009

m using Flash 8. And I'm trying to adjust two sounds files using action script. First I set a sound file to 100, then I tried to set another file to 25 but when that happens, it also sets the first sound file to 25.

How do I adjust the second sound file so that the first one doesn't get changed as well.

By the way, here's the action script I was using for both sound files:

Sound File 1
background = new Sound();
background.attachSound("Kingdom Hearts Theme");
background.setVolume(100);

[Code].....

View 2 Replies

ActionScript 2.0 :: Flash8 : Preloading The Multiple Sounds?

May 14, 2009

I have 10 sound files in an array.I am wanting to preload all of them and update a counter once each one loads sucessfully.So when song 2 for instance finishes loading then the counter would be at 2,then 3,etc....I think maybe I need to use a while loop to hook each sound into a load event?

View 1 Replies

Actionscript 3 :: Playing Multiple Generated Sounds

Sep 6, 2010

Inspired by Andre michelle, I`m building a tone matrix in AS3.I managed to create the matrix and generate the different sounds. They donīt sound that good, but Iīm getting there One big problem I have is when more than one dot is set to play, it sounds just horrible. I googled a lot and found the additive synthesis method but donīt have a clue how to apply it to as3.anybody out there knows how to play multiple sounds together? any hint?

View 2 Replies

Actionscript 3 :: Working With Multiple Sounds & Channels

Nov 17, 2011

Are there any audio management libraries for ActionScript 3? The more tailored they are for game development the better.I'm finding it hard to understand and work with multiple channels, which is making a lot of my audio sound screwy and cancel each other out, etc. I've been working on an RPG that can at a given time have quite a number of sounds playing such as environmental noise (like opening doors, thunder, rain, etc), walking enemies, inventory sounds (for events like dropping an item into your inventory), passive spell-casting sounds, voice clips, weapon swinging etc. Alternatively, if there are any good resources that explain how to use multiple sound channels strategically.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved