I have a Flash based media player loading mp3s at 22.050 khz, and for some reason the length is being reported as a little over twice what it should be. Is there anything I can do, short of dividing the results by 2?
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]
I have two values which are both ints: val1 and val2.
I set a movie clip's width equal to the difference of the two values: mc.width = val1 - val2
After doing this calculation, the width of the object is 149.9 when it should be 150. This happens for other values as well. When I trace(val1 - val2), it returns 150.
What seems to be happening is the width value of my movie clip is not adjusting correctly. My movie clip is composed of a bunch of bitmaps and filters. I didn't think this would be a problem, but when I switched it out for a plain shape, the problem went away.
Is there something funny about bitmaps or filters that would make the width value screw up by .1?
I would like to put an eventListener on an ArrayCollection's length proprety, but I don't know how to go about this.
I want to do this because I only want code to execute when a certain number of things are in a certain ArrayCollection. I want Flex to wait to execute this code over the next object until that length property drops back to an acceptable level. I think I should do this with events instead of a while loop that sits there spouting NOOPs forever (which I don't know how to do either).
I am looking at "length" property in the Adobe AS3.0 language ref as I do not understand it. It says: An integer specifying the number of characters in the specified String object. (I understand this). Because all string indexes are zero-based, the index of the last character for any string x is x. length - 1. (I do not understand the "- 1". I understand that all string indexes are zero-based but I cant put this together with the last character for any string being -1 or whatever it is saying.
normally the sound.length property is only accessibleafter the sound has finished downloading.I have heard there is an algorithm that can determine thesound.length property before an mp3 has finished downloading, or atleast approximate it very closely
I know AS3 can create visualizations using sound waves, But I'm trying to find something that will show the wave length within a mp3. So as it's playing, you'll see when the audio is spiking or dipping.
Code: //load sound public function talk(url:String):void {
[Code]....
Problem is, soundFactory.length will return 0 ! That's because .length needs the entire file to be loaded in order to return the proper value, right ? If i trace it in "completeHandler" function, the right value is being shown but i cannot return the value to use it as a parameter in the "asteapta" function, at least i have no idea how. I guess i need to know the sound length before the file is being loaded.
I am using an array to return data to an application and as the array is filled with data using a loader and the order is important it happens that data in slot n is inserted later than data in slot n+1. How do I know that the array is full as I know the number of elements to be loaded? The length property doesn't work for this. I could go through the array each time I put something in and look if every slot is full but that seems ineffective.
I'm trying to build a play back progress bar for an audio recorded from the users microphone. It works okay but when I play back I can't figure out how long the audio is so I can calculate percent played for animating a progress bar. Most of these snippets can be found in LiveDocs and online examples from bytearray.org. Audio is stored in the bytearray and the sound is played back in a sound channel.
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
I have 3 input textfield. Each textfield has a string pre-loaded into it. When user pressed Tab, the focus should be cycled around textfield 1-3. Now, I'm trying to set the caret index to the last letter of the textfield. What is wrong with the code?
Code: public function myTabKeyDown(event:KeyboardEvent):void {
Let's say I have array foo and a positive integer y, where foo.length > y.I want to remove elements from foo so that foo.length becomes y (or very close to it).Also, I need to preserve the first and last element of foo. The indices of the removed elements must be spaced apart as equally as possible. Foo can be sliced, or it can be used to create a new array.
Example: if foo = [a,b,c,d,e,f,g,1,2,3,4,5] and y = 6, then trimmedfoo could be [a,c,e,g,2,4,5] or maybe [a,c,e,2,4,5], but not [a,c,e,g,2,4] because the last element of foo is missing.
Is there any way to determine if a (anonymous) function has defined the ...(rest) parameter in ActionScript 3? I know there's the function.length property, but it only counts the explicitly defined arguments.
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
I am triggering short sounds dynamically from the library for a game (Specifically Air for Android). When the user clicks a button the sound can take up to 600ms to actually play. I have set it for any silence before the actual sound by calling the sound like so:
[Code]...
All return the same results. I know there are threads here that talk about this but none have offered a real solution that I can find. Is there no way to cache the sound or store it in a buffer?
CS4 was working fine for a few weeks, then yesterday I opened an FLA and got an error pop-up that said "Parameter is Incorrect". The error happened for all FLA files. I could save changes but could not preveiw or publish (same Parameter is Incorrect error as on starting CS4). I even made a blank FLA and it wouldn't work either.
Relized today during more testing that this error only happens any time I open a file that is on my desktop (running XP). Same file moved into another folder (Even desktop ewfolder) works fine.
I'm doing a little flash nav bar and I'm trying to have the buttons link to the correct web pages. My code is extensive and I'd rather not post the whole thing in here so I'll try to be as concise as possible.Basically I'm getting this error:1137: Incorrect number of arguments. Expected no more than 1.Everything was running smooth in my script until I added the URL requests here:[code]Is the syntax incorrect or something? Again, everything was fine up until I added those two at for case 0 and case 1.
I'd been using flash cs4 fine for a few weeks before this happened but in the last few days whenever i save a file i'm working on i can no longer preview it (by preview i mean ctrl + enter) my cursor turns to the symbol to show it's working for a few moments but once i move the mouse this goes back to being my normal cursor. Whenever i try and publish a file i get the error "Parameter is incorrect". Before i save the work the file previews fine and even blank documents that i start and immediately save will not allow me to preview or publish them following the save
I'm running w7 64bit on a quad core with 4gb ram. I've tried uninstalling and reinstalling but this hasn't helped. My flash professional cs4 is also fully updated.I've attached one of my .fla files that to me i can't use properly anymore, it's just a basic animation of squares forming the words 'enemy down' on a black background.
I am using AS3.0.I have created simple forward naviagtion from my homepage to my second screen using the code below and a simple button (click1)
//handle events for buttons... click1.addEventListener(MouseEvent.CLICK, clickSection1); function clickSection1(evtObj:MouseEvent){[code].......
Slightly modified code is used on consequent pages to navigate forward through my site.I have also created a home button that navigates me back to my first screen (called screen2) using the following code...
home_btn.addEventListener(MouseEvent.CLICK, clickhome1); function clickhome1(e:MouseEvent):void {gotoAndStop("screen2") }
However, when I return to the homepage and click forward, instead of taking me to the next page and the next page, it jumps me forward directly to the 5th. screen.
The braces shown below after ...ret):String are incorrectly being highlighted as red I'm using the following syntax definition file for actionscript: [URL] 2 Questions: Does anyone happen to know off-hand what causes this weird matching? Is there anyway of identifying the current syntax matching group under the cursor?