ActionScript 2.0 :: Sound.position Not Resetting
Oct 25, 2005
Just to start off, this isn't exactly an inquiry to a problem. It is moreso of a posting of a bug (or assumed bug) in the Flash player and how to get around it. Though if anyone else has a better method then share. Ok, well I very rarely ever work with the Sound() object in Flash, and I found myself working with it today. I was having a problem and I could not pinpoint it for the life of me.... my code appeared correct in every aspect.
After tracing many sections of my code to find out where it was going wrong I realized... that for some reason when you use Sound.stop(), the Sound.position doesn't get reset... it instead just increments from where it left off. This is quite annoying. And being that Sound.position is a read only property you can't reset it yourself. The only solution I have found for this is to delete or overwrite your Sound() object with a new Sound() object. Anyone know if this is indeed a bug, or if there was some reason Macromedia did it like this?
View 9 Replies
Similar Posts:
Sep 7, 2006
I have a setup where a girl is holding a card on there are words on each card and as time goes by they fall to the ground. The problem I am running into is that the cards never go back into the loop of cards, once they are out I am just left with a blank card. How could I have it reset this?
Code:
//CLASS IMPORTS
import mx.utils.Delegate;
[code].....
View 1 Replies
May 18, 2009
In my main .fla I have a scrollpane which opens an external SWF, inside this external SWF I have 5 frames, each with a 'Next' button at the bottom, the problem is when the user clicks the 'Next' button the the scrollpane doesn't change the position of the scrollbar, so essentially the user is looking at the bottom of the next frame. Is there any way to reset the scrollbar position from either the external SWF (linking to the main SWF), or with some code in the main SWF?
View 3 Replies
Dec 11, 2010
I have a movie clip for each piece of clothing that will be used to attach on the dog. These movie clips click and drag to add clothes onto a target and it automatically resets back to its original position each time you grab a different selection of clothing. All of my objects go the original position except for one. The "julyDress" movie clip automatically pops up to the top of the page and does not reset to the original position.
Below is my code:
stop();
var startJulyXPos:Number = JulyDress.x;
var startJulyYPos:Number = JulyDress.y;
[Code]......
View 1 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
Apr 28, 2003
I am trying to get mp3 sound position and sound length to work. Heres the code below and I ahve attached the FLA.
Code:
// Create a new Sound object.
var music = new Sound();
// Create a text field to show sound length.
[Code]....
I have attached my FLA file. You will need to through a MP3 in the same dir as swf file names test.mp3..
View 1 Replies
Feb 3, 2009
I am trying to call a sound to play whenever the UP key is down. I want the sound to stop and reset to position zero when UP is released. Everything works except the sound will not reset to 0. Here is what isn't working:
if(Key.isDown(Key.UP)){
if(sound.position == 0){
sound.start(0,0);[code]....
When ran, the program plays the sound once, and will never play it again because I can't get the sound.position to reset to 0.
View 1 Replies
Aug 26, 2006
I am using previous/next buttons to navigate through various screens. Each screen has its own voice over track.If I hit the "Next" button in the middle of the track playing, then try to go back, the audio won't play - most likely because the position is still sitting at wherever it was when the sound was stopped.Is there a way I can reset the position? I am assigning the positiong to a variable (mySoundPosition), and have tried stting it to 0 (mySoundPosition=0), but that doesn't seem to help. I know that the position is read-only, so I was hoping that somehow clearing the value of the variable would work.Basically, I just need a way to start the sound over without having to envoke multiple start(); commands because that causes the sounds to essentially play twice, simultaneously, which doubles the volume.
View 13 Replies
Jul 24, 2011
Is there any code in as3 that sets the volume by x&y- coordinates of the mouse?So that my sound is in a MC, and how closer my mouse is at the MC, the louder the volume gets?
View 4 Replies
Jan 10, 2009
I have created a document 600x300 filled with buttons for a rollover effect. I want to be able to play sounds dependant on the x and y position of the mouse without having to use objects that interfere with the buttons.
View 2 Replies
Nov 26, 2009
is there a way in as3 to mute a video inside a movie clip if the mouse x position equals less than, say 200px?
View 1 Replies
Sep 11, 2011
I have the following working great:
stop_btn.setStyle("icon", square_mc);player_btn.setStyle("icon", next_mc);
import flash.events.Eventimport flash.events.MouseEvent;import flash.media.SoundTransform;
var alreadyDefined:Boolean;volumen.value = 1;
[Code].....
I have another slider component on the movie with instance name PROGRESO
I would like for PROGRESOnto indicate (update) the sounds progress as it plays and be able to scrub through the sound.
View 7 Replies
Oct 17, 2006
Basically I have an XML file that contains the paths of a few mp3 files. I have a Play button that plays them and a Next button that plays the next song on the list. These buttons work fine. I actually even am able to obtain and manipulate the songs position using the mySong.position property in order to display the songs position in the form of minutes and seconds.My problem is that when you click Next to go to the next song, the mySong.position property does not reset back to zero, like it should. So if you are 12 seconds into a song and you click NEXT, the next song starts to play fine, but the display keeps counting up from 12 seconds. I realized the .position property is read-only, so I cannot change it. If this is the case, then how does it ever reset, what causes it to reset?
I am loading the songs via the loadSound() method. Which means my only code on the Next button (other than to update some other displays) is:Code:mySound.loadSound("file.mp3", true);I do not need to use mySound.stop() to stop the previous sound, or even mySound.start() to start the new sound playing, it starts automatically. I tried using those commands and got the exact same results, the position property still did not reset.Am i missing something? I sure hope its painfully obvious and I just overlooked something simple cuz im getting a headache
View 9 Replies
May 28, 2008
I have a pause button that pauses a sound playing in a sound channel. It works, but when I resume the sound, it isn't in the correct position, almost like it was rewinded a little.[code]
View 3 Replies
Mar 16, 2010
I`ve run in a bit of a problem. I`m trying to make a web player in AS2. It stores some data from player for later usage in a shared object. One of the things i`d like to store is my current playing position, so player can start of where it was playing after page reloads, but i can`t think of how it should be done..
[Code]...
View 0 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
May 28, 2008
I have a pause button that pauses a sound playing in a soundchannel. It works, but when I resume the sound, it isn't in thecorrect position, almost like it was rewinded a little. I'm usingthe code straight from the
View 1 Replies
Jan 20, 2010
I load a song and when I get the length the song never reach this value.Here is issue document by another guy AS3 - SoundChannel.position never reaches Sound.length.And here is my code
import flash.display.Sprite;
import flash.net.URLRequest;
import flash.media.Sound;[code]....
View 2 Replies
Aug 18, 2010
does anybody maybe know how to track/trace the current position of a sound file while it is playing?So that it is updated every frame or second?I figured something with trace(sound.position) onEnterFrame, but didn't succeed in realizing this yet.
View 1 Replies
Jan 20, 2011
If you wanted to create a client-side Flash-based sound editor that lets you load more than 1 sound to an interface that allows you to manipulate the individual positions of the sounds, and mix/play them in real time, how would you accomplish this?
I'm looking to create a simple version that can mix 2 mp3s, allowing the user to adjust the positions of each. Sort of a dumbed down version of Aviary's Myna audio editor.
At the end of the mixing, I would also like our server to mix the 2 mp3 files with the proper positioning into 1 mp3 file...
View 1 Replies
May 25, 2011
I'm very new to Flash, but I have been learning loads and getting some good results so far. Browsing these forums has been a massive help. However today I have hit a problem in what should be almost the simplest line of code I know how to write (variable = x), and could do with some advice. I have a simple program containing a button which will change a variable when pressed. There is also a text-box that will output that variable. However when I press the button, the variable will change, but then immediately revert to it's previous value.
[Code]...
View 3 Replies
Jan 1, 2011
I made a simple class that's keeping a history of strings, updating it with a push() method (like an array) and with a possibility to navigate with next() and previous().Therefore my class has an array and a integer indication the current position in the array. (See full code below)Now something very strange is going on. When coming into the push() method the position variable has some value, which I can change, but everytime I try to read that variable, it gives me a 0. I've never had this kind of problem before and I simply cant find out what's wrong.The push() method
ActionScript Code:
public function push(entry:String):void [code]......
View 3 Replies
Jan 14, 2010
I have a character on the stage in my fla that when hitting a particle created in an a particle.as removes the particle. I have the code for removing the particle and also a score counter that adds one everytime a particle is removed (located in my particle.as). My problem is the score keeps resetting or I get sporadic results (not sure which) for example here I traced the results[code]...
View 1 Replies
Mar 11, 2004
How do you reset the scrollbar in Flash? (I'm using the component, not a cusom scrollbar.)If you go here, scroll ALL the way to the bottom and then click on "Donations" - you'll see the scrollbar stays in place.How do I get it to refresh each time new text is loaded? I've tried refreshPane() and a few other things, but nothing works.
View 7 Replies
Jul 16, 2003
How do you reset combo-boxes?I have this form with combo-boxes and input textfields, and I want a button that can reset the form.The input textboxes are easy:TextBox1.text = "";
View 5 Replies
Jul 23, 2010
In trying to activate the remainder of the pause button, I find that using MovieClip(loader.content).channel.position always returns 0. I've tried numerous other combinations to access the position of the sound for the play function to resume correctly. The visual part of extswf.swf stops and starts exactly as it should.
In CntlClass:
public var loader:Loader;
public var movie_mc:MovieClip;
public var soundResume:int = 0;[code].........
View 2 Replies
Jan 26, 2009
I have created a menu for an online café. The displayarea is limited, so the menu items need to scroll within a frame ofsome sort.
View 4 Replies
Nov 6, 2009
I've created a application where the viewer could change colours, add text, add logos, rotare them, etc... How do I create a reset button which resets everything to back normal in a specific FRAME? What functions do I have to use?
E.g.
Frame 5 is used to Add colours and text, etc...
Frame 10 is used to Add logos,scale them, rotate them, etc...
I need a reset button in Frame 5 to make only the things which were changed back to normal.
View 1 Replies
Jan 11, 2011
I am trying to move a movieclip down using Actionscript. Then when a user fires a back event [which is successfully firing] the movieclip is then required to go up again. The code is:
trace("fholder _y org: " + folioholdermc._y);
// THIS COMES OUT TO BE -601
var yDown1:Tween = new Tween(folioholdermc, "_y", Bounce.easeOut, -601, -449, 3, true);
trace("step 1 called");
trace("fholder _y down1: " + folioholdermc._y);
[Code] ......
View 3 Replies
Mar 16, 2011
I'm making a simple platform game in Flash CS5 and Actionscript 3.0. When the player loses all their lives, I want it to redirect the player to a "Game over" screen where they can select a "Try again" button to restart the game.
Set everything (player, background, etc) to visible = false
Set "Game over" movie clip to visible = true (it is invisible during gameplay)
Have the button in the "Game over" movie clip hide the movie clip then re-show all the gameplay elements.Reset position of player to start, set score to 0, lives to 3, etc..It's probably not a very good way of doing this but if it works, then I'm happy. I just want the "Game over" screen to show briefly and if the player clicks the "try again" button, they can play from the start.
Now, the problem with my implementation of the above is that when I set all the gameplay elements to visible = true after having them set to false, the game has stopped.. keyboard input doesn't reactivate and the game elements are shown but aren't active. Is there something about the visible attribute I don't know? Does it mess with the "state" of an object? Here's some snippets of code from the Actionscript file...
if(lives >= 0) {
//print number of lives
}[code]..........
View 2 Replies