How to create a simple audio playlist when running?

I know, this question seems simple. But I am new to AS3 and I have not found a satisfactory solution so far.

That's what I'm trying to do: I create a game with spoken phrases. These phrases are loaded dynamically from a XML file that contains the paths to the mp3 files.

This is what is happening currently: all phrases are spoken at the same time.

I want that they be read one after the other - how I get this requirement?

This is my code (Simplified) example:

import com.hydrotik.queueloader.QueueLoader;

import com.hydrotik.queueloader.QueueLoaderEvent;

_oLoader.addEventListener (QueueLoaderEvent.ITEM_COMPLETE, onItemComplete, false, 0, true);

_oLoader.addEventListener (QueueLoaderEvent.QUEUE_COMPLETE, onQueueComplete, false, 0, true);

var currentSoundPlaying:Boolean = false;

function duringGame() {}

playSound ("question1.mp3");

some time passes

playSound ("answer1.mp3");

playSound ("question2.mp3");

}

function playSound(sound:String):void {}

_oLoader.AddItem (sound, null, {title: "MP3"});

If (! currentSoundPlaying) {}

_oLoader.Execute ();

currentSoundPlaying = true;

}

}

function onItemComplete(event:QueueLoaderEvent):void {}

If (event.fileType == QueueLoader.FILE_MP3) {//throws an error that 'FILE_MP3' is unknown}

soundChannel = event.content.play (0);

//}

}

function onQueueComplete(event:QueueLoaderEvent):void {}

currentSoundPlaying = false;

}

At the moment, "answer1.mp3" and "question2.mp3" are played at the same time. How can I change this? It should behave as a queue. Once again: I am completely new to ActionScript 3 and if there is a solution in addition to using this charger 'queue', I will be happy as well.

Thanks in advance for comments, tips or links.

Timo

the sounchannel has a soundcomplete event which executes when a sound finishes the game.  use it to trigger your response.  When the answer full of game, launch your next question, if that's what you want.

Tags: Adobe Animate

