Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Actionscript 2.0 & Sound Object & Safari Probs


building an mp3 player and have created a class which creates the visual player and another which controls the sound object (play, stop, fade ins/outs).

However the problem is this:

when i click on a track, it starts streaming fine and after a few seconds it starts playing.

when I click the track again or any different track I get a message in safari's activity panel saying "plug-in canceled" in red! and also the status bars says "There was one error opening the page".

I know that what it should do when I select a different track is continue to download the original track - or am I wrong on that?

How can I stop this happening?

Thanks




KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 02-21-2006, 09:24 PM


View Complete Forum Thread with Replies

Sponsored Links:

Sound Object/XML/URL Problem With Actionscript
Hi I have a flash movie which contains one button called mcChangeTrack (it also has an instance name of mcChangeTrack). This movie includes an external ActionScript file which contains the following code (this is all of the code by the way):


PHP Code:




mcChangeTrack.onRelease=function()
{
    var track1:Sound = new Sound();

        var arrayTrack1:Array = new Array;


    //Create the  XML
    var xmlTracks:XML = new XML();
    xmlTracks.ignoreWhite=true;
    xmlTracks.onLoad = function()
    {
   
        //populate the Array with the url of the mp3 from the xml file
        var nodes:Array = this.firstChild.childNodes;
        for(var i=0;i<nodes.length;i++)
                {
        arrayTrack1.push(nodes[i].attributes.url);
                }
         }
         xmlTracks.load("track1.xml");    
         track1.loadSound(arrayTrack1[0], true);
}







This script is supposed to read the url attribute (track1.mp3) and then load the file into the track1 sound object and begin streaming it when the mcChangeTrack button is clicked. However, I am getting the following error message but I don't know why:

Error opening URL 'file:///C|/flash/undefined'

The 'undefined' is not part of the file path so I have no idea what the problem is.



The xml file (track1.xml) contains the following code:


PHP Code:




<?xml version="1.0" encoding="UTF-8"?>
<tracks>
  <track1 url="track1.mp3"/>
</tracks>






All of the files (including the track1.mp3 file) reside in the same folder.

Any advice would be much appreciated.

Thanks in advance

View Replies !    View Related
Sound Object/URL Problem With Actionscript
Hi I have a flash movie which contains one button called mcChangeTrack (it also has an instance name of mcChangeTrack). This movie includes an external ActionScript file which contains the following code:


Code:

mcChangeTrack.onRelease=function()
{
var track1:Sound = new Sound();

var arrayTrack1:Array = new Array;


//Create the XML
var xmlTracks:XML = new XML();
xmlTracks.ignoreWhite=true;
xmlTracks.onLoad = function()
{

//populate the Array with the url of the mp3 from the xml file
var nodes:Array = this.firstChild.childNodes;
for(var i=0;i<nodes.length;i++)
{
arrayTrack1.push(nodes[i].attributes.url);
}
}
xmlTracks.load("track1.xml");
track1.loadSound(arrayTrack1[0], true);
}



This script is supposed to read the url attribute (track1.mp3) and then load the file into the track1 sound object and begin streaming it when the mcChangeTrack button is clicked. However, I am getting the following error message but I don't know why:

Error opening URL 'file:///C|/flash/undefined'

The 'undefined' is not part of the file path so I have no idea what the problem is.

The xml file (track1.xml) contains the following code:



Code:

<?xml version="1.0" encoding="UTF-8"?>
<tracks>
<track1 url="track1.mp3"/>
</tracks>



All of the files (including the track1.mp3 file) reside in the same folder. I honestly have no idea what the problem is.

Any advice would be much appreciated.

Thanks in advance

View Replies !    View Related
Link Sound Object To Custom Class W/ Actionscript?
anyone know how to script a sound object link to a custom class?

View Replies !    View Related
LoadVars Object Probs
I can't seem to access my variables from my loadVars object?

My text file looks like this
name1=Jason&name2=Nathan&name3=John&

I load in my variables from a text file using this code

on (release) {
myvar=new LoadVars();
myvar.load ("test.txt");
}

then I have a dynamic text field set up with a variable name of

myvar.name1

I've checked and the myvar object contains my data from the txt file but I don't know why I can't get it into my text field?

Help

Thanks
Jason

