Actionscript 3 :: Use An Audio-file - Preload A Sound-file
Jan 21, 2011
I have AS3 project, made with FlashBuilder. I'm using MovieClips from an external .SWC-file. In a MovieClip from the .SWF-file, I want to use an audio-file. Is it possible to preload a sound-file (e.g. .MP3) in my FlashBuilder project, and access it in a MovieClip inside the .SWC?
I it possible to prelowad a sound file with javascript (or gwt) and feed it to a flashplayer without a server roundtrip?I would like to play the sound right after a uses clisks a button on a web site without a delay caused by server roundtrip.
I'm working on an app to stream audio from shoutcast. The streaming goes well on my computer and when debugging it with an Android-configuration. But when I deploy it to an APK-file and run it on a Samsung Galaxy S, the streaming doesn't work.
My code for streaming the audio: var urlRequest:URLRequest = new URLRequest("http://.../;"); var soundContext:SoundLoaderContext = new SoundLoaderContext(2000, true); soundChannel = new SoundChannel(); sound = new Sound(urlRequest, soundContext); soundChannel = sound.play();
I've also tried an addEventListener(Event.COMPLETE), it seems my app doesn't get there when running on a Samsung Galaxy.
Is there a way to make external streaming audio sound file "mp3" loop. my understanding is that streaming audio won't loop, only works for attached sounds...
var my_sound:Sound = new Sound(); my_sound.loadSound("jazz.mp3", true); my_sound.start.(0, 99)
So I'm trying to get sound on my flex application. Then tried to load an swf movie with only audio in it.But when it loads on init(), it loops non-stop.Here's a sample code:
i built and application that load multiple sound files play it in a sequence as the user order them but i wonder is there a way to save this sequence into one mp3 or wav file
I'm building a flash movie for something at work and im loading in some images using an XML file but when i use a preloader it only preloads the XML file (as in just the text inside) and not the images.
This causes the movie to start playing without having the images loaded.Does anyone have any ideas about how i could get it to preload the contents/images being called in the XML file so it doesn't run as soon as the XML file is loaded.
I have to play a sound file and show the progress of the sound file being played. I am using import flash.media.Sound; import flash.media.SoundChannel; But the PROGRESS event gives theprogress of loading of file. I want to know of much of the song has been played and how much more is left.
i am new to actionscript i need to download .mp3 and vedio file form my remote server how to do this give me any example source code for this.when i download .pdf its downloading properly. but not audio.
I'm looking for a (free) flash player that I can embed in my site and use to play a .m4a (.mp4 with AAC audio) file that will be obtained using a URL (i.e. it's not local to the server hosting the web page).I've tried searching on google for one, but either I'm searching wrong or no one has made such a thing. Ideally this would be very simple (small user interface with play button and maybe a progress bar) and it would be easy to have multiple instances of on an html page (can create the player with an <object> tag).
I would like to attach a sound to a .fla file that starts to play when the file is opened. I have created a button and would like to be able to use this button for a visitor to the site to mute the sound. So, I'm trying to accomplish two things, first attach a .wav file, then get the mute button to work.
I have a problem that I have not found a syntax error or logic error to explain. It appears to be an obscure problem related to playing a sound file and graphic positioning in the same file. My next step is to look for any known bugs. I have posted the file at. URL] When the page loads you will see a list of selections. Do not click any of the html Play buttons In the graphic arrow pointing to the right is the play button click it and a default file will start. Click the pause button (which will be green while the selection plays) Then click the play button again. The knob that moves while the song plays, will begin moving from the position it was at the time pause was clicked.
Click the stop button (arrow facing left with vertical line at tip) Choose a selection from the html list by clicking the Play button next to it. Then click the play button in the player display. The title of selection will appear in the title area. repeat the original steps (play, pause, play) This time the knob that moves while song plays, snaps back to the start and moves from start, rather than from the pausedposition.
I wish to make a website with the following loading sequence;
> Preload Intro Movie > Show Intro Movie > Preload Main Website > Show Main Website
In other words, the intro movie preloads then plays, once its finished or the user skips, the main website will then be preloaded and shown.
I know how to make a standard preloader using the getBytesLoaded and getBytesTotal parameters, but Im not sure how it works if you want two preloaders, as obviously the getBytesTotal will be different?
Additionally, I would like to preload an external swf file (buttons.swf, 267kB) when I preload the main website so that everything is nicely ready to use. How can I do this?
I'm new on AS3 and have NO IDEA how to build a preloader. I need a preloader to loads my main file and another preloader to load the external files.. Both are with different preloader layout.But first, i'd like to know how do I preload my main file. The main file has a lot of actionscript codes in one frame;
In my main.fla file I have an animation imported into a MC. I have right clicked this MC and chosen properties than checked Export For AS. I have given it a name of intro.[code]I know that to preload a background image I need to create those functions (onOpen,onProgress,onComplete) but how would I create a preloader for my animation that is inside my main.fla as a MC?
I want just file preload 50% and then it play, 50% remain it will load while playing. But I can't do it, here is my code:
Code: bytes_loaded = Math.round(_root.getBytesLoaded()); bytes_total = Math.round(_root.getBytesTotal()); getPercent = bytes_loaded/bytes_total; bytes_total = bytes_total/2; // it will loop because it turn back to play untill full load
I have an intro page that allows users to enter either a high bandwidth (flash) version of the site or a low bandwidth (html) version of the site. The flash has a preloader but it is still quite long for some to load. I was wondering if it is possible and what the best way to have the swf file load behind the scenes on the intro page so that when the use clicks the high bandwidth enterance the swf is already loaded or mostly loaded.
Problem: An XML configuration file needs to be loaded at runtime and be ready when the application's createChildren() gets called. At the latest, because configuration values are needed to properly initialize child components. Preferably, I would like the configuration loading be complete before the application even gets created. In short, I want to do this: load configuration, then initialize the application using the loaded configuration.
I created a custom preloader to help solve this. But as it turns out, the application's createChildren() method already gets called during preloading, when the configuration is not yet guaranteed to be loaded. That is, before the custom preloader dispatches the COMPLETE event.
In trying to keep file size down for download time... I have a SWF file that I have placed using the "UILoader" component (not sure if this is the correct thing to do)... what I would like to work out is how to make a preloader within my main timeline for this SWF file when it comes in. I hope that makes sense - I am very new to all this and struggling with terminology etc. I figured Actionscript would be what I need - but no clue right now...
I am using swfupload to upload files on a website, the problem that every time the user open the page which contains the upload button, the page loads completely then the flash file start loading from scratch every time the user visit the page with no cache. Is there a way to preload and cache .swf files in my asp.net page?
I want to load an external text file, and display loading percentage in flash,so I could show user how far loading is completed.And the problem is I can see progress in trace window,no progross message displays in the textfield,only when my text is completly loaded,the whole text shows in flash.
I'm having some trouble getting the following code to work - trying to use the new Sound.extract() function to get two seconds of a Sound into a ByteArray, and then create a new bytearray with a WAV header, and then output the file. The resulting 'test.wav' file sounds very wrong although slightly recognisable? I think I may have some of the WAV header settings may be wrong but I'm not quite sure what's the matter and after a long time scratching
I have a long mp3 file hosted on a standard apache server (30 minutes long so far, but I would like it to work with longer sounds too).I'd like to start playback of this audio within at a specified point. When attempting to use Flash Actionscript 3, my basic tests show that ALL the audio from the start to the position I choose is buffered before playback (Sound.bytesLoaded was my friend here). If I start one second in, it takes about 3 seconds to start playback, 30 seconds in, takes about 25 secondsObviously with a really long mp3, like skipping playback to the middle of a 3-hour audiobook, this isn't going to be practical.Here's the ActionScript 3.0 code I'm using:
button.addEventListener(MouseEvent.MOUSE_DOWN, function():void { var s:Sound = new Sound(); var req:URLRequest = new URLRequest("http://example.com/audio.mp3");
It's possible to play a sound file through AS, either by loading it from a folder or import it to flash. It's also possible to play a dynamic tone with flash.media.Sound + writeFloat.
But... is it possible to play a sound file with flash.media.Sound + writeFloat in some way? I want to play a sound file without having to deal with any files except the .swf!