ActionScript 2.0 :: Cycle Through Graphics Array As Each Sound Completes?
Mar 23, 2011
I am trying to create a game that has a sound player.I have created an array of 6 sounds each sound lasting 20 seconds.I can click on the next sound button to cycle through 6 sounds.The idea is that the player must guess what the sound is before the sound completes playing.Once the sound is complete a graphic appear telling the player what the sound is.The player would then click the next sound button, this would cause the current graphic to disappear,when the next sound completes a second graphic will appear.At the moment the sound side of the game is complete.I have create an array similar to the sounds array containing each of the 6 graphics.The code I have allows the first graphic to appear when the first sound completes,and when the next sound button is pressed that graphic disappears. how to display the next 5 graphics as each of the next sounds complete.I have cycled through each of the sounds in the sounds array,I have given each of the graphics a name in the linkage box, although I can only get that first graphic to appear and disappear when it has been dragged into the stage and given the instance name "image1"![code]
View 0 Replies
Similar Posts:
May 3, 2011
I have a soundchannel, and I'm playing a lot of sounds in it, but I need the completion of any sound file within that channel to be followed by a wait of two seconds, then trigger an event. How can I do this?
View 4 Replies
Jun 30, 2007
If I wanted to to cycle through an array that looked like this:Array("Red", "Blue", "orange", "green", "Silver", "Black", "Yellow", "Peach")how would my code look if I wanted to only display three at a time. what would the code look like for a next and a previous button to see the next three and the previous three?
View 3 Replies
Feb 3, 2010
I am trying to cycle through targeted movieclips via an array.The symbols are labeled as such, kali1, kali2, kali3, ...etc.What I wanted to do was to move selected movieclips to a particular frame via an array loop.Here is the code I am using and the output I get:
var col1:Array = [8,16];
for (i=0; i<col1.length ; i++){
kaliscope= "kali"+col1;[code].....
View 3 Replies
Dec 17, 2010
I obviously don't understand arrays very well. I want to cycle through the content of an array by the push of a button. The dynamic text field registers the variable "aar", because when I preview this it displays "item1". When I then hit the button, the variable "i" is increased by 1, the dynamic field with the variable "i" shows this, but the dynamic field with the variable "aar" is not updated to the next array-item. This code is in the first frame, with no stop(); code in the file at all.. Why doesnt this code work?
Code:
aar = new Array();
aar[0]="item1"
aar[1]="item2"
aar[2]="item3"
[code]....
View 2 Replies
Jul 16, 2010
In AS3 you can embed a graphic into a Class variable:
[Embed(source="MenuAssets.swf", symbol="topSquare")]
public var TopMenuItem:Class;
I have hundreds of assets in this one website project I'm doing, so I want to embed assets into an array for quick access.Can I do something like this? Its not compiling so I'm wondering whether its possible.
public var MenuAssets:Array = [
[Embed(source="MenuAssets.swf", symbol="topSquare")],
[Embed(source="MenuAssets.swf", symbol="botSquare")],
[code].....
View 3 Replies
Apr 9, 2005
I was wondering about MC and hey can help to lag a game out. I set up an advanced class system so i don't have to use MC to simulate walls, all i use isthe x,y,width and height. Well anyway since i don't need MC anymore I was wondering if there is a way to attach Graphics instead of MC cause a Graphics file size is relatively small than that of a graphic, I think. If anyone could tell me thats true and show me a way to attach graphics that would be nice. I haven't tried it yet but maybe if I exported the graphic from the library imihgt be able to call its name, but it doesn't have an instance name so im stuck.
View 2 Replies
Oct 8, 2009
i am trying to receive in my function as a parameter either a shape or a sprite and then access their graphics property, but this gives me an error:
Code:
public static function makeRect( obj:DisplayObject, ...
var g:Graphics;
if(obj is Sprite){
[code]...
//1119: Access of possibly undefined property graphics through a reference with static type flash.display:Graphics.
View 1 Replies
May 5, 2009
I coded a dynamic SWF player that loads Movie containing SWFs at random (and that part works fine). But what I dont know how to do, or if it is even possible to do, is to have the next movie SWF load after the first movie SWF is completed playing it's movie all the way through.
I guess what I'm asking is, is there anyway in AS3 to add an Event Listener to the SWF so that is executes the needed function after the movie in the SWF has finished playing??
because I'm not sure how to do this, I have found a workaround by adding a Timer to the functions that actually load (addChild(movie1) the SWFs, the timer counts the exact time it takes the movie in the SWF to finish to then load the nest SWF. The problem with this work around is that if the SWF has a player component and someone actually pauses the movie the Timer will still execute the function in the specified Time given.
"I have not finished the Switch1 & 2 functions so just ignore them"
// Setting variable to act as a random Number//
var Random:Number = Math.random();
// Setting variables for the Timer Class //
var myTimer1:Timer = new Timer(63500, 1);
[Code].....
View 2 Replies
Feb 9, 2011
I want to make a synchronous request to a server. I want the entire program to stop processing anything until the request is complete and the server has responded; what is the proper way of doing this?
View 3 Replies
Apr 24, 2009
I have a button on frame 1 that, when pressed advances to frame 2. On frame 2, there is an animated symbol that starts playing right as you get to the frame. I want this to play once, and then advane to frame 3, but I can't seem to figure out how to do it? Please help, all it does now is loop continuously on frame 2, and I can't figure out how to advance to frame 3.
View 3 Replies
Sep 12, 2009
have built a quiz that uses startdrag & stopdrag where the user drags the right answer (a MovieClip) and drops on the question (a Movieclip). I want to load and addChild an external SWF when they have completed all 6 questions correctly but am not sure how to code a function/listener that identifies when all have been dropped in the right place.I am trying to use an If statement in a function with multiple conditions & an event listener but can't seem to get anything to make sense.Code I used for drag/drop is below x6, each mcquestionx6 drops in different coordinates.
function q1StartDrag(evtDrag:MouseEvent):void
{
mcquestion1.startDrag();
}
[code].....
View 3 Replies
Oct 4, 2010
My external .swf is playing before it's even finished loading from the COMPLETE event. W
I can understand it might work like streaming an mp3 or something... but it's not like anyone can see the first parts of the loading movie while the preloader does its thing. I also want this to be automatic... so I can avoid having the user click to enter or click to start after the preloader is complete. Lastly, the loading .swf has stop() on frame one...
Preloader Code:
Code: Select allintro_mc.mask_mc.scaleY = 0;
var childrensApp:Sprite= new Sprite();
var childrensAppLoader:Loader = new Loader();
[Code].....
View 9 Replies
Feb 3, 2010
I am new to flash, i am trying to make a simple text annimation that has a word fly into the document from off the screen and only play once, not repeat itself.
View 4 Replies
May 27, 2011
I have an external preloader that plays music while the main swf is loading. Everything works fine but it sounds a little abrupt when the music just stops as soon as the swf is loaded. Is there a way to start fading out the music when the progress bar gets to, say, 80%, so that by the time the main swf opens, the music is completely faded out?
View 9 Replies
Sep 30, 2009
I want the part labeled fade to happen after the interval completes. Right now it does it right away.[code]...
View 1 Replies
Mar 30, 2011
I currently have a game that allows the player to Start, Stop and Pause sound clips.
Currently the Start button only becomes active after the Stop button has been pressed.
I would also like is the play buttons to become active as soon as the sounds complete playing. This is the code on frame 1 of the main timeline that creates two sound objects
[Code]....
View 0 Replies
Jul 9, 2009
I just followed Lee Brimelow's 'Preloading in Actionscript 3.0' tut - it was easy to follow and implement. However, when I upload my files to my webserver to test, the .swf that I'm loading begins to play before the preloader completes. Actually, to be precise, the main swf has an audio file in the background that begins before the preloader completes. The stage of the main swf doesn't appear until the preloader completes. Prior to this, I was using a 'scenes' method of preloading, that didn't have this problem, but I kept running into a 1009 error, so thought I'd try a different method...
Here is the actionscript for my preloader:
Code: Select allvar l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest("CelebrateV4RPLY.swf"));
[Code].....
View 4 Replies
Mar 30, 2009
What's the preferred OOP way to run a method of a custom class when you reach a certain frame in a movieclip?
View 1 Replies
Sep 23, 2004
What's the preferred OOP way to run a method of a custom class when you reach a certain frame in a movieclip?
View 1 Replies
Dec 12, 2009
I'm trying to clone / duplicate an object loaded in at runtime via the
--
ldr = new Loader();
var mRequest:URLRequest = new URLRequest(targetFile);
--
technique. The problem I think I'm having, is in understanding what exactly the loader returns and how it can be used. after loading an image and tracing the result after the loader completes like this ...
trace(ldr.content); // - traces [object Bitmap]
I have a fuction I built that returns an arrar of clones / duplicates of a passed bitmap ...
[Code]...
View 2 Replies
Mar 16, 2011
I am loading 5 images using "for loop" and I have created the listener and if the images completes the loading, the function is called. Now, I need is the name of the "image" which is loaded on each five images gets completed.
[Code]...
in the output it is throwing as "[object LoaderInfo]". Now i need is the name of the "Image", inside the thumbnail_load function, that means, which image loading is completed.
View 2 Replies
Nov 28, 2009
when a external swf file gets loaded into main swf file, i need to detect while playing external file reach to end so that i can unload that file and move to another frame on root of main file. I am not getting how to identify external swf play reach to end so that i can unload swf and jump to root specific frame of main swf.
View 1 Replies
Dec 23, 2009
I would like to use an array to play 5 sound files randomly.Here's the code I've got so far! Can anyone tell me what code I'm missing?
var my_sounds:Array = [Sound1, Sound2, Sound3, Sound4, Sound5];
var s1:Sound = new Sound(new URLRequest("GentleSeaOnFlatBeach.wav"));var s2:Sound = new Sound(new URLRequest("SPLASH.wav"));var s3:Sound = new Sound(new
[code]......
View 1 Replies
Nov 22, 2009
i have a menu which is controlled using two buttons, to cycle through the submenus i have an action script: _root.Up.onRelease = function() { prevFrame();};_root.Down.onRelease = function() { nextFrame();};i have this code for 6 different submenu, but when i test it only work works
View 13 Replies
Mar 9, 2011
I have no experience with Object Oriented Programming, so I wonder about the following:
1) Will the code past the .LOAD line (in red) be executed only after the image completes loading?
2) Can I nest several listeners as seeing in my code below?
[Code]...
View 7 Replies
Mar 22, 2009
I have 30 sound clips, each named s1, s2, s3 etc...
i want to create an array so when it enters the frame it will play a random sound from the array.
View 1 Replies
Mar 31, 2009
I've got an application that has several slides. Each slide has a sound file that goes with it. I created a function on the root timeline that plays the audio sound. Each slide loads one after another and works great. However I have next and previous buttons for each slide. Each button makes the sound channel stop. If I press something too quickly the sound in the sound channel isn't overwritten with the new sound.
So basically I want to know how to remove all sounds from the sound channel so I can load a fresh new sound. Because the stop command only stops the soundchannel until the next sound is loaded and then it starts playing the sound again. It seems like the sound channel is an array of sounds and I don't know how to clear the array before pushing a new sound to it.
View 4 Replies
Mar 4, 2010
I'm trying to convert the byteArray of a Sound Object to an array with floats. The Sound Object plays back fine & at full length, but the float Array i get from it is cut off (but sounds correct), so i must be doing something wrong in the conversion:[code]The top two channels are the original Sound Object.The lower two is the float Array Data. I aligned them so you can see that the beginning is cut off and obviously the length is incorrect.
View 1 Replies
Nov 24, 2009
Is there some script or reference to show me how to create an swf with 3 jpg files (I'd like them to fade quickly but calmly between each other and simply cycle around for a web banner.
View 2 Replies