ActionScript 2.0 :: Can't Seem To Access The Sound Duration Value In Code
Mar 15, 2007
I can't seem to access the sound duration value in my code, I am not sure what I am doing wrong.
Code:
var directory:String = "Voices/";
var noOfSongs:Number = 100;
var aSongs:Array = [];
var currIndex:Number = 0;
[code]....
View 1 Replies
Similar Posts:
Jan 21, 2009
How to access the sound duration outside the onload function....im trying to diaply the duartion of each song in the playlist by loading them one after the other...but am not able to access duartion of all the mp3 files....i want to knw if there is any way to access the sound duration outside the sound.onload function.
View 3 Replies
Jun 19, 2006
I have currently a music player that uses Sound.position and Sound.duration to use as a playlist. However, the sound is streaming, so then Sound.duration is the number of loaded seconds/miliseconds. Is there a way for me to figure out the duration of a sound without fully loading it? Right now, it really messes up the playhead.
View 2 Replies
Feb 18, 2010
I am trying to write an mp3 player. I have tried everything and am suck getting the duration of an mp3.[code]...
View 1 Replies
Nov 25, 2009
I have a mp3 file and I would like to play it from one position and for a certain duration. I have first used the Sound class, the play method where I can specify the start but not the duration. I have looked then at SoundEffect class where you can specify a duration and a startTime. However I do not know how to play it from a AS3 class not from MXML : there is a play method ... but I get no sound!
View 2 Replies
Nov 27, 2009
1. Is there a method of determining the length of a sound file (mp3 primarily); in bytes, elapsed time, before the file is played? (the file could be played against a stop watch and the elapsed time record after the fact, programmatically).
2. Is it possible to set markers and fast forward/rewind to markers corresponding to the file?What I am thinking of is a feature allowing the user to play a file to a point and pause, set a marker, rewind and play to the marker and stop, or fast forward from the beginning and play from the marker, or even play past the marker and rewind to the marker.
Setting a marker would be the easy part: just record the elapsed time when the pause function is called.Getting the sound file to start playing from that point without the previous part played at normal speed;(with volume off) is the essential part of this question.
View 3 Replies
May 5, 2010
I was wondering how I can get the full duration of a sound object.I know "sound.length" returns me the loaded length,but is there a way to get the full length so i don't have to wait until i loaded?
View 2 Replies
Jun 8, 2011
I'm really new about OOP AS3 programming, seems I can't fully understand how the eventcentral class works.For what I've understood this "system" allows classes to communicate between each other, passing parameters and call functions.So, having this ultra simple class:
Code: Select allpackage
{
import flash.events.*;[code].........
I'd like to execute (in the main class) the function "callthis" in the seconda class.
View 2 Replies
Nov 30, 2004
i have a mp3 player that works perfectly offline but once online the sound.duration seems to be incorrect. The sound.duration = 15' online and 52' offline. And it's the same for each mp3 with an incorrect duration. You can see what i mean here : [URL]
View 2 Replies
Aug 4, 2010
I am following this tutorial (Url...) on how to build an audio mixer in Flash. I am trying to display the duration/position of one of the sound objects in the mixer (all sounds in the mixer have the same length). I have tried adding this code to the actions under frame label "ready".[code]I have two dynamic text fields named Text01 and Text02 on the main timeline. Yet, nothing populates.
View 2 Replies
Nov 2, 2003
I'm building a simple audioplayer. In frame 1 I have:
Code:
mySound = new Sound();
songs = new Array("1.mp3", "2.mp3");
songIndex = 0;
mySound.loadSound(this.songs[songIndex], true);
mySound.start();
var playing = true;
[Code] .....
So, the sound begins to play from the beginning. However the problem is with the timer: when 'stop' is pressed it says 0:00. But, when I press play again it immediately jumps to the time it showed when stop was pushed, e.g. 0:12
View 14 Replies
Jul 13, 2010
I've developed a neat WindowSWF panel after watching Lee's demonstration video. I got everything I needed to work, but I'm having trouble getting information from my sound files. Basically I have a list of sound objects (.wav format) in my library and I want to find the duration of each file so that I can add them to existing movie clips, then add or remove frames depending on the length of the sound file on the frame. I've been pouring over the jsfl actions libraries and can't find any method to get the duration of a selected sound file.
View 2 Replies
Apr 3, 2009
is it possible to make the duration of a movieclip equal the duration of the preloader, i mean is it possible to make something like, the time the preloader needs to reach the 100% = the duration of the movieclip? i'm using AS 3.0 and flash CS4 just in case it helps here is my code for the loader:
Code:
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
[code].....
View 1 Replies
Jan 12, 2011
As stupid as my question might sound, i have spent the last 2 weeks reading oop books; but could use some guidance. I have a flash project that is basically a supped up slide show. On the stage i have the following: main_mc (instance name = images_mc) = movieclip which holds "pictures" ui1 (instance name = ui1_mc) = user interface that allows user to draw on picture (when drawing is enabled) ui2 (instance name = ui2_mc) = activates invisible hit areas (buttons) on select pics, when hit area is clicked, we jump to another pic in the main_mc.
I accomplished all of this on the timeline, but am updating the code to OOP. I am having A HELL OF A TIME trying to figure out how to store references to the instances (images_mc etc..), so i can control them from varying class files. I have found it is easy to control the instances from the documentclass, but not from unrelated class files. Example: images_mc.stop(); works in document class; but ovieclip(Parent).images_mc.stop() doesn't seem to work from any class file.(ui2 class file for example);
[Code]...
View 2 Replies
Feb 14, 2009
I want the code for when a sound finishes playing. Example: when I click to make a sniper sound go off, I want it to have a script that wont let you play the sound again until the sound is finished playing.
View 4 Replies
Feb 13, 2010
I'm learning actionscript and would like to add a sound to the code below when a thumbnail is selected. The code is from Adobe Flash CS4Classroom in a book. The flash settings are AS 3.0 and Media Player 9.0
ActionScript Code:
//
thumbnails_tl.addEventListener(Event.CHANGE, thumbnailClicked);
function thumbnailClicked(event:Event):void {
[code]....
View 1 Replies
Apr 5, 2004
Everything except for the resume button on my sound player doesn't work. The stop works fine, but it doesn't seem to start back up again when I press the resume.
[Code]...
View 3 Replies
May 8, 2009
I made a button that starts the song, but when you press on the same button again it starts the song a second time. So now it is playing twice. Could use some help so no many how times the button is pressed the song only plays the first time it was pressed.[code]
View 4 Replies
Mar 7, 2010
I need to know how I can access the images in this XML code (per image):
Code:
<?xml version='1.0' encoding='UTF-8'?>
<component name='XMLSlideShowV3'>[code].....
I just don't know how to access this type of xml code.And I can't change it to something else because I have a component that reads only this type of code.
View 2 Replies
Apr 19, 2010
My audio file is in folder. I want to access form folder. Audio file name is "spin_snd"
View 3 Replies
Nov 18, 2009
Say I recorded and imported sound files of my voice saying "Two", "Four", "Equals", and "Plus"Would it be possible to have Flash on click string together those sound files like a string so that the user would hear:
View 1 Replies
Aug 19, 2010
I need it so the music plays at start and then the button will pause/stop it, and then turn into a play graphic which, when pressed, will play it again. I tried editing the code, but I am horrible at programming and of course nothing I tried worked. Please let me know what I have to change to start with music playing, and then have it stop/pause on first press, and alternate "play" and "stop" on subsequent presses.
[Code]...
View 9 Replies
Jan 22, 2011
I have a set of sound clips to be played one after another in a sequence with couple of time interval inbetween. In my case, its a question - followed by the set of four options.
When I write the below code, all the audop files start together at same time. How can I had time delay inbetween, so that the second clip plays only after the first one is over, and the third one starts playing, only when the second option is over.
[Code]...
View 3 Replies
Aug 19, 2010
this is the one code that I could make work, but I need it so the music plays at start and then the button will pause/stop it, and then turn into a play graphic which, when pressed, will play it again. I tried editing the code, but I am horrible at programming and of course nothing I tried worked. Please let me know what I have to change to start with music playing, and then have it stop/pause on first press, and alternate "play" and "stop" on subsequent presses.
[My fla has 2 layers, one for this AS, and one for the buttons... within the symbol section, I have two layers, one for the button common BG, and two frames in the button layer, one for play (triangle) and one for stop (square). They are saved as a movie clip.]
[Code]...
View 5 Replies
Jan 21, 2009
Is there a mechanism by which native code can be called from within ActionScript?
View 4 Replies
Dec 23, 2011
[code]I am making a soundboard and I need the code to stop previous sounds if I click on a new sound
View 3 Replies
Jul 21, 2008
Can anyone explain me how you access a component code in flash CS3?
View 1 Replies
Jul 28, 2011
I already made some buttons that I was planning on using as a menu for difficulty, easy,medium, hard. The buttons are already made with all the states and graphics, so I wanted to add an event listener so that when you click a button for example easy, if the medium button was at its hit state I would revert it back to up, eg:easyButton.addEventListenere(MouseEvent.CLICK, function(e:event) { mediumButton.gotoAndStop("up") or mediumButton.up
but then I realized there is no propertie or function in the simpleButton class to change the state of the button, I know I can make a movieclip, and do gotoAndStop at the up frame, but is there a way to make it work as a button???
View 7 Replies
Oct 19, 2010
I want to access a clip that I dragged onto the stage , claed it mcBlocker and I am trying to access it from another clip thats in another layer but same frame and the code is inside that second clip: this is the code:
Code:
trace("::"+(this.parent as MovieClip).mcBlocker);
for(var i:int=0;i<this.stage.numChildren;i++){
[code].....
View 5 Replies
Nov 26, 2009
Hi, is there anyway to access the 3d centerpoint property by code? Iīm rotating some movieclips with the rotationY property but they always rotate around their center point... i wanted them to rotate around the edge to create a page-flip effect... but i cannot find the 3dcenterpoint property that itīs on the flash transform menu...
View 1 Replies