Similar Questions

  • How to create a simple poll

    How to create a simple poll and view the number of clicks the radio button above?

    Customer says drupal PSI and it's easy, very difficult to find features here, any suggestions please

    British Colombia, you will need to create a web application and use the liquid and/or Javascript to perform a survey. Nothing out of the box I know.

  • How to create a simple grid as a plan for a pane of glass?

    CS6.

    Sorry if this question sounds stupid, but I'm sure he's actually.

    I want to create a simple square grid that I can color and take my Glazier to quote.

    The overall size of the Group of experts will be 600mm width x 930 mm high. It's actually a wooden panel in an existing entry door.

    The grid lines (where the lead pipe will be) will be as follows:

    Horizontal:

    1 to the top 100mmm

    1 to 100mm from the bottom

    Portrait:

    1 to 100mm from the left

    1 to 100mm from the right

    That's all. Real simple. He should meet with the central panel being about 400mm of width 730 mm in height. This will probably end up as plain glass (white), but with a model obscuring any.

    Once I have the grid I can experiment with different colors for the other 8 squares.

    It would be better if the lead lines are fairly "BOLD", and I guess that a framework outside he went.

    I have really need color more than just basic in places, but if it is possible to apply a sort of brush or filter window, so that it looks more like real stained glass, it would look much better.

    Thanks for reading this :-)

    Fill in the boxes would depend on how they were made and whether they're on a transparent layer.

    Here is a video of the method I used. Let me know if it helps.

  • How to create a context-sensitive help when you move a field/menu drop down message

    Hello

    Anyone know how to create a message dialog box helps to appear when a user hovers over a field, a menu drop-down or a subform?  Rather than create a context-sensitive help. I want to be able to give the user a hint what to do they have their mouse over a part of the form.

    Thank you for your help.

    Best regards.

    You can make the text in the tool tip box in the accessibility to this palette.

  • How to create a simple link in a region?

    How can I create a simple link in a region?

    Thank you
    j

    John,

    Buttons may be a little easier if you do not know how to build a URL of Apex, but it's not really hard...

    Try something like this:

    <a href="f?p=&APP_ID.:2:&APP_SESSION.">Take me to page 2</a>
    

    The only thing you change is the reference to page 2.

    Kind regards
    Dan

    http://danielmcghan.us
    http://sourceforge.NET/projects/tapigen
    http://sourceforge.NET/projects/plrecur

    You can reward this answer by marking as being useful or correct ;-)

    Published by: Dan McGhan on June 18, 2009 10:06

  • How to create a simple program to "prize draw"?

    Hey, I would like to create a simple program to "prize draw".

    who selects at random a name (or number) from a list of names, I wish it were my own custom version. For a programmer, it's probably the easiest thing, but I'm new to programming (Beginner), eve of don't know if I'm in the right subcategory (flash). Is there a tutorial or something somewhere that you think could help me, please?

    Create the list in a table and use mathematical methods to randomly select one of the values in the table.

    var prizeArray = new Array ("name1", "name2");

    var drawnPrize = prizeArray [Math.floor (Math.random () * prizeArray.length)];

    trace (drawnPrize);

    If you are unsure if you should use Flash, then you probably don't want looking for help until find you what you plan to do with your custom design.

  • How to display values of connection/iterator when running?

    Hello:

    I'm trying to debug problems with the links and iterators, with jdev 11.1.2...

    When you look at the EL Expressions for the links, I am presented with many opportunities. I want to display those values to determine what I'm looking for. Currently, I am assigning an EL expression as #{bindings.dept.inputValue} to an af:output text field, but it is a slow, tedious process. Where in the Oracle documentation each link field mentioned?

    Also, is there a faster way to examine the values of different fields in links when running? So I'm looking for something like the browser component except for links and iterators. I can do this with the debugger, or what? If so, how? For example, what is the difference between #{bindings.dept.inputValue} and #{bindings.dept.items}.

    So the question is to know how to create a form or? to examine the values of the bindings/iterators executing?

    Thanks for the help.
    Don

    the el elvauator will get activated only when the debugger see a breakpoint...
    one thing you can do, it's that to set a breakpoint in the pagedef... for the links section or the executable section...
    as mentioned here
    http://blogs.Oracle.com/DavidGiammona/entry/new_features_in_the_adf_debugg

    You can also set the breakpoint in the taskflow... and allow the assessor of el...

  • How can I fix the audio distortion when you make a video call using Windows Live Messenger

    When you make a video call using Windows Live Messenger I get audio distortion. How can I solve this problem

    Hello WayneMarkham,

    The best place to ask your question of Windows Live is inside Windows Live help forums. Experts specialize in all things, Windows Live, and would be delighted to help you with your questions. Please choose a product below to be redirected to the appropriate community:

    Windows Live Mail

    Windows Live Hotmail

    Windows Live Messenger

    Looking for a different product to Windows Live? Visit the home page Windows Live Help for the complete list of Windows Live forums to www.windowslivehelp.com.

  • How to create a simple task difference game

    Hello world. I am new to the Forum and relatively new to flash, so bear with me

    I'm looking to make a very simple point the difference using flash CS3 and actionscript game 2 for a school project.

    As it is, I have 2 images on separate layers on a timeline within the same framework, which has been suspended by using the command "stop". I'm looking to have about 4 differences which, when clicked, will appear at the bottom of the screen.

    The problem is, I am unable to find a way to get the differences recorded down in order the user is, where everyone is registered when the user clicks on it, leaving wide gaps for those who have not been found.

    As only a basic user, I am only with scenes and base calendar controls, and I hope that there is a relatively simple way to do this. However, I am perfectly comfortable with the more complex use of actionscript, after doing a few shows before.

    Thanks in advance,

    Laurence

    Create clips that contain the text or image or whatever you use to show differences.  put these movieclips on stage downstairs where you want them to appear.  assign an instance name to each, and then use actionscript to initialize each movieclip false _visible property.  When you want to display this movieclip (after selecting a user), assign this movieclip true _visible property.

  • 9211 question; and also how to create a simple IP check?

    Hello

    First of all, with the 4 9211 module channels for thermocouple input, I assume that it's OK to connect different types of thermocouple to different channels at the same time? (for example channel 1 - T type, 2 - E-channel type etc). Also why is the sampling rate for that ' sample/s 14' - seems low - but I can apparently run at much higher rates and labview complain?

    Secondly, I would like to implement a simple temperature controller 14 channel FT. I had a quick glance at a few examples, but "PID Control-Multi Channel.vi" (for example) seems only a proportional controller, no full term. Maybe I should just write my own? Can someone point me in the right direction?

    Dave

    Hi Dave,.

    I hope you are well today!

    Yes, you can use different types of thermocouples connected to multichannel 9211 in one job. You can simply create a virtual task for a group of channels to the MAX to be aware of this. 9211 is measured from the channels one after the other by scanning through them (time division multiplexing), rather than take all measures at the same time. This is due to 9211 a single ADC, the cold junction compensation circuit and zero circuit automatic.

    Now, depending on whether you use CJC and/or the zero function automatic or not, the maximum sampling frequency varies slightly. A comparative table can be seen on page 20 in the datasheet of the 9211.

    I suggest the reason why 9211 does not support the higher sampling has been done its designed applications. 9211 is designed for the measurement of the overall temperature of the ground, and it is useless to the temperature of the sample from a point say 20,000 times per second, because in many scenarios the temperature does not change that quickly. Also, following the sampling frequency, noise immunity performance can be increased to the ADC.

    Say if I apply for temperature monitoring, I would normally update my temperature every second reading or every half a second and who should provide an accurate indication of my environment. However, if you are looking to make measurements in extreme environments, alternative DAQ devices/sensor should be considered.

    Hope this helps,

  • New to first... How to still see the audio waveform when dragging a clip?

    I just installed the trial of first Pro CC and trying to familiarize myself with the program. I can't find how to make the audio waveform visible while dragging a clip, so that I can synchronize with other audio waveform. Thank you.

    Hi Avène,

    AFAIK, you can't see the waveform by dragging, but a faster and more accurate way would be not not to drag, but to familiarize themselves with the hotkeys to clips slip and slide

    and use for this task: (you see the waveform by pushing, dragging and dragging)

    These are the default shortcuts:

    PC MAC

    Drag the Clip left selection five images

    ALT + SHIFT +.

    Opt + shift +.

    Drag the Clip left selection an image

    ALT +.

    Opt +.

    Drag the Clip right selection five images

    ALT + SHIFT +.

    Opt + shift +.

    Selection of right slide Clip an image

    ALT +.

    Opt +.

    Slip Clip left selection five images

    CTRL + Alt + Shift + left

    Opt + Cmd + Shift + left

    Slip Clip left selection of an image

    CTRL + Alt + left

    Opt + Cmd + left

    Clip of slip right selection five images

    CTRL + Alt + shift + right

    Opt + Cmd + shift + right

    Selection of Clip of slip on the right a picture

    CTRL + Alt + right

    Opt + Cmd + right

    Move the Clip selection left five images

    ALT + SHIFT + left

    Command + shift + left

    Move the Clip left selection an image

    ALT + left

    Cmd + left

    Move the Clip right selection five images

    ALT + SHIFT + right

    Command + shift + right

    Selection of boost right of an image Clip

    ALT + right

    Cmd + right

    Once you understand these controls, you align clips much faster and easier!

    good resources:

    https://www.video2brain.com/en/lessons/keyboard-shortcut-changes-1

    repositioning, slide, slide starts at about 03:50, but I suggest, you look at all this.

    and:

    Adobe Premiere Pro help. Trimming clips

    .. .hope that helps, otherwise just come back here if you still have questions

    Greetings, felix

  • How to create a simple so that the else statement

    I tried for hours to find out how a simple calculation to display text in a field that is based on what is selected in another drop-down list.  My first time doing so, I'm not sure what I'm doing wrong.  Here's what I have so far:

    get the value of the field doctor

    var doctor = this.getField("Physician").value;

    Display according to chosen doctor number

    if(Physician=1) event.value = 100;

    ElseIf (physician = "2") event.value = 200;

    ElseIf (physician = '3') event.value = 300;

    else event.value = 0;

    You have made the classic mistake of using the wrong operator in if statements. The operator if in JS is 'is' (or ' = '). '=' is the assignment operator.

    In addition, in the first statement, you compare the values of a number and later on a string. You must be more coherent.

    Then use this code:

    // get the value of the Physician field
    var Physician = this.getField("Physician").valueAsString;
    
    // Display Number depending on Physician selected
    if (Physician=="1") event.value = 100;
    else if (Physician == "2") event.value = 200;
    else if (Physician == "3") event.value = 300;
    else event.value = 0;
    

    See your code, however, I don't think that you need an if at all... This code should do the same thing:

    event.value = Number(this.getField("Physician").valueAsString) * 100;
    
  • How to create a simple Menu

    OK, here's my problem. There is a way in Director using a field cast member and create a structure to drop as the typical "File, Edit, life,... etc" that you see in any program. I know that the possibility exists for the Director, but for the life of me, I don't remember. I have used this before and have seen work. He was found in a book of Director - in note in chapter. A ToolTip type operation. The Director help file covers her, but I know its there.

    Does anyone know how this is done? If this isn't the case, I can possibly access to this book and discover. If we don't, I'll post the answer as soon as possible.

    Thanks for any help

    Check the documentation for 'installMenu.

  • How to create a simple calculated measure?

    Hello

    I'm having problems creating a very simple calculated measure within the OBIEE administrator. Let's say I have a dimension 'product' with the 'product price' attribute and a measure "number of sales. I'm trying to define in the layer of "Business Model" of the measure calculated 'total sales. To do this I have defined as as a logical column with the phrase 'product price' * 'number of sales.

    But OBIEE isn't calculating what I expect, this makes a Cartesian product of the products and the grand total of the sales, which makes no sense. To relieve that I tried to define the measure as partners at the product level, then I correct the calculations but sales per product are not added together in a total.

    In any case it seems to be a very simple thing to do, but I was not able to find any documentation about it; 'Help' internal documentation is extremely limited. Is there another source of documentation that I don't know?

    Thanks for your help,
    Chris

    Calculate the physical level itself at the logical level

    I would be more careful with possible calculations on the physical columns since the results are different
    But in this case, it seems a good approach,

    -> chris3110.

    If you want to try with physical columns, you can find detailed instructions in the tutorial (http://download.oracle.com/docs/cd/E10352_01/doc/bi.1013/e10312/repository.htm), Section 4.6.3 OBI 'Create a calculation measure using physical columns'

    It will be useful,

  • Need a simple example how to create a simple DataModel and add it to a ListView

    Hi, I have a problem with the dataModel and ListView.

    I want to have the following, a DataModel that contains just strings and a ListView to display.

    Also a button, whenever I click on it, he must add a string to the DataModel.

    How to do this only in QML?

    The projects are in the ScrollableLists project.

Maybe you are looking for

  • Nine NB100 will not start

    Hello I just bought a Netbook NB100.After unpacking, I tried to turn it on, but it will not start When I put the charger in it gives a rattling sound very rapid for a few seconds and then stops, and also the sign of the battery flashes for 5 seconds

  • Satellite A300 turns on, LAN already disabled

    Hello everyone, this is my first post on this forum. Please forgive me my rather poor English, but I'm not native English. My friend has a laptop A300-14F, and in recent weeks, she has problems with the computer randomly turn off, he (complete stop,

  • Problem with iTunes 12.3.2.35, other titles are visible, but will not play. How can I play? Thank you

    Problem with iTunes 12.3.2.35, other titles are visible, but will not play. How can I play? Thank you

  • Error: dwwin.exe - Application error when executing Fallout2.

    Original title: dwwin.exe - Application error HelloI get this error when you run Fallout2 on my computer (Win XP SP3) dwwin.exe - Application errorX with the exception of the breakpointA breakpoint has been reached.(0 x 80000003) occurred in the loca

  • MAPPED location - several errors!

    MAPPED location - several errors!any guidance would be appreciated, I am not advanced a user so be gentle!I get random errors that are falling in the end a connection mapped to an xp machineThe shared location is sitting on a windows7 machine, machin