ActionScript 2.0 :: Sound.onLoad + OnError
Dec 23, 2004
i'm making somekind of music / video player in flashmx2004. it plays streaming mp3 en flv files. random people can put a link into the players database. of course there will be some that insert a dead link, now i want to check with actionscript (1.0) if the link is dead and if so, the player automaticly will skip this track.this is what i've got allready to load te streaming sound:
_root.playSound = new Sound();
_root.playSound.loadSound(trackurl,true)
trackurl is the link to the file. link to the player atm: [url]
View 1 Replies
Similar Posts:
Dec 23, 2004
i'm making somekind of music / video player in flashmx2004. it plays streaming mp3 en flv files. random people can put a link into the players database. ofcourse there will be some that insert a dead link, now i want to check with actionscript (1.0) if the link is dead and if so, the player automaticly will skip this track. this is what i've got allready to load te streaming sound:
[Code]...
View 1 Replies
Jan 14, 2010
I want to load a function/sound to play ONLY on the first load.eg/I have four pages, one page has a sound that loads every time I click back to that page. Is there a way to make it only load the first time that page is loaded?
View 5 Replies
Sep 11, 2007
So I'm trying to call a function from the onLoad method of my sound object and something is wrong with my scope.
see my example...
Code:
class com.infect.SoundController{
private var soundObject:Sound
private var soundMC:MovieClip
[Code].....
View 2 Replies
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 28, 2004
have read the brilliant OOP for actionscript 1 tutorial from cover to cover and it has me enormouslyMy problem is with a class i wrote called frameSound which extends the Sound object. Well that was the plan but.. it doesn't seem to react to the onLoad event. Here's the code:
Code:
//custom frameSound class constructor.
frameSound = function(){
[code].....
View 4 Replies
Jun 28, 2004
My problem is with a class i wrote called frameSound which extends the Sound object. Well that was the plan but.. it doesn't seem to react to the onLoad event. Here's the code:
Code:
//custom frameSound class constructor.
frameSound = function(){
frameSound.count++;
[Code].....
View 4 Replies
Jul 22, 2010
I am looking to change the URL of a clip when the stream is not found. I am properly configuring the onError event, as I can debug the specific line or add an alert, but what I am having trouble with is the following:
onError : function(errorCode, errorMessage) {
this.getClip(0).update( { url : 'http://full-url.com/images/stream-not-found.png' } );
}
The problem is this image is never being loaded to the player upon the error -- I get a stream not found error message and then the player continues to look for this 'unfound' stream. I'm able to hit the URL and see the image, but am unable to change over upon stream not found. Per the documentation it is supposed to be able to take an image as the URL, but using a fully qualified or relative URL doesn't seem to be working. This is somewhat simplified as we are looking to use customized images for each error code.
View 1 Replies
Jan 1, 2009
My first attempt involved using LoadVars and "load", and only calling loadMovie if the file successfully loaded (found the technique somewhere out here). However, I found that the ProcessRequest function in the HttpHandler was getting called twice when the file does exist. Makes sense - once for load, once for loadMovie.Now I'm using MovieClipLoader instead (also found this technique out here). This way does call ProcessRequest only once whether or not the file is found. But my problem is that the onLoadError function is only working when I give it a bad URL. If I give it a good URL that passes a bad filename to the handler, the handler throws an error, but my onLoadError function doesn't seem to recognize that there's a problem - I just get a blank area where the error message should be showing up.Here's the relevant AS2 code:
function CheckFileExists(inFile) {
var mclListener:Object = new Object();
mclListener.onLoadError = function(target_mc:MovieClip, err:String){
[code].....
View 1 Replies
Aug 20, 2011
before i begin, i should mention my actionscript skills are about a 5/10. that being said, if you point me in the right direction, i should be able to figure it out.
is there a way of capturing actionscript errors in a window.onerror like fashion?
i already have an amf based logging system setup, both the sending and recieving end are working 100%. so getting the message to the server is taken care of. just need to know if its possible to capture the errors.
i would like to capture any and all actionscript errors, and log them so i can debug them if need be.
View 1 Replies
Nov 20, 2006
I am writting an image gallery that loads one intial xml file named galleries.xml.From this point each xml node loads a XMl file for that gallery that holds all the images.The problem arises in the fact that to do this I need a onload function within an onload function.Onload functions dont accept parameters so I can pass down the variable that shows what loop the gallery loop is on as I need that in the function that holds the images.
View 4 Replies
Apr 16, 2011
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?
View 1 Replies
Oct 28, 2009
I am loading an XML file and when I run a trace inside the onLoad event the results show.When I put the same trace outside that event, the trace returns undefined because it runs before the XML is Loaded.I don't know how to assign the results of the XML to a variable being used outside the XML unless I call that through another event.For example. I want to preload some images if the user has been to the movie before. I call XML which has the image array. But I can't tap into that array because my function is outside the XML Load event and my function is not tied to an event.
View 2 Replies
Mar 25, 2005
look at this code, what's wrong?
_parent.unit['bullet'+openbullet].onLoad = bulletload;
function bulletload() {
this.range = 5;[code]...
my mc.enterfame works but this doesn't. I think it's because it's on load and for this to be implemented it has to be called after load so how do i use it? I tried to call it on the original but it didn't work.
View 6 Replies
Sep 5, 2006
With the following code I get an output of:
true
true
It seems that the onLoad method fires twice ?? I know the .load method has to come after the .onLoad function for the function to work but that doesn�t seem to be the problem in this case.
[AS]xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = function(loaded) {
[Code]....
View 5 Replies
May 10, 2007
How do I send a variable from the url [URL] to an embedded swf in that php?In other words, how do I get the embedded swf to load the variable from the URL. It needs to pass it, which I'm trying to accomplish via Javascript.
View 1 Replies
Feb 23, 2009
Is there a way that I can run a function when it first loads, as if it wasn't inside of the function, but still be able to call that block of code as a function later on? For example if I did...
Code:
someFunction();
function someFunction():void{
//do this
}
It wouldn't work correctly.. I need it to do what is inside the function as if it wasn't in the function, which it loads, but also be able to call it again later on.
View 2 Replies
Mar 9, 2009
I am loading one xml file and onload (or onData) of this file I am calling another function but, this function is not getting called. What can be the issue? Can delegates be used here and how?
Here is the code for reference
Code:
//path for _global.bookXML is defined already.
_global.book_xml = new XML();
_global.book_xml.ignoreWhite = true;
[Code]....
View 2 Replies
Jun 17, 2009
I managed to load data from xml file (at last) and now I faced another problem. I can give value to a variable, but cannot use outside of onLoad function. Lemme show you what I mean:
configXML = new XML();
configXML.ignoreWhite = true;
configXML.onLoad = function(success) {
[Code]....
The first trace(variable) command (inside the onLoad function) returns the correct value, but the second (out of onLoad) returns undefined. I need the values elsewhere, not in onLoad.
View 1 Replies
Feb 9, 2004
This should be easy to answer...
I have 2 swf's:
Section.swf (to be loaded in main) Main.swf
In section.swf, on the first frame I have this:
[AS]
onLoad = function(){
// start doing stuff
When I run the section.swf on its own, the onload function works, and the "doing stuff" code runs. But when I load it into main, this onload (within the section.swf, above) does not run.
View 7 Replies
Oct 8, 2004
load XML data (it parses automatically), parse through the XML tree and assign the values to an array of my choosing for access later in the movie. I can load the XML data, but the only time I can access the XML functions, i.e. XML.firstChild, or XML.getChildNodes(), is when I am within an XML. onLoad function.[code]Shouldn't I be able to call these XML function and properties from anywhere? not just within the XML.onLoad function? I look at other people's scripts and they do it, but I can't?I created a function that parses through the data and puts it into an array. And that works well if I say XMLdata.onLoad = my_array_funtion();But the problem is, if I do it that way I can't get the array out of the function. I can't return the value because the function is being called from an onLoad event and the return value of the function isn't assigned to a variable. So the array I create is worthless.And there is no way to call the function, and have the XML.functions, i.e. XML.firstChild, to work outside of an XML.onLoad event. Is there? Please tell me there is a way.I tried assigning the array to a global variable, but evidently you can't modify _globals within a function.Ultimately, I need this array because later in the script I use the data on the fly, and I want instant access to it.
View 2 Replies
Mar 25, 2005
[Code]...
my mc.enterfame works but this doesn't. I think it's because it's on load and for this to be implemented it has to be called after load so how do i use it? I tried to call it on the original but it didn't work.
View 6 Replies
Jul 8, 2009
I have following code on AS2 . Now I need to convert into AS3.
[Code]...
View 2 Replies
Aug 25, 2009
I've been searching this problem for a while and have tried a number of solutions found on google but nothing has worked so far. I'm sure this is a common problem, but due to my lack of flash knowledge I can't logically work through it as I'm used to windows form development, it makes sense to me that the function could access the variables I have defined but they dissapear after the .onLoad event. Does anyone know the common solution to this problem? I want to be able to pass the xml details into the local variables so I can pass on the details into a dynamic text field when movies are hovered over etc.
[Code]...
View 3 Replies
Sep 9, 2010
Can I write onload function without using EventListener...? Iget boolean value from loader..?
View 1 Replies
Sep 17, 2010
i have this code that load on a keyframe
loadListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
info.text = Math.round((bytesLoaded/bytesTotal)*100)+"%";
[Code]....
Because the swf_loader are mp3 player and if i change page wihout having press the stop button first the music is still playing. I have try to just add swf_loader.unloadMovie(); on every other keyframe but it doesnt work. i guess i have to find out where this swf_loader exist/is included right?
View 5 Replies
Jul 5, 2009
I've been sitting here for the last 2 hours trying to figure this one out.I have an empty movieclip on stage, and I'm loading external images in it using loadMovie()The problem is as following; I want it to resize when the image has fully loaded.I've been googling and googling non-stop, but found nothing that works.
View 1 Replies
Feb 2, 2010
Is there a way to fire up a call to a php on my website everytime the .swf file is loaded?
View 1 Replies
Dec 30, 2003
I've done the following [code]trace gives me a,b,c. am i missing out something? i cant seem to access the array from outside onLoad() ...
View 5 Replies
Feb 4, 2004
I have a class with a XML object in it. In one of the class' methods, I tell the XML object to load a document. Before I do that, I set up the onLoad event to call one of the class' other methods. The problem is that in that handler function, I can't seem to access any of my class' data. If I try to use the "this" pointer, I'm getting the XML object not my class.
A simple example:
[AS]
class MyClass
{
var theXML:XML;
[code]....
View 2 Replies