ActionScript 3.0 :: Flash Sound Complete Function?

Jan 20, 2012

i couldnt attach my demo, its basically two buttons on stage, that play two seperate sound files, they can be turned on and off by a simple boolean.All songs are short sound files (going to be 10 second loops)What i want to know is, is there anyway to not start either of the sounds until the other one has finished its loop, so they are synchronised, so if i start one button off, and then put button 2 on midway through, it actually waits until buttons 1 sound is back at the start of its loop cycle until it starts to play it.If this is possible then i am excited as i am going to make a small little project [code]i have started working my way through the tutorials and already understand so much more about the basic concepts of AS3,

View 4 Replies


Similar Posts:


ActionScript 3.0 :: Flash When Function Complete Do Next?

Mar 18, 2011

My problem is that getTourData(); kicks in too early and I dont want to use a timer 'cus I dont know how long removeAllMyChildren is going to take since it may be large sometimes. Give me a se, which way to go

AS3
Code:
// years down

[code].....

View 2 Replies

ActionScript 3.0 :: Flash Event.COMPLETE Inside A Function?

Jan 20, 2012

I have created a class named XMLclass and inside that class there is a function named returnFillColor.The function looks like this:

Code:
public function returnFillColor(XMLchild:uint):String{
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();

[code]....

When i call this function from my main class, it returns nothing because the XML wasn't done loading. I've double-checked this by adding addEventListener(Event.COMPLETE) outside the function.Is there any way to return data from the xml-file with just one function?(like adding event.Complete to the returnFillColor-function)

View 5 Replies

ActionScript 1/2 :: Go To - When A Sound Is Complete?

Sep 9, 2010

I'm not much of a programmer. I want to call a sound and then have it trace when the sound is complete and go to a specific frame.

View 10 Replies

Flash :: Loaded Object Is Apparently Null After ContentLoaderInfo's Event.complete Function Has Run?

Aug 24, 2011

I am having an issue with a class I'm working on. I currently load an image as a bitmap and store its data into regState:BitmapData so that I may make new instances of that image later on. When I test if I can use the loaded data at a later time with my newBitmapIntance() function, it says that regState is null. I'm lost as to why this is the case, since it works flawlessly to create an instance of itself in my loadContent() function.

Class so far For reference:
package {
import flash.display.MovieClip;

[code].....

View 1 Replies

ActionScript 2.0 :: Go To A Frame When A Sound Is Complete

Sep 9, 2010

I need a simple frame script that will track when a specific audio file is finsihed playing followed by a "go to" command that targets a marker or frame number after the sound is done.

View 7 Replies

Actionscript 3 :: Sound Complete Not Firing ?

Mar 30, 2012

I have a bit of a quandary. I need to call a function inside a MovieClip once a particular sound has finished playing. The sound is played via a sound channel in an external class which I have imported. Playback is working perfectly.Here is the relevent code from my external class, Sonus.

public var SFXPRChannel:SoundChannel = new SoundChannel;
var SFXPRfishbeg:Sound = new sfxpr_fishbeg();
var SFXPRfishmid:Sound = new sfxpr_fishmid();[code]....
osr.Sonus.PlayPrompt(...) and gui.Wait(...)

both work perfectly, as I use them in other contexts in this part of the project without error.Basically, after the sound finishes playing, I need Wait(false); to be called, but the event listener does not appear to be "hearing" the SOUND_COMPLETE event. Did I make a mistake somewhere? For the record, due to my project structure, I cannot call the appropriate Wait(...) function from within Sonus.

View 1 Replies

ActionScript 3.0 :: Signal Function On Complete Of Another Function?

Apr 8, 2011

I'd like to signal a function to run when another function completes.I am filling a scrollPane with some dynamic content and want it to resize once the content has filled in some dynamic text boxes.I'd like to signal a resize function once the function that fills in the scrollPane completes.I tried something like this but it does not seem I can add this sort of listener to a funciton.

scrollPanePopulate.addEventListener(Event.COMPLETE, scrollPaneResize);

I might be missing something obvious or just be headed down the wrong path.

View 5 Replies

ActionScript 3.0 :: Sound Object - Event Complete Does Not Work

Apr 10, 2010

Sound object. Event complete doesn't work
function init() {
this.soundsArray[i-1].addEventListener(Event.COMPLETE, completeSoundHandler);
this.soundsArray[i-1].play();
this.blHit=false;
} function completeSoundHandler():void {
[Code] .....

View 1 Replies

ActionScript 3.0 :: Audio Total Time Before Sound Complete

Oct 19, 2011

I have tried this too but the value keeps on changing as the sound load progresses.

View 3 Replies

CS3 : Call A Function When Another Function Complete?

Dec 7, 2010

Im wondering if i can just call a function when another function complete's.

ex:

function adware(e:MouseEvent): void {
exit.visible = true;
TweenLite.to(powerButton, 1, {x:-300});

[code]....

View 3 Replies

ActionScript 3.0 :: Listening For Function Complete?

Sep 22, 2009

i wanted to use an event listener to call a function when another function as been completed. this is the code i tried: import caurina.transitions.*;

createBox.addEventListener(Event.COMPLETE, createBox2);
function createBox(){
var boxMc:box = new box();
boxMc.width = stage.stageWidth;
boxMc.height = 200;

[Code]...

View 3 Replies

ActionScript 2.0 :: Checking When Function Is Complete?

Sep 12, 2006

Is there a way to add a listener or something to a function so when it's finished it will run another function?

I need to run a function in a class, and when it's completed run a function on the main timeline or elsewhere.

View 1 Replies

ActionScript 3.0 :: Trigger A Function When A Transition Is Complete?

May 21, 2009

I am creating an intro where a sequence of tweens and transitons are triggered. The problem is that I can't figure out how to get an event to happen when a transition is complete. How can I get "headTitleTm" to trigger the "sigIn" function once it is done?

 Code:
function headTitleTransition(event:TweenEvent):void{[code]............

View 4 Replies

ActionScript 2.0 :: Return Function Once LoadClip Is Complete?

May 25, 2007

here's my code:

Code:
function loadPic(whichPic):Void {
var i:Number = 0;
var pic:String;[code].....

What I want to do, is force the function to ONLY return once the file has finished loading. How can I do this??

View 3 Replies

ActionScript 3.0 :: WAV File - New Sound.extract() Function To Get Two Seconds Of A Sound Into A ByteArray

Nov 11, 2009

I'm having some trouble getting the following code to work - trying to use the new Sound.extract() function to get two seconds of a Sound into a ByteArray, and then create a new bytearray with a WAV header, and then output the file. The resulting 'test.wav' file sounds very wrong although slightly recognisable? I think I may have some of the WAV header settings may be wrong but I'm not quite sure what's the matter and after a long time scratching

[Code]...

View 5 Replies

Actionscript 3 :: Return XML Data After Event.Complete Function?

Jul 18, 2010

I am attempting to build a generic XMLLoader class with a static LOAD method, with the intent to use it as follows...

private var _data:XML = XMLLoader.LOAD("path/to/xml_file.xml");

Then I could use it in any client and go-to-town with e4x.

The general problem I am having is with the URLLoader's COMPLETE event, which necessarily calls a different function to set the XML data.This is preventing me from being able to return the XML from the LOAD method, since the data is being set outside that function. Obviously I need to wait for the COMPLETE event in order to make sure the data is available.

I though, perhaps, I could create and return a _waitForData function, which recursively calls itself until the _data is set, then returns the data. But it seems redundant (since Event.COMPLETE is doing that anyway), and the way I tried it generates a stack overflow error.[code]...

View 2 Replies

Actionscript 3 :: Pass A Variable Into An Event.COMPLETE Function?

Feb 6, 2011

I am running a loop to pull thumbs into a containing movieclip from an xml list. What I want to do is have the thumb's parent movieclip fade in after they are done loading, but I can't figure out how to reference the parent once it's loaded.My code(which currently doesn't work the way I want it):

var vsThumb:articleBox;
var currentarticleX:Number = 0;
var articleLinkURL:String;

[code].....

View 2 Replies

Flex :: Loader Event Complete Function Only Being Called Once

Feb 21, 2011

So, I'm trying to load resources, add them to a dictionary, and have a drawing method search through that dictionary and draw based on certain predicates. I have a function that iterates through an Vector of Strings, calling on an instance of Loader to load them instantiated as a URLRequest.

private function loadImages(urls:Vector.<String>):void
{
var loader:Loader = new Loader();

[Code].....

So the issue is: Only the first images in my Vector are drawing. Upon further inspection, I found that the completeHandler was only being called once (I put a trace in the complete handler to check). However, the Loader is invoking load everytime the loop iterates. I tried instantiating separate loaders for each resource, just to see if it would work, but I had no luck with that. Do I need to make separate loaders and event handlers? Or am I just not using Loader correctly?

View 1 Replies

ActionScript 3.0 :: Call Function Scripted On Tween Complete?

Sep 14, 2007

im trying to make an event listener for a when a tween completes, and im not having any luck, any advise

my script

function startmove(event:KeyboardEvent) {
switch (event.keyCode) {
case 17 :
if ((blasts>0) && (blown)) {

[code]....

how can i make it call the removebomb function after the tween is completed?

View 4 Replies

ActionScript 3.0 :: Event Listener To Check That Function Complete?

Mar 3, 2010

I am trying to create an event listener to check that a function has completed before the next action is run. In simple terms I have a module that is opened and closed via two functions... module_open() and module_close().Each function has tween elements that must complete before the next element is processed... i.e the next function, etc.This is the code I have ( have attempted to create an event listener but I seem doing something wrong. I am not even sure that it is possible to create an event listener that checks for a function finishing before calling the next function.

Code:
function onAbout(event:Event):void {
module_close()
module_close.addEventListener(Event.COMPLETE, onClose_Complete);

[code]....

View 7 Replies

Data Integration :: Running Function After XMLConnector.trigger Is Complete?

Oct 4, 2006

I am trying to run some code after the XMLConnector triggerfunction is completely done loading all of the xml data into theflash file and the bindings are updated. Is there an event or somekind of way to pause and run the code after all the radiobuttonsand checkboxes are updated with the xml boolean values?

View 1 Replies

ActionScript 3.0 :: Returning Data From A Function Called Via Event.COMPLETE?

Aug 3, 2010

i am trying to return an XML object, but having issues. The object is only created via an Event.complete function. I need to return the XML created from my loadXML function via my grabXMLfromFile function.

Code:
function grabXMLFromFile(attrPathToXML:String):XML {
var fileUrl:String = attrPathToXML;
var myUrlRequest:URLRequest = new URLRequest(fileUrl);

[Code].....

View 3 Replies

ActionScript 3.0 :: Assign Value To Loader And Retrieve From Event.COMPLETE Function?

Aug 19, 2009

i'm loading in multiple images using the same loader using a for loop. what i'm trying to figure out is how can i tell when the first 4 images are loaded. is there away to attach and index to each loader and then get it from the event in the on complete function? below is the code i'm using:

[Code]...

View 1 Replies

ActionScript 2.0 :: Syntax For Using "listeners" For When Sound Is Complete?

Jul 30, 2009

I've been using AS2 in FL4 for 3 months so I'm fairly new at it. Background info on my file: I am creating a mini comic strip. I am using Cuarina tweeners to have movie clips of (images, main characters and speech bubbles) appear on and off stage. I'm trying to add audio files for each speech bubble that appears.

The audio files are dynamically loaded using onStartParams...with Caurina. The problem I have is that I want to add listeners in action script2 to listen "for when the sound is complete" BEFORE, it moves onto the next function in the code.

[Code]...

View 3 Replies

ActionScript 3.0 :: URLLoader Fires Event.COMPLETE Although Not Complete

Jun 14, 2011

I made a test where I download a file using URLLoader - something like this:

[Code]....

in the middle of the downloading process I physically disconnect the internet connection. the download stalls - but after aproximately 30 seconds downloadSuccessful is invoked, although only half of the data was downloaded. how can I make sure that the data to be downloaded is complete and correct?

View 2 Replies

ActionScript 3.0 :: Complete Event Triggered But Loading Can't Complete

Feb 17, 2011

I am loading in binary files with the url class which can be quite large 10mb + and it works fine on my server but another server I am testing on it can sometimes not work. Sometimes it will not load the file and other times it will only load about 20% and it throw a complete event??? Then of course other times it works fine. This server is https maybe that has something to do this it?

View 0 Replies

ActionScript 2.0 :: Testing A Function Is Complete Or Testing 2 Tweens Have Finished

Feb 2, 2011

I basically need to scale an object up when the user rollsover the button which I have created dynamically already and I need to make sure the object is fully scaled up before I can allow the user to scale it back down again.Ive tried putting 2 tweens (x and yscale) into a function but not sure how to check if the tweens have finished. Im assuming if I check the function is complete it wont take into consideration the tweens may still be running.

View 0 Replies

ActionScript 2.0 :: Make A Graphic Visible When "complete" Cuepoint Is Detected, But Function Doesn't Work?

May 24, 2007

I'm using Flash 8 (in case you need know what version I'm using).There's three flvs I have assigned a cuepoint, "complete". The goal is to make a graphic visible when "complete" cuepoint is detected, but this function seem doesn't work, any feedback on function?:

Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);[code]....

View 1 Replies

Actionscript 3 :: Fade In Sound With The Function?

Jan 9, 2012

I have this problem when I try to fade in sound with the function below. It just doesn't work and I can't figure out where the problem is.I would like to fade in a looping sound but nothing happens.this is used to play a sound via events

dispatchEvent(new CustomEventSound(CustomEventSound.PLAY_SOUND, Main.SOUND_AMBIENT, false, true, false, 999999, 0, 0, setSoundVolume));

this is the function to play a sound. the stop-function is almost identical to this one.

public function playSound(soundName:String, isSoundTrack:Boolean = false, fadeIn:Boolean = false, fadeOut:Boolean = false,
loops:int = 1, offset:Number = 0, volume:Number = 1):void {
if (fadeIn) {
tempSoundTransform.volume = 0;

[code].....

View 1 Replies







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