ActionScript 2.0 :: Removing Delay On External Sounds

Apr 26, 2011

I am building a small quiz in flash, where the user gets a question and 3 answers, that is both shown in text and read as external sound (mp3). I am calling a function to show and read the next answers when the first answer has been read. The text is shown immidately but the sound takes around 6-7 secs. to load......(and it is only 60 kb) how can I avoid this?

My function looks something like this
function readAnswer(){
my_sound=new Sound();
my_sound.loadSound("answer1.mp3",true);
my_sound.onSoundComplete = function() {
trace("answer finish");
//next answer
_root.readAnswer();
}}

View 1 Replies


Similar Posts:


Flash :: Delay Between Two Sounds?

Jun 3, 2011

ask:i want to create an audio sequence.there are 8 predefined sound-starting-points in the timeline.for each starting-point, the user can select wich sound is played (dropdown menu).when the user made his choice for all the 8 bars.actionscript should gather this information and create a fluid sequence of these 8 sounds.then there will be a "play" button available for the user to start the sequence.the sounds don't have to be synced to a button or so.there is time for actionscript to put the sequence together.problem:when i put two sounds directly one after another in a movieclip, there is no delay between the sounds, which is exactly what i want, but i can not control which sound is played through actionscript.when i use actionscript, there is a delay between the sounds.here is what i tried with as.this is placed in the frame where sound2 should start