View Replies !    View Related
Sound Preloading Probs.
I am dynamically loading an mp3.

I have a preloader, that uses a bar to show the progress.

this set of actions starts when the file is loaded, and loops until the file is completely loaded:

_parent.loadbar._xscale = _parent.MyMusicMC.myMusic.getBytesLoaded()/_parent.MyMusicMC.myMusic.getBytesTotal()) * 100;
if(_parent.MyMusicMC.myMusic.getBytesLoaded()/_parent.MyMusicMC.myMusic.getBytesTotal() >= 1){
_parent.MyMusicMC.MyMusic.start();
_parent.jukebox.playstop.gotoAndStop(1);
_parent.loadbar._xscale = 0;
_parent.lbaa.removeMovieClip();
}

The loadbar's size should be linked to the progress of the download. This worked offline, but when I checked it online.. it did not.

So I had it display the values for:
_parent.MyMusicMC.myMusic.getBytesLoaded
and
_parent.MyMusicMC.myMusic.getBytesTotal

Online Total equalled nothing and loaded equalled 0.
Offline they equaled a large number representing the actual data.

Does anyone have any idea what I should do?

Thanks!
Max

View Replies !    View Related
Sound Quality Probs
Okay, I'm making my first cartoon in flash. I'm having an audio problem no matter what editing program I use. So I record my voice in 16-bit, 44100khz and it sounds fine. When I import it into flash (set it to streaming) and test it in the library, it sounds fine...when I play it on the timeline, it sounds fine. BUT, when I actually test my movie, or publish it and play it, the audio gets staticy and hard to understand. Am I doing something wrong? Should I record my voices in a whole new format, like mp3? if i would use mp3, could I still publish my movie on the net?

thanks again, this forum is great.

View Replies !    View Related
Sound.onLoad Probs.....
Having problems with the sound.onLoad event. The following code works locally but when on the server the onLoad event doesn't trigger:-

Code:
function loadSoundClipFromList() {
pTotal = playList.length;
remainder = startBoxes-pTotal;
if (pTotal>0) {
trace("pTotal:"+pTotal);
trace("remainder: "+remainder);
mySound = new Sound();
addSound = playList.shift();
trace(addSound);
mySound.loadSound("songs/"+addSound+".mp3", false);

songList.push(mySound);
mySound.onLoad = testLoaded();
createPreloader(mySound)
}
}
I tried moving the on load event thus (as advised by a post in the
archives)

Code:

function loadSoundClipFromList() {
pTotal = playList.length;
remainder = startBoxes-pTotal;
if (pTotal>0) {
trace("pTotal:"+pTotal);
trace("remainder: "+remainder);
mySound = new Sound();
addSound = playList.shift();
trace(addSound);
mySound.onLoad = testLoaded(); // NEW POSITON
mySound.loadSound("songs/"+addSound+".mp3", false);

songList.push(mySound);
// mySound.onLoad = testLoaded(); // OLD POSITON
createPreloader(mySound)
}
}
This doesn't work at all....what makes it even odder is that it will only trigger locally if it occurs after the array push in the function, I suspect this is an object problem - but all other properties of each unique sound come through fine. I tried creating unique names for each sound ie.

Code:

this["MySound"+i]=new Sound();
i++
But still no joy....

Anyone shed any light on this?

Cheers

MM

View Replies !    View Related
Safari Not Passing Parameters To Flash Object On Page Load
Hey all!

I've a standard page set up with a flash object in the upper right corner. When the page loads, it runs a JS script, which then passes several parameters to the flash object via SetVariable.

In FF and IE, this works perfectly, however, in Safari it doesn't. It seems like Safari tries to activate the script before the actual flash object has been loaded.

