Controlling Sound Objects Across Scenes

Nov 14, 2007

I'm doing a project that I have to use scenes in, I have a sound object that i want to be able to control in all scenes. I set up global variables for the sound object and a boolean to check if the sounds currently playing like this :
PHP Code:
_global.sound1= new Sound();
_global.sound1.attachSound("song");
_global.soundplaying = 0;

In each scene I have two buttons a stop and a play button, Heres my code for play:
PHP Code:
if(!_global.soundplaying){
_global.sound1.start();
_global.soundplaying = 1;
}

And stop:
PHP Code:
_global.stewielaugh.stop();
_global.soundplaying = 0; 
Doesn't seem to work, if I press play in scene one and go to scene 2 and then return to scene one the sound can be played again on top of the already playing sound object.

View 2 Replies


Similar Posts:


ActionScript 2.0 :: FlashMX - Controlling Multiple Sound Objects?

Jan 6, 2004

I am having problems controlling my sound objects. When the user clicks on a mc on the stage a sound (voice over) starts to play. But if she decides to listen to another sound, she can click on another movie clip...Problem is that when the user clicks on the second movie clip the first sound is still playing while sound number two starts playing as well. I would like the second sound object to replace the first...shouldn't this be possible by using the mySound.stop(); before initiating the new sound object.

Here is part of my code:

Movie Clip one:

on (press) {
mySound=new Sound(this)
mySound.attachSound("voice_one")
mySound.start(0,1);

[code]....

View 3 Replies

Make A Movie With Multiple Scenes - Streaming Sound And Scenes Sync

Jul 3, 2009

whenever I set my sound to stream and continue to make a movie with multiple scenes. The audio and video get disgustingly out of sync sometimes even off by 30 seconds. I just started an animation its only 10 seconds long with two scenes and the AV is already off by about 5 seconds. Ive worked around this by avoiding scenes altogether but i really don't want to have another 5000 frame scene. I discovered this problem in Flash MX and Im quite annoyed that it still has't been fixed 3 years later!

View 1 Replies

ActionScript 3.0 :: Controlling Eksternal Swf (Scenes, Frame) From Main Swf?

Jan 8, 2011

Am gonna create an encyclopedia program, consist many of Chapter. I have difficulties about **controlling external swf inside my Main swf**. This is my Main.as in Actionscript 3

Code:
public class utama extends MovieClip {
var loader:Loader;

[code]......

View 1 Replies

Actionscript 3 :: Controlling External Swf(Scenes, Frame) Inside Main Swf?

Jan 8, 2011

Am gonna create an encyclopedia program, consist many of Chapter. I have difficulties about controlling external swf inside my Main swf. This is my Main.as in Actionscript 3

public class utama extends MovieClip {
var loader:Loader;
var urlReq:URLRequest;[code]........

Am using eksternal page as a Chapter, and A Chapter consist of many Pages (it using Scene)
For an example :

Chapter 1 --> Page 1 it will be represented as hal1.swf-->Scene 1
Chapter 1 --> Page 2 it will be represented as hal1.swf-->Scene 2

Now, How to control it, I still didn't get it ??

View 1 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

ActionScript 3.0 :: Same Objects In Different Scenes?

Sep 16, 2011

I have 2 scenes. Scene 1 and Scene 2. When i click on some thing in Scene 1 it adds to the invetory. Then i click and move to Scene 2 but that thing is not in Scene 2. I just want to have that thing in every Scene...

View 5 Replies

Sound At Beginning Of 2 Scenes And Optimizing

Nov 10, 2009

I have created a X-mas card for my company. When the card opens, the 3 circles are buttons to different scenes within Flash. The text in the bottom left is a button to the final scene.

The card can be viewed here: [URL]

1) When I click on the circle button that has the red garland and tree ornaments in it, if you listen close at the very beginning of the scene, a squeek sound plays. I use this squek sound in the hamster wheel movie symbol used in other scenes, but not in this scene. I don't even have the sound in this scene of the Flash project anywhere. I can not figure out where it is coming from.

2) Does anyone have some optimization tips? My project file is huge and a lot of the people we will be sending this out to probably don't have the most up-to-date processers. Should I split each scene into it's own Flash movie that is only loaded when the button for that scene is selected instead of the whole thing loading?

Here is a link to view the .FLA file: [URL]

View 1 Replies

IDE :: Sound Starting And Stopping Across Scenes?

Oct 2, 2007

I've set a music sound to play across three scenes in my movie. However, when the user clicks to enter the fourth scene, I'd like the music to stop. Simple enough.

Here's the problem...the fourth scene contains individual keyframes in the scene where I have separate voice overs for each frame. The user navs forward or backward among the scene's keyframes using arrow buttons for forward and backward. How can I have the voice over stop playing on frame 1 if the user clicks the arrow to go to frame 2 if the frame 1 sound isn't finished playing? Frame 1 plays out until finished, even if the user has clicked to go to frame 2.

Then, on return to the main scene where the general music file played, I'd like it to resume playing upon the user clicking 'return home.'

Incidentally, I set up my sound files to play on a soundtrack timeline.

View 4 Replies

ActionScript 3.0 :: Reference Objects In Multiple Scenes?

Sep 26, 2011

How do you refer to specific named instances of objects (buttons, movie clips, text fields, etc.) in different scenes? I made two scenes with button1 on scene 1 and button2 on scene 2. My code is below. The button2.addEventListener line gives the error "cannot access a property or method of a null object reference." Removing that line removes the error and button1 switches scenes. What's the proper way of referring to button2?

package
{
import flash.events.Event;
import flash.events.MouseEvent;

[code]....

View 2 Replies

ActionScript 3.0 :: Making Sound Play Through All Scenes?

Aug 26, 2010

I have only two days to get this working and handed in. My class did not teach actionscript, the code for keeping sounds playing through multiple scenes was provided for us :

var mySound:Sound = new soundtrack();
mySound.play();

Unfortunately this doesn't seem to work in actionscript 3..... and my entire movie is actionscript three. It won't let me save down or convert it or anything.... and I can't get my stuff into another file without screwing it all up.

View 4 Replies

ActionScript 2.0 :: Sound Control Over Multiple Scenes?

Apr 29, 2002

I currently have a movie, about 12 scenes long. I have a sound control that loops the track I have the user select repeatedly. But because I wanted music to always play unless they manually turned down the volume in my controls I load the music each time the main scene is loaded... This ends all of the other sounds and just restarts the first track in my list.

Here's the code:

For the main frame, inside a movie clip placed on scene 1:

stop ();
stopAllSounds ();
setProperty ("playing1", _visible, "1");
setProperty ("playing2", _visible, "0");

[Code]....

All I want this to do is keep playing the track the user selected, and not have to reset everytime the main scene is loaded...

View 1 Replies

ActionScript 2.0 :: Sound Grabbing And Playing From Next Scenes

Jan 9, 2012

I simply don't understand why now at the end of my project, the last 5 frames are giving me such trouble. I have five scenes. The first scene plays fine. Second scene plays fine until just the end, then it grabs audio from the third, fourth and fifth scenes and starts playing them. Here is the site: [URL] (it is a site for children in Swedish) if you click the 3rd button to the right (3 Delan) you will notice that the sound starts truncating and then starts grabbing and placing into scenes before the next scene.

View 1 Replies

Mute Sound Across All Loaded Movieclips/layers/scenes?

Jan 19, 2010

Situation: I have a project I'm working on where I have buttons which make click sounds on their own, and also take you to other scenes where a sound will immediately play. There are also three movieclips involved, total my base movieclip and two independent ones that load on top of that. Problem: I want to include a Mute button so that you can turn off all sounds, but can't figure out how to do that..As I understand it, stopAllSounds won't work for me, because as soon as someone hits another button, a new sound will play.

View 5 Replies

Play Sound File Across Multiple Scenes / Movies?

Jan 18, 2010

Most of my flash movies have been reasonable sizes, but the one I'm working on now is kind of a beast. It's up against the 16000 frame limit, so I'm looking into ways to chop it up. The problem is that I need a way to keep my background music playing across multiple scenes or movies. Is there a way to start a sound file in one movie, and have it continue when another scene is loaded or when a second movie file is loaded with ActionScript?

View 3 Replies

ActionScript 3.0 :: JPGs Overlayed Over Sound Layer In Series Of Scenes

Oct 27, 2010

I am trying to build a very simple Flash app in CS4. All I want to do is have JPGs overlayed over a sound layer in a series of scenes. I want a basic intro scene that ends w/ a table of contents from where you can click to view any scene. At the end of each scene is a frame where the user can replay the current scene, return to the TOC frame in scene 1 or proced to the next scene. I am having two SERIOUS problems.

1. For some reason my movie is NOT stopping at the "stop ();" action at the end of scene one. the action is on its own keyframe in the timeline, but when I "test movie" it just plays right past that to scene 2.
2. I obviously need multiple buttons on a scene to do different things on click. Does it really have to be as complicated as it seems to have multiple buttons all do different things on click? I keep getting told I have duplicate actions when I have two buttons on a page that do different things on click. I have named each button instance a unique name and written the gotoandplay click event using those unique instance names.

View 1 Replies

Flash :: Dynamically Create New Sound Objects Based On Raw WAV / DATA Or Other Sound Object?

Jan 31, 2012

Is there any AS3 library or code-snippet that can create altered versions of a Sound object on-the-fly (at runtime)? Either based on:

An existing Sound object; A ByteArray object;

For example, say you have a "dry" sound of a gun-shot. You could:

[Code]...

View 1 Replies

Flash - Take Two Sound Objects And Combine Them Into One Sound Object

Nov 15, 2010

Is it possible to take two Sound objects and combine them into one Sound object so that one Sound plays, and then the second plays right after it? I can just play the first Sound and then the next right after it, but it would be much cleaner to combine them before playing the audio.

View 1 Replies

ActionScript 2.0 :: Create Objects Like Sound Objects?

Aug 10, 2004

Why do we need to create objects like Sound Objects, Date Objects and Text Objects before we load them? And what are the advantages of using objects?

[Code].....

View 7 Replies

ActionScript 1/2 :: Controlling Only A Single Sound?

Sep 20, 2009

I used a template from a flash template website but I just realized that the background control was written to control all sounds, now all the video sound and seperate sounds objects stop when I click on this one button. This is the code below that I found on the button. There are others also.
 
[Code].....

View 11 Replies

ActionScript 1/2 :: Controlling Linked Sound From Another Swf?

Mar 10, 2010

I have a child SWF with a linked sound that I want to control from the mother SWF. In the child SWF there are different linked sounds in separat frames. The "Control system" is in the mother SWF.

View 8 Replies

Professional :: Controlling Sound Of An External SWF?

Jan 11, 2011

I'm trynig to control an sound of a external SWF but I can't seem to get it right,here is the code i'm using to import the sound
 
mport flash.media.Sound;import flash.net.URLRequest;import flash.display.Sprite;import flash.media.SoundChannel;import flash.events.Event;import flash.events.MouseEvent;var _som1:Sound;var _channel1:SoundChannel;var _playing1:Boolean = false;var[code]...

View 16 Replies

ActionScript 3.0 :: Controlling Sound Of An External SWF?

Jan 10, 2011

I'm making an application and I can't seem to find a way to control my sound of an external SWF(SWF2) from the main one(SWF1).Here is the code I'm using to control the timeline of external SWF that is placed inside of the main movie

Code:
var loadAnimBox:Loader = new Loader();
var vid_mc:MovieClip;
function startLoading():void {

[code]....

View 2 Replies

ActionScript 2.0 :: Controlling Sound In Loaded SWF

Apr 26, 2004

I have a button on my main scene which creates the varaiable "soundoff", then if one of the placed swf's when loaded detect the variable it stops all sounds,

if(soundoff == true){
stopAllSounds();

This works fine but does not target sounds placed in movieclips in the loaded swf's timeline. I've tried targeting them with the _root. command and using linkage but I can only stop the sound in the main timeline level.

View 2 Replies

ActionScript 2.0 :: Controlling Sound In A Different _level

Apr 8, 2005

I have a loaded SWF file in _level1 that has audio in the timeline. I am trying to control the volume of this loaded SWF with a 'mute' button in the main SWF file. On the first frame I'm using the code:

my_sound = new Sound(_level1);
and then on the button script I have:
mute_btn.onPress = function(){
my_sound.setVolue(0);//mute volume
}

but it's not working. Is the new Sound(_level1) not valid?

View 1 Replies

ActionScript 2.0 :: Controlling Sound From Within A Movieclip

Sep 4, 2005

I am having trouble controlling sound instance on the main timeline from with a movieclip.

On the main timeline contains the following code:
root.createEmptyMovieClip("beat_mc", 100);
beat = new Sound("beat_mc");

[Code]....

The main timeline will render the sound at the volume 10 value. However, I anticipated the volume to be set at a 100 from the Jukebox's controller.

It would seem logical that the jukebox code should respond to the instance "beat", but it doesn't.

View 5 Replies

ActionScript 2.0 :: Round 2 Of Controlling Sound?

Jul 23, 2006

I now changed my movie up to where a "empty movie clip" is created that plays songs on maintime of movie. However, I still want to have a tab where it says "sound controls" be automated so that when users roll over it, it slides in and shows controls for sounds instead of them always being present. This roll over effect is the simple AS:

Code:
soundtab.onRollOver = over;
soundtab.onRollOut = out;

[code].....

View 2 Replies

ActionScript 2.0 :: Controlling Sound From Other Levels?

Apr 27, 2009

I now have my sound clip working in a container swf (level0).. Can I control this sound clip from other levels that have been loaded into level 1 from the container swf?Would it be something like

PHP Code:
_level0.mysound.setVolume(30);

If so, where do I name the music 'mysound'? I have simply dragged the music into the main timeline. Would it be better if I loaded it externally?

View 3 Replies

ActionScript 2.0 :: Controlling MULTI Flv's - No Sound

Apr 22, 2012

On my Main SWF i have a Flv that has no sound

[Code]...

When i play the Main SWF the volume is 0 which is good, But when i click on the button to load the 2nd SWF the sound comes on for both FLV's when i want the 1st FLV to stay at 0 volume and the 2nd FLV to play with sound at 100.

View 1 Replies

ActionScript 2.0 :: Controlling Sound Loops?

Oct 1, 2002

I am trying to create a movie that has 3 different background sound loops for the user to choose from as well as an on/off button.I followed one of the Kirupa tutorials which enabled me to create 3 different buttons that linked to the 3 sound loops in my library. The problem is that I don't know the actionscript required to stop whatever clip is playing and play the newly selected background sound chosen by the user.Also I am trying to have one of the loops playing when the movie starts as a default, and also to have a mute button

View 1 Replies







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