if (_global.Sound2 == "Piano" {
var SoundA:Sound = new Sound ();
SoundA.attachSound("Piano.mp3");

[code].....

View 1 Replies

ActionScript 2.0 :: Delay Before Sounds Start Playback?

Jul 29, 2007

I tried either from code like this:

public function onRollOver()
{
_root.dbg.text += this.beepSound + "

[code]......

View 1 Replies

Flex :: Play Multiple Sounds With A Custom Delay?

Dec 9, 2009

I need to realize a multiple-track player. The user can upload multiple tracks and mix (play them together). My problem is to allow the user to define an exact start position of each track to allow a synchronization between them, something like this:

Track 1: start at [x] sec.
Track 2: start at [y] sec.
play/stop

where the user can set the x and y. I've tried to realize it with AS2 (using netstream and setInterval) and AS3 (using netstream or sound and timer). Only if I set the same x and y both tracks are playing simultaneously.

View 1 Replies

ActionScript 3.0 :: Slight Delay In Button Sounds During Sound Stream?

Jan 30, 2009

I have some sounds on buttons:

Code:
var mySound:Sound = new myLibrarySound();
myButton.addEventListener(MouseEvent.CLICK, playSound);
function playSound(e:Event):void

[code]....

... and that works fine. I then have some streaming music:

Code:
var myStream:Sound = new Sound();
myStream.load(new URLRequest("myPath.mp3"));
myStream.play(0);

... and that works fine too. Now, however, the initial button sounds have a slight delay -- I'd estimate about 150-250 ms. It's enough that rollover click noises happen about the time you click, and click noises happen about the time you release, etc. Now, here's the KICKER. It only happens in FIREFOX. CURSE FIREFOX. Seriously. I've been having so many Flash issues in FF3, it just drives me nuts. Firefox and wmode is a pain, Firefox and sound is a pain, Firefox has been crap for Flash development lately.

View 2 Replies

ActionScript 3.0 :: External SWF Sounds Playing Over Each Other?

Aug 26, 2009

Does anyone have any clue on how to unload an external swf with all its sounds?

View 1 Replies

ActionScript 3.0 :: Loading External Sounds?

Jun 30, 2011

I am using this code to load an external mp3 file -

Code:
var snd:Sound=new Sound();
var context:SoundLoaderContext=new SoundLoaderContext();

[code]......

View 1 Replies

ActionScript 2.0 :: Importing Sounds From External SWF?

Dec 2, 2005

but I still somehow cant get it to work! I've spent hours surfing around and trying to fix it but I guess I've reached a dead end. This is how my .fla files are.One contains the sound. The .fla is called Track2.fla.In it, I've imported a .wav file and set the Linkage to export for AS and export in first frame. The identifier is "Track2".

on the first frame of the timeline, I added this code:
trackMusic = new Sound(this);
trackMusic.attachSound("Track2");

[code].....

View 2 Replies

ActionScript 3.0 :: External Swf Sounds Will Not Stop When Unloaded

Jun 23, 2009

Main swf loads an external swf which has a linear voice-over. User can watch/listen the whole 5 minute piece and then main movie carries on OR User can click to go on without viewing/listening to the whole show. Using removeChild, I can kill the visuals, but the voice track still goes on. i added a SoundMixer.stopAll line, and it does kill the current VO clip, but the next one will play in a few seconds. In the external swf, i'm using timers to delay slide advancement while the voice over plays. Seems like I came across some info that says I cannot fully unload like this with timers in my external swf.

Does this sound like a plausible source of the problem? If so, what is the best way to kill/nullify the timers in the external swf?

View 1 Replies

ActionScript 3.0 :: Using A Button To Stop All Sounds From External SWF?

Nov 16, 2009

I did a search here and I am not sure my question was answered exactly, and even if it was, I wouldn't know it. My problem is going above and beyond what the project calls for. So here we go:I have an external swf that I have loading in when you press a "play" button. Now I need to have a button that stops the sound ONLY on the externally loading swf. I assume from what I have Googled to death that this is called "stopping all sounds". I have also come upon a sound mixer dealy-o, but I'm not sure that is what I am trying to do?????I keep reading about SoundMixer.stopAll (); but this looks to mute the sound all together with no use of a button. So I am ASSUMING that there is more code to add to this when it comes to using a button.

So, I would like to know the EXACT code I need to use to get it working...if at all possible. I named my sound button "btn3_btn" and my mute button "btn4_btn" for now. I want a separate button to turn the sound back on once it has been muted.

View 9 Replies

ActionScript 2.0 :: Delay When Loading External Text?

Mar 16, 2004

I'm determined to have my external .txt file load into my dynamic field without ANY DELAY WHATSOEVER.

It seemed like the onLoad method of the LoadVars object would handle this nicely, however it does not work for me.

I placed the following code on the first frame of my movie:

loadText = new LoadVars();
loadText.load("content.txt");
loadText.onLoad = function() {

[Code]....

It displays fine but there's still a delay. I figured the content from my .txt file would be loaded by now (its 2KB in size and has html tags embedded).

How can I properly "preload" my external text?

View 3 Replies

ActionScript 2.0 :: Delay When Loading External Text

Mar 16, 2004

I'm determined to have my external .txt file load into my dynamic field without ANY DELAY WHATSOEVER.

It seemed like the onLoad method of the LoadVars object would handle this nicely, however it does not work for me.

I placed the following code on the first frame of my movie:

loadText = new LoadVars();
loadText.load("content.txt");
loadText.onLoad = function() {
aboutrandi = this.about;
}
stop();

Then further along the timeline, I display content in my dynamic textfield by placing the following code:

my_mc.text = aboutrandi;

It displays fine but there's still a delay. I figured the content from my .txt file would be loaded by now (its 2KB in size and has html tags embedded).

How can I properly "preload" my external text?

View 3 Replies

Actionscript 3 :: Flash - Sound - Embending External Sounds In The Swf?

Apr 29, 2011

that have more than 200 sounds , so I cannot just put the sounds in my libray in flash and then instanciate them as class and play them. Because the sound it will play when I click one object is not always the same.I have this function to play background sound , where enters the name of the song I wanna to be played :

public function startMusicBack(music:String):void{
var musicback:Sound = new Sound();
var bgChannel:SoundChannel;

[code]....

View 1 Replies

ActionScript 2.0 :: Stop All Sounds With XML Template External Link?

Aug 13, 2009

I have one of these XML driven Flash templates and I have several links that open _blank pages, I would like to stop the background music when they are clicked. I know I need a root stop all function and I think I would then define that function in the <link></link> tag in the XML...

View 0 Replies

ActionScript 2.0 :: Loading External Sounds Stored In An Array

Sep 11, 2007

I want to write a function that will load all of my external sounds stored in an array which are just strings of their filenames ie:

var soundList:Array = new Array();
soundList = ["sound1.wav", "sound2.wav", etc];

And create a new array with sound Objects that will have the sounds loaded in them (for later execution). After loading all of the sounds in the soundList array, the function should return or just set a _root value to 'true' ie:

[Code]...

View 1 Replies

ActionScript 3.0 :: Load External Sounds To Be Used For Events In A Game?

Mar 20, 2011

I have a game where sounds are triggered when things happen. These sounds need to be loaded externally so they can be changed. It seems like the sound class is just for loading streaming sound files. Is there a good way to load in these sounds and then have them triggerable and controllable by game events?

View 3 Replies

ActionScript 3.0 :: External Audio X Animation - Sound Delay

Feb 8, 2011

I have a few animations that run on different scenes each time a scene is loaded the external audio should start with it. Well here is the thing the animation always starts before my audio files and each scene gets bugged. I need to create an action that only allows my scene to start with the audio and also starts loading the next audio so it wont be dellayed.

On the first scene I have the following code:
scene 1 frame 1
var autoPlay:Boolean;
if(!autoPlay){
stop();}
scene 1 frame 2 animation starts and audio 1 loads
import flash.media.Sound;
[Code] .....

View 3 Replies

ActionScript 2.0 :: LoadVars OnLoad Delay In External Class File?

Mar 25, 2012

I'm building an external class file that other developers can use to include a set of functions that essentially read and write data to MySQL via PHP.

The idea is that their AS2 script calls a method in my class which uses LoadVars to verify the data passed to it and write it to a database, and then it returns a value back to the AS.

I'm having a problem where the delay in waiting for OnLoad means that the calling AS function gets an undefined value back. i.e.

var returnValue=myClass.myMethod(params);

This (I assume) is setting returnValue instantly, despite the fact that LoadVars can take a little while to work.

What's the recommended/normal way to deal with this? I don't want to have to bring the OnLoad part of the process back into the developer's script, it would be nice to keep it all in the class. is there a way to make the calling script wait for a response?

View 0 Replies

ActionScript 2.0 :: Use With Music Is Affecting All Other Sounds - Button Sounds And Background Sound

Apr 16, 2010

I followed the mp3player tutorial (part 3) from [URL] and got it working fine. Only problem is that the setVolume I'm trying to use with my music is affecting all my other sounds - button sounds and background sound. I'm aware of the createEmptyMovieClip/attachSound approach and got it working on my other sounds. But Lee's tutorial-mp3player is using a slight different technique, and so my normal approach doesn't quite work.

[Code]....

View 7 Replies

ActionScript 3.0 :: Synchronize Sounds Perfectly To Do A Kind Of Audio Mixer Using Different Sounds?

Feb 7, 2011

I want to synchronize sounds perfectly to do a kind of Audio Mixer, using different sounds. [URL] does it perfectly, I've been researching and researching and I just don't know how to do it! How does [URL] synchonize audio so perfectly? you can even change sounds and the new ones will come on time! How do I do that? Is it just Action Script? or something else?

View 1 Replies

ActionScript 3.0 :: Removing External Swf ?

Feb 18, 2009

i have a main .fla file which i shall call projectthing.fla for example purposes, and on one of the frames in projectthing.fla i an nesting a movie clip called "childgalleryholder" which currently resides in my library. within this "mychildgalleryholder" i am... importing?... an external .swf which is located in the same folder as my main projectthing.fla . The .swf that i speak of is called stack_gallery.swf and essentially the same file that im using can be found here. Now then, to pull said .swf into the holder movieclip i mention above i am using this code:

ActionScript Code:
import flash.net.URLRequest;
import flash.display.Loader;[code]....

Now then, this all works fine (well good enough anyway), BUT when it comes to changing frames, no matter what frame i switch to, the holder mc DOES NOT go away, or at least i assume its the holder mc the point is that the imported .swf stays on the screen and renders my project unusable until i close it then reload it and avoid that frame.So i decided to set up a button which uses this code to remove the holder from the stage:

ActionScript Code:
removePhotoSlideShow.addEventListener(MouseEvent.MOUSE_DOWN, onClickremovePhotoSlideShow);
function onClickremovePhotoSlideShow(evt:MouseEvent):void{
    removeChild(mychildgalleryholder);[code]....

It works fine and the thing goes away, BUT it leaves the photos in place for no apparent reason.

View 9 Replies

ActionScript 3.0 :: Removing An External .SWF?

Feb 19, 2009

I have a extremely simple page that I am making... [URL] Upon going to the site you should get the same error that every one gets which is what is bugging me..

ActionScript Code:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at mainbodyflash_fla::MainTimeline/frame2()

Basically, the "Gallery" section has an external SWF being loaded into it. I call it in by putting the following code onto Frame 1 of my actions layer...

ActionScript Code:
var myrequest:URLRequest=new
URLRequest("viewer.swf");
var myloader:Loader=new Loader ();
myloader.load(myrequest);

And I display it in the actually "Galley" stage by using this code on the content layer in the "gallery" frame...

ActionScript Code:
stage.addChild(myloader);

If I just leave it like this it loads fine and I don't get any errors.....but if you click on any of the other tabs the external swf overlaps what is in those parts.... so I tried to just use this code in those frames....

ActionScript Code:
stage.removeChild(myloader);

And it does make it so that it doesn't overlap anymore...but thats when I get that error mentioned above.... so basically I want to know how to remove the external SWF when going to another frame without it overlapping or giving me this error....

View 1 Replies

ActionScript 3.0 :: Removing External Swf?

Mar 27, 2009

I'm trying to use various buttons for navigation on webpage. Having problems removing a swf that would have been added by a loader. The container mc can be removed but the swf added to it just stays. I read other topics on this subject but I don't understand where to put the removal events. If anyone has some typical code snippet....

Code:
// everything down through the imageLoaded() function works as it is suppossed to
addChild(blogNewsMC);

[code].....

View 2 Replies

ActionScript 3.0 :: Adding/removing External SWF?

May 20, 2008

I have a list of buttons that each load an external SWF when pressed. When a button is pressed, the SWF loads into a movieclip on the main timeline, and the list dissappears (so only one is loaded at a time). The main timeline moves to a frame with a back button. When the back button is pressed, I'm trying to remove the loaded SWF and make the menu visible again to load another SWF.This all works, but when I get back to the menu and try to load a new SWF, I get the error:TypeError: Error #1009: Cannot access a property or method of a null object reference.at CrystalBall/PL_LOADING()rystalBall being the first SWF I tried to load. The error fires like, four or five times too. I know it has something to do with the code trying to remove the loader before it loads it again, but I'm not sure how to fix it

Code:
package {
import flash.display.*;

[code].....

View 3 Replies

ActionScript 3.0 :: Removing External SWF When Done Playing?

Oct 10, 2010

So I am loading an external swf clip into my project. When it finished playing, I want to remove it. How do I track when its finished playing?

View 4 Replies

ActionScript 3.0 :: Removing External *.swf From Child?

Jan 2, 2012

I have a main_mc that loads and external xml slideshow on frame 1 via this code:

ActionScript Code:
stop();
import fl.transitions.Tween;
import fl.transitions.easing.*;

[Code].....

View 5 Replies

ActionScript 3.0 :: Checking If An External Swf Is There Then Removing

Feb 12, 2009

I have checked the forums for a solution but I cant seem to find anything that works quite like I need it to. Or maybe I just don't understand?

Code:

function BiographyExternal():void
{
var PageBios:URLRequest = new URLRequest("Biographies.swf");

[Code]....

This works when I want to add a movie clip, but what if I want to try and remove it? I need to check if it exists first right?

Basically in another function I want to check if this file is loaded and if it is, I want to remove it.

View 2 Replies

ActionScript 2.0 :: Create A Delay Via SetTimer, SetInterval Or Delay?

Feb 23, 2009

I want to create a function based (not frame) delay of about 10 seconds to the function at the start of a flash movie, the code only needs to run once.I'm very new to actionscript and have been given links to SetInterval and SetTimer examples but they all seem to be very complex.The function is below. I believe it's possible to add the commandTimer(delay:Number, repeatCount:int = 0) how me to a simple example.

onClipEvent (enterFrame) {
framePos = int(_xmouse / 100 * _parent._totalframes);
if (framePos < 0) {

[code].......

View 4 Replies

ActionScript 3.0 :: External Swfs Not Removing From 2nd Timeline

Feb 25, 2010

Here is what i am doing:maintimeline 1:frame 2 I have loaded 1 external swf  A and 2 textfields.on 2nd timeline (which is on  submenu navbar_mc) i am loading a different external swf and want to remove external swf A and textfields that are showing from the main timeline.[code]...

View 4 Replies

ActionScript 2.0 :: Removing External .swf File Once Youre Done With It?

Nov 9, 2009

I was trying to intergrate two game flash files that I created, by combining them into one file (on one timeline), but was having issues with making my timer stop...As the lesser of two evils (or so I thought) I decided to load one of the games into the other file on a particular button click as an external .swf. This solved the timing issue, but now.I dont know how to get rid of the .swf once im done playing it and ready to move on with the original game.I need some buttoncode (AS2) to remove .swf on button click.

ps. button code to load .swf looks like this...
on (release){
LoadMovieNum("racing_part1_me.swf",2)[code].....

View 1 Replies







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