If I place the script initiator on the flash objects onLoad (or actually the DIV layer it's in), it kills the functions for all 3 browsers...


Does Safari have problems with passing parameters to flash objects? Because it works sometimes on this particular page.. like 1 out of every 10 tries.

View Replies !    View Related
Object Communication , Methods,events,broadcasters,dispatchers.. My Ever Static Probs
Hello Gary,

I am not completly clear about object coomunication.
Would it be possible for an object from a private class to communicate via methods calling with another object
also to be instantiated from a private class?
Please explain.
Actually, what does the private modifier does regarding classes?
Can I have communication between static classes?
Where can I learn more about object communication in As?
Another thing: why does the Singleton uses the static modifier? Every instance of the SingletonClass will
hold the same for that static holder, but if there is never more than one instance of it why do we need it
to be hold the same for every possible instance.

Also, what could be the use of using the private modifier for a class? What could a private class be used for?
What about a private static class?

please explain and clarify me and us all.

Thanks,
Daniel Alexandre
ps. It would be great if one Guru out there could do a tutorial or/and a video on the subject. The Flash community would thank you!

View Replies !    View Related
Adding Sound To My Movie Probs...
Lo all, I have an intro swf with a sound loop on it. on the last frame of my intro i want my main swf to load but with the music from the first swf continuing. How would i go about this?
cheers
lev

View Replies !    View Related
Dynamic Sound Band: Probs
Hello!

Quite simple... This code I post below should do right this:
-Load some info in an object about the songs
-Asign one song to an sound object
-Start it in 4 loops
-When complete, re-read the nextsong var and play what's inside
-Realing the "current Song" textfields

Could any experienced coder tell me wtf is wrong in my code? TIA


ActionScript Code:
//Banda sonora dinámica
//Las variables de comprobacion se colocarán en _global
//Por default, nextsound es el primer sonido a reprod.
_global.nextsound = 0;
var sNumber;
sNumber = 10;
//Creamos la función que creará la Base de Datos
iData = function () {
    // Creamos el objeto contenedor: un Array
    sData = new Array();
    // Creamos los subcontenedores
    for (i=0; i<sNumber; i++) {
        // Creamos los objetos
        sData[i] = new Object();
        sData[i].sID = new String();
        sData[i].sTitle = new String();
        // Y les damos un valor por defecto
        sData[i].sID = "non";
        sData[i].sTitle = "non";
    }
    // Y comenzamos a crear contenido
    // -----------------------------------------------
    // Canción 0:Página raíz.
    sData[0].sID = "sound1";
    sData[0].sTitle = "Pixware - Theme 1";
    // -----------------------------------------------
    // Canción 1:Página de Portfolio.
    sData[1].sID = "sound2";
    sData[1].STitle = "Pixware - Portfolio Theme";
    // -----------------------------------------------
    // Canción 2: Página de Servicios.
    sData[2].sID = "sound3";
    sData[2].sTitle = "Pixware - Services";
    // -----------------------------------------------
};
//------------------------------------------------------
//Función para actualizar las posiciones de
//los campos de texto
tFieldReplace = function () {
    currSong_txt._x = 318-sTitle._width;
};
//------------------------------------------------------
//Creamos la función que actualizará los campos de texto
sText = function () {
    sTitle.text = sData[sCurrent].sTitle;
};
//------------------------------------------------------
//Creamos el evento de inicialización del sonido
iSounds = function () {
    // Creamos la base de Datos de Sonidos
    iData();
    // Iniciamos el objeto de sonido
    soundBand = new Sound();
    // Asignamos el sonido por default
    sounBand.attachSound(nextsound);
    // Iniciamos el sonido
    soundBand.start(0, 4);
    // Variable de navegación
    sCurrent = nextsound;
    // Creamos el evento onSoundComplete como callback
    soundBand.onSoundComplete = function() {
        // Redefinimos los sonidos y reproducimos
        _root.soundBand.attachSound(nextsound);
        _root.soundBand.start(0, 4);
        // Actualizamos la variable de navegación
        sCurrent = nextsound;
        // Actualizamos el campo de texto
        sText();
        tFieldReplace();
    };
};
iSounds();


Comments are in spanish, sorry... It's my language

View Replies !    View Related
Havin Probs Wit Sound.stop Action
well so here's the action i put to the button

on (release) {
Sound.stop (["loop.mp3"])
{




the reference guide calls the part in the brackets the "idName"

well seeming i dun think you can give sounds instance names i really dunno what else to put other than the actual name of the sound file.

If anyone could shed some light on this i'd appreciate it, thx.

View Replies !    View Related
Actionscript -> Javascript In Chrome/Safari Not Working
Hello,

I've been working on a flash project that is able to issue commands to the browser window via ExternalInterface.call. It is all working perfectly in IE and FF.

However, in Chrome and Safari, i cannot get AS -> JS communication working at all. Besides ExternalInterface.call not being received by JS, I've also tried tests with navigateToURL (which I understand to be the replacement of getURL) such as:

navigateToURL(new URLRequest('javascript:alert("hi there");'), "_self");
navigateToURL(new URLRequest('javascript:function foo(){alert("hi there");}foo();'), "_self");
ExternalInterface.call("function () { alert('hello');}");
ExternalInterface.call("alert", "hello");

all of which which work fine in IE and FF but do not work in Chrome/Safari. I've tried invoking both named and unnamed function via ExternalInterface.call and navigateToURL, all to no avail.

does anyone know the "magic" fix or workaround to get things rolling in Chrome/Safari?

Thanks!

View Replies !    View Related
ExternalInterface Actionscript To Javascript In Safari Not Working
I have done some testing and the method I currently am using works in :

Mac:
Firefox Yes
Safari No

PC:
Firefox Yes
IE Yes

Above are the only browsers I am currently concerned with. I am looking for a solution that works for Safari too. I have been doing research and found a few instances of ExternalInterface actionscript to javascript not working in safari. But I haven't found any solution that works.

Does anyone have a sample the works in all browsers html,javascript,fla, and swf?

I would very much appreciate the help.

Thanks,
Aubrey

View Replies !    View Related
This Actionscript Geturl Javascript Works In Safari, But Not IE Or Opera :(
I just have the following on a frame so that when it passes the frame it sets the css display property of a div from display="none" to "inline". It works in safari, seems to be the way to do it yet in Firefox and Internet explorer it tries to load a new window instead of sending the javascript code to the browser document.... any ideas??

Code:
getURL("javascript:document.getElementById('news0').style. display='inline'");

View Replies !    View Related
.stop() For Sound Object Stopping Embedded Video Sound
I have a problem where the stop funtion for a sound object is stopping the audio in an embedded video. Has anyone ever encountered this? Ihave poured over my code and there is no cross-linked intance names, so I do not have a clue what is happening.

View Replies !    View Related
Stoping And Playing Sound At A Particular Point (using Sound Object)
Hi,

I have a movie in which i have a voice over and some animations which is in sync with the VO. I have a play button and stop button.

I am using the sound object method to play the sound and the animations are in timeline.

I have to stop the movie at any point in time and when i click on play the sound should start from the point where it stopped..But it is not happening.

Please help me..

am having a deadline today..

lamus

View Replies !    View Related
Glitch With Sound.position And External Mp3 Sound Object
Hi,

I am in the midst of build a flash mp3 player and have chosen to load all of my mp3s externally and streaming using this method:

sndAudio.loadSound(track01, true);

The problem I am running into is that when track01 starts playing and I switch to another sound i.e.:

sndAudio.loadSound(track02, true);

the value in sndAudio.position doesn't get reset. This is causing havoc for me in my pause function and my counter as well... I am guessing I have to somehow delete the sound object and repopulate it when I stop a sound or start a different one but I am having trouble figuring this out. Has anyone had any luck with this before? Here is how I am initializing my sound object:

this.createEmptyMovieClip("mcSoundHolder", this.getNextHighestDepth());
var sndAudio:Sound = new Sound(mcSoundHolder);

I am running Flash MX 2004.

Thanks to anyone who can lend a hand,

Cheers,

T-Dawg.

View Replies !    View Related
Stop Sound File Early (using Sound Object)
I know I can use the play() method of the Sound object to offset the beginning of a sound. Ex:

mySound.play(2000) - plays the sound beginning at 2 seconds

Is there a way to get a sound to stop early? For example, if it is a 20-second sound, can I get it to stop at 18 seconds? Thanks!

View Replies !    View Related
How Do I Load External Sound Into A Movieclip Vs. A Sound Object?
I have a sound player movie clip that is designed to play the sound loaded into the parent movie clip. In particular, it uses "_parent.gotoAndPlay(targetFrame);" to start playing the sound. And it works well for statically loaded sounds.

However, how can I use this sound player movie clip with dynamically loaded sounds? The player requires a sound to be loaded into the parent movie clip, but the only way I know of loading an external sound is instantiating a new Sound() object and then using .loadSound(...). But loadSound doesn't load the sound into a movie clip.

So, how do I load an external sound into a movie clip versus a Sound object?

Thanks!

View Replies !    View Related
_global Sound Element/ Shared Object Sound
THIS IS DRIVING ME CRAZY
Im programing a childrens game that teaches music.
Needless to say there are a lot of sounds involved, so natuarrally I only want the sounds to load one time then just be referanced later to be played.
However, this game consists of about 10 different .swf files, that jump back and forth depending on user navigation.
I have tried defining the sounds as _global like so

_global.mysound = new Sound ();
_global.mysound.loadSound("noise.mp3")
playsnd = function(){
_global.mysound.start(0,0)
}
However this will only play in the clip it was defiend in, and I need it to be able to be called from any of the .swfs

I use this code to transpher between movies

unloadMovie(this)
loadMovie("new", this)

I have also tried converting the sound to a Shared:Object but it two only plays in the clip it was defiend in

user_so = SharedObject.getLocal("sndz");
_global.sndz = new Sound(this);
sndz.loadSound("soundz/parry.mp3");
user_so.data.song = _global.sndz;
_global.playsnd = function() {
trace("getting called");
user_so.data.song.start(123, 1);
};
user_so.flush();

OMFG, I have a deadline on Thursday, and I have not been making any progress
PLEAS HELP!!!!!!!!!!

View Replies !    View Related
Synchronsing Sound Using Sound Object Method
before flash 7 you were able to synch the sound to the timeline with and option in the properties window (using the "stream" or "event" setting) - this would ensure any animation would keep up with the soundtrack, and if need be would skip frames.

how can you do this with the new sound object and actionscript??? - is there a method for it? at the moment im creating a new sound object and then use the attachSound method to bring the sound in from the library, but it doesnt automatically synchronise with the graphics on the timeline

anyone any ideas?

cheers

steve

View Replies !    View Related
HELP Sound Object Stop Kills Flv Sound Too
code:
if (!firstTime) {
_root.introMusic = new Sound();
_root.introMusic.attachSound("music");
_root.introMusic.setVolume(50);
_root.introMusic.start(0, 1);
firstTime = true;
}

music_btn.onRelease = function() {
if (!rockNow) {
_root.introMusic.setVolume(0);
this.gotoAndStop(2);
rockNow = true;
} else {
_root.introMusic.setVolume(50);
this.gotoAndStop(1);
rockNow = false;
}
};
stop();


This script for my "music on/off" btn kills ALL audio and not just the sounds object audio. It also pauses FLV playback (I'm using the FLVplayback component). Any insite?

I've tried modifying the above AS not using the "_root." to target the obj and also stop() and start() on the obj instead of just volume control. HELP!!!

Thanks,
1M.

View Replies !    View Related
Load New Sound Into Existing Sound Object
I have an extremely simple AS3 mp3 player that I'm trying to create but the problem I'm running into is that I can't seem to load a new song into my sound object when I switch tracks. Here's the basic code I'm using:


Code:
var sound:Sound = new Sound();
var sControl:SoundChannel = new SoundChannel();
var isPlaying:Boolean = false;

function triggerAudio(id:Number, path:String, type:String):void {
if(isPlaying){
sControl.stop();
sound.close();
isPlaying = false;
} else {
sound.load(new URLRequest(path));
sControl = sound.play();
sControl.addEventListener(Event.SOUND_COMPLETE, completeHandler);
isPlaying = true;
}
}
Right now, playing an initial song works
Stopping a song works
But loading a new song over top of a previously loaded song doesn't.

I'm brand new to AS3, what am I missing?

View Replies !    View Related
Streaming Sound Distorted - Sound Object
I have a streaming sound that is loaded into my flash movie (will end up on CD) that is very distorted, it sounds like someone is slowing down the audio, the voice sounds deep and slow. its kinda funny, but I doubt my boss will think so.

anyone ever run into this before?

View Replies !    View Related
[F8] Recording Sound From A Sound Object To Mp3 Using AS - Brainstorm Here
Hi guys,

Im creating a number of little flash instruments, that I need to be able to record the sounds/songs they create. AFAIK, there is no official way to do this in AS, but I was hoping the more creative scripters around here might be able to help me find a solution?!

The worst case scenario is using the microphone I guess, but i would like to avoid that if at all possible.

Please brainstorm with me here!

Steve

View Replies !    View Related
Streaming Sound Distorted - Sound Object
I have a streaming sound that is loaded into my flash movie (will end up on CD) that is very distorted, it sounds like someone is slowing down the audio, the voice sounds deep and slow. its kinda funny, but I doubt my boss will think so.

anyone ever run into this before?

View Replies !    View Related
Sound Object Attach Sound Or Load
Hi

I am wanting two sounds in my FLA one for movie clip buttons and one for background music.

In the past I have created a sound object and just loaded the file from a location on the server, but I've just seen an aletrnative method thats works very much in the same way but you import the sound files into the library and then export for action script and then attach them to the sound object.

Which is the best method to use? If I bring them into the library do they contribute the FLA size? and if they do is this worse than just loading them?

What are the pros and cons of each method? and which is best to use?

Thanks

Ricky55

View Replies !    View Related
Advance Sound In Sound Object?
Hey all. Check this:

I need to advance a sound to a certain timeframe. For example, go to 120000 (2 minutes). Is there an way of doing so?

Thanks,
Leo

View Replies !    View Related
The Sound Object 'mySound=new Sound();
I had an Idea of using dialogue sound and background loops together on my demo. I wanted to do this using the Sound object using linkage to export all sounds embedded in the same .swf. I also wanted to have two volume sliders. One controlling the volume of the Dialogue, the other controlling the background loops, using the mySound.setVolume(); method.

The problem: everytime I instantiate a new Sound() object it supercedes the old one, even though I give the two objects unique identifiers (names)

Can you only have one sound object playing at a time?

View Replies !    View Related
Loading Sound With Sound Object() 'DAP'
Hello,

i was running a test in trying to preload mp3 dynamically using the loadSound function and notice that if am running DAP which is the download accelerator program the flash file doesnt work and instead DAP tried to download the mp3 file. however on diasbling the DAP it worked.

did any one ever encounter a similar problem? was there a solution

View Replies !    View Related
Sound Object To Tell You When Sound Stops?
I'm having a problem. I'm developing an intro/offline presentation in flash for a client and it has music in the background to go with it. I have imported the sound and attached it to the first frame after the preloader using the sound thing in properties panel. Now how do I know when the sound ends? If i put a frame down a couple 1000 frames i see where it says it ends, but i added a keyframe on a different frame there and put something like "music ends" in a text box, but when i play it the music ends about 30 seconds before that. And the worst part is it ends at different times depending on the computer. I want to display something right when the music ends. Is there some way (probably with sound object) i can do something like this:

[on frame 999]
if(!sound.on){
gotoAndPlay(1000)
}else{
gotoAndPlay(998);

so it keeps testing to see if the sound ends, and when it does it continues to play the rest? I took out moock's Actionscript the Definitive Guide, but all i can find on the sound object is how to control stop and play, not to test if it is playing.

Thanks

View Replies !    View Related
Sound Object - End Of Sound Detection?
Hi all,
is there a possibilty to detect the end of a sound called by a sound object?
i have a few sound objects which i need to play in a raw.
Thanx

View Replies !    View Related
[F8] AS2 Sound Object - Sound Never Plays
Hi there, I'm trying to build a JS sound control class using some simple ActionScript and ExternalInterface.

Problem is that the sound never works when I try to play it. Is there a glaring omission in my code?


PHP Code:




import flash.external.*;
import System.security;

System.security.allowDomain("*");

var sounds = new Object();

function registerSound(url) {
    var s:Sound = new Sound();
    log('URL is: '+url);
    s.loadSound(new URLRequest(url), true);
    sounds[url] = s;
    log(sounds[url]+' registered.');
}

function startSound(url) {
    log("Starting sound: "+url);
    log(sounds[url]);
    s = sounds[url];
    s.start();
    s.onID3 = function() {
        for(var i in s.id3){
            log(i+':'+s.id3[i]);
        }
    }
}

function log(mess) {
    ExternalInterface.call('console.info', 'Flash: '+mess);
}

ExternalInterface.addCallback("startSound", this, startSound);
ExternalInterface.addCallback("registerSound", this, registerSound);







Thanks for the help!

View Replies !    View Related
Looping Sound Using Sound Object...
Hi i have the following AS code:


ActionScript Code:
var song_sound:Sound = new Sound();
song_sound.attachSound("background_music");
btnSoundOn.onRelease = function() {
    song_sound.start();
};
btnSoundOff.onRelease = function() {
    song_sound.stop();
};

At the moment on clicking sound on, it plays the track once, is there a way i can make it loop continuously?

View Replies !    View Related
Sound Object - Specifying Only Certain Sound To Stop
Hi everyone. I'll try to make this as brief as possible. I am creating a flash project which contains video on a few pages. The project also contains background music which loops contiuously.

The goal is to have the background music stop whenever the user is on a page containing video and for the music to play again when the user leaves said page.

The script I created works to stop the music, but it also stops the audio contained within the video and causes the video player (by proxxus) to lock up.

The solution is probably a simple one, but I'm having difficulty figuring it out.
If anybody can see where I've gone wrong, your help would be greatly appreciated. Here's the setup:

Library:
music.wav - linkage = "myMusic01"

Main Timeline:

Code:
//-- create a variable to determine if the current movie contains video
var currMovie:String = "notVideo";
//-- start playing sound object
myMusicMc.myMusic.start(0, 999);
myMusicMc (residing on main timeline)
frame 1

Code:
//-- set up sound object
myMusic=new Sound();
myMusic.attachSound("myMusic01");
frame 2

Code:
//-- check the variable "currMovie"
if (_root.currMovie == "Video") {
_root.myMusicMc.myMusic.stop();
} else {
_root.myMusicMc.myMusic.play();
}
frame 3

Code:
//-- create a loop to continuously check the variable
gotoAndPlay(2);
on the actions layer of the movie clip containing my navigation controls
snippet of the callback used

Code:
videoLink_mc.onRelease = function() {
_parent.prodDetail_mc.gotoAndPlay("video");
_root.currMovie="Video";
}
on all the other buttons currMovie is set to "notVideo"

View Replies !    View Related
Sound Object
Hi everybody!
Can anybody tell me where I can learn about the sound object in Flash??
I already know how to put sound in the "classic" way in flash, but I need something much complex.
I tried with actionscript documentation but I couldn´t understand.
Thank you very much.
Best regards,
Strato

View Replies !    View Related
Sound Object
please help

mix is sound object
mix.start(0,50);
mix plays, 50 loops right?

how does flash know it's done with 50 loops ?
and doesn't play sound again.
there must be a counter in there somewhere.
what is it, how do i get to it.

please, anybody know?

how about this.
mix.start()
sound is playing
is there a boolean test?
true when sound is looping
false after looping done, sound off?

help, i've been looking for 6 hours.

thank you,
^_^

View Replies !    View Related
Sound Object
Is there a way to have sound object load an outside file then so that u can have many sounds but still keep the main movie small? if ther is how? Thx a lot!

Charles <><

View Replies !    View Related
Can Everyone Try This One Concerning Sound Object
Basically I'm bringing in a sound dynamically - I have imported a sound gone to linkage called my sound "adultTune4" clicked Export for ActionScript and Export for first frame

Right on the first frame of the main timeline I have this


function goPlay(){
moviesound = new Sound();
moviesound.attachSound("adultTune4")
moviesound.start(5,0);
}


I then have a button with this(which is simply a call to the function


on (release) {
goPlay();
}


Great this works my tune starts playing 5 seconds into it
however when I simply replace

on (release) with on (keyPress "Enter") (with the arrows around Enter dont show up in this post)


It fails to play my tune at all!!!!!


very frustrated - does anyone know why??? or how to resolve this problem

thanks in advance

View Replies !    View Related
Sound Object
It seems I've seen this posted before, but I couldn't find it. I'm using sound objects, and when I stop one sound, all sounds stop. I don't mean using stopAllSounds(). I mean:

_root.mysound.stop()

Which, I thought should only stop "mysound," but it stops all sounds. Anyone know what's up with this?

It would also be helpful to know if anyone else has sucessfully used the stop() with a sound object and NOT had the background sounds stop (like stopAllSounds). This way I would at least know that what I need to do is possible.

Thanks very much.

View Replies !    View Related
Sound Object
I want to use the sound in my library rainHeavy with the sound object. I have a movie clip called heavyRain to have the sound attached.

What I'm using now is:
RainHeavy = new Sound(heavyRain);
RainHeavy.attachSound("rainHeavy");
RainHeavy.start(1,999);

this doesnt work.

I have read through the help files exstensively and it doesn't help. If you could give me some brand new code, or maybe spot whats wrong with mine... it would be great.

View Replies !    View Related
Sound Object
I want to use the sound object that the user can control the volume of sound they here but I can't figure out how to get the sound to loop when I add it programatically.
Can anyone help?
thanks,
Jeff

View Replies !    View Related
Sound Object With Mac OS X
hi everyone,

i'm using code like this:
mySound.setVolume(0);

to mute streaming sound. ist works fine (as it should). except for mac osx obviuosly because i still can hear the sound there - using either ie or mozilla.
is this a bug and is there another possibility to mute the sound (streaming sound, not event sound)?


thx
eman

View Replies !    View Related
Help With Sound Object Please...
Hello everyone.

I'm working with the sound object and I need to know if it is possible to get the name of the attached sound. For example, if I do this:

firstSound=new Sound();
firstSound.attachSound("firstSound01");

Is there a function that returns "firstSound01"?

You know, something like this:

function returnName(){
return (firstSound.getmyNamePlease);
}

Anyone have any ideas... thanks for everyone's time!

Javier Cerdas
Atlanta, GA

View Replies !    View Related
Sound Object
I've read the MX tutorial about Sound Objects
( http://www.flashkit.com/tutorials/Au...-824/index.php ) a couple times, it's been helpful but I do have a question.

Quote from Page #2:
"For this section of the tutorial, "firstSound" will refer to the name chosen for the instance of the sound object. Similarly, "firstSound01" will refer to the identifying name inserted in the linkage properties of the sound file that will be imported into the Flash library.


firstSound=new Sound();
firstSound.attachSound("firstSound01"); "

Is it possible to attach different sounds to an object at different times, like a function that will reset "firstSound" so I can then attach "firstSound02" to it?

View Replies !    View Related
Sound Object Help
I'm producing some CD-Roms at the moment that have animation running with voice overs and music.
Dumping the sound on the timeline has always worked for me until now. On checking the exe on other machines of a lower spec, and on laptops the s-s-s-sound and m-m-m-usic it a bit stuttery.
I've heard of sound objects but the tutes i've seen so far haven't been very helpful.

Can anyone point me to a really wicked sound objects tutorial please?!

T-T-T-Thanks

View Replies !    View Related
Sound Object
Does a sound object have to follow the same rules for path as a movieClip.

For example if I create a sound object in a movie clip that is itself loaded into a movie (swf) that is itself loaded into a main movie, what should I do?

mySound = new Sound();
_root.mySound = new Sound();

Somehow I cannot turn the sound on and off anymore for the sound object that was peviously working when it was directly in the main movie.

???

View Replies !    View Related
Sound Object
I have three swf.files, namely main, sound file, text file. The main file host the main controls and animation. Depending on user interaction a certain textfile will load into the main movie and subsequently load accompanying sound.swf. I use the Sound object to have better control over the sound, ie. mute sound etc. However I need to be able to calculate when I am at a certain point in the sound file to trigger an specific animation in the main movie. At first I did this from within the text file as I used animated scrolling text at first. The problem was that different processors move the text at different speeds, thus resulting in an impossibility to syncronize the sound to the moving text or animation.

Thus now that I am using static text how would I be able to trigger the animation in the main movie at a certain point during the sound playback.

Hope this makes some sense to someone.

Could realy use some help.

View Replies !    View Related
Sound Object Help....
Hello, I'm a newbie/student. Would anyone know of any tutorials out there that deal with the sound object in particular. The tutorial here on flashkit was helpful, but it didn't answer all of my questions.


I'm trying to create a horizontal scroll bar that will enable the user to scrub through audio much like the ones on any of the media players such as quicktime, media play and real player. However, the question that I have is that the audio clip does not exist on the timeline, but exists in the Sound Object.

I'm not looking for people to tell me how to do this, I'm just looking for a tutorial so I can learn this myself. THanks.

View Replies !    View Related
Sound Object
whats the simplest and best way to with a click of one flash button pause and then start a sound object


any help would be great

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved