ActionScript 2.0 :: Calling A Function From Within Sound.onLoad()

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


Similar Posts:


Actionscript 2.0 :: Access Sound Duration Outside Onload Function?

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

ActionScript 2.0 :: XML Loads Other XML Files, Onload Function In Onload Function?

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

ActionScript 2.0 :: SetInterval Keeps Calling Stop Sound Function

Oct 20, 2006

I have few sound files and I need to play then in an order and every time after the sound played a button is active then the user can click on the button to play next sound....etc. But at some point my setInterval keep calling the stop sound function even though myTimer is delete. I checked the actionscript dictionary and I found that the delete action is for Flash 5. Does it mean I can use it in Flash 7 or 8 and actionscript2?

Here is the code my created:
//-----------play sound---------//
function soundPlay(ID:Number){
var instrSound:Sound = new Sound(this);
var soundName:String = "SCP" + ID + ".wav";
soundID = ID;
[Code] .....

View 2 Replies

ActionScript 2.0 :: Calling A Php File Onload?

Feb 2, 2010

Is there a way to fire up a call to a php file on my website everytime the .swf file is loaded?

View 1 Replies

Actionscript 3 :: Sound Latency - Set It For Any Silence Before The Actual Sound By Calling The Sound

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

ActionScript 3.0 :: Loading Sound On Onload?

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

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

ActionScript 2.0 :: [FMX] Custom Sound Class Not 'inheriting' OnLoad?

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

ActionScript 2.0 :: [FMX] Custom Sound Class Not 'inheriting' OnLoad

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

ActionScript 2.0 :: Sound.onLoad + OnError - Making Music / Video Player In Flashmx2004

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

ActionScript 2.0 :: Mc.onLoad = Function

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

ActionScript 3.0 :: How To Run Function OnLoad

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

IDE :: Function Not Getting Called In OnLoad?

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

ActionScript 2.0 :: XML.onLoad And Other XML Function

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

ActionScript 2.0 :: Mc.onLoad = Function?

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

ActionScript 3.0 :: XML OnLoad Function Without Listener

Sep 9, 2010

Can I write onload function without using EventListener...? Iget boolean value from loader..?

View 1 Replies

ActionScript 2.0 :: OnLoad - Attempt To Use Outside Of The Function?

Aug 5, 2009

I have this code

[code]...


so, where is my code inside the function I have some variables which are global variables that I declared and I attempt to use outside of the function.Is this possible ? I ask the question cause I don't see that they work

View 6 Replies

ActionScript 3.0 :: Can't Get Xml Data Out Of The Onload Function?

Apr 28, 2011

I can't figure out why this doesn't work. I need to pass the text in the xml file to an object that needs to be created outside of the onload function so i need access to the data out side of that function. I've declared variables to store the data at the class level which i thought would give me access to the databelow is the code:

Code:
package {
import flash.display.MovieClip;

[code].....

View 2 Replies

ActionScript 1/2 :: Xml.onLoad Variables Undefined Outside Function?

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

var myXML:XML = new XML();
myXML.ignoreWhite=true;
var nav1Text:String;

[code].....

View 3 Replies

ActionScript 2.0 :: OnLoad Function Not Running Within Section SWF

Feb 9, 2004

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
}[/AS]

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

ActionScript 2.0 :: Break The For-loop From Within The OnLoad-function

Feb 21, 2004

I would like to break a for-loop. It should be easy with "break;", but there is a slight complication to the code - the for-loop contains a function from within which I want to be able to break the loop. Here is a codesnippet:

[Code]...

So, somehow, I want to break the for-loop from within the onLoad-function. Is that possible with some other code (this ofcourse doesnt work)?

View 6 Replies

ActionScript 2.0 :: How To Call Function Within OnLoad In Class

Jun 14, 2006

I'm trying to call a function with a onLoad function in a Class
XML_var.onLoad = function(success) {
anotherFunction();
}

View 6 Replies

ActionScript 2.0 :: Can't Access The Array Outside The Xml.onLoad Function

May 8, 2008

However I have an upcoming project that's going to have a big image gallery, that is likely to change often, so I can see XML would be very useful for speed of editing/adding etc.

I'm a complete XML noob then, and I'm just doing a little test with some text, and I can't seem to access the Array outside the xml.onLoad function.

Here is the xml...

Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<writing>
<para>

[Code]....

Now in the above code, my dynamic text field named "desc" correctly displays "bloody hell, XML is a nause".

However, when the line in bold is placed outside the onLoad function, it returns undefined, and when traced, the description array returns nothing at all.

I need to access the array outside of this function.

View 6 Replies

ActionScript 2.0 :: OnLoad Function - Reading Text File

Feb 16, 2008

Code:
onLoad=function() {
my_text=new LoadVars()
my_text.load("C:\Documents and Settings\Wrkspace\Desktop\flash_wordlist.txt");
my_wordlist="";
} my_text.onLoad=function(success) {
if(success) {
my_wordlist=(this.var_wordlist).split(" ");
trace(my_wordlist)
}}

The trace doesn't showup at all....by the way, this is in the first frame of the timeline, and i am trying to load a wordlist and then use the words in my program separately. Is it because flash loads the text file slowly? I am using flash 8, AS2.

View 2 Replies

ActionScript 2.0 :: Internet Adress Doesn't Even Get Into Onload Function

Aug 21, 2004

I'm building a streaming mp3 player. So that you can load a mp3 from all over the internet in a streaming way, but soon It became obvious that when I set the loadSound to true (used to stream sounds) that sometimes the mp3 begins to stop and load and then play again. A sort of short stops. So I thought let's place a buffer so that when the song is loaded half way it's starts playing and gone are the short stops. But that's where my problem started and some questions arised. I use the onload method to check if any sounds are loaded into the sound object. I used this sentense to handle the onload action:[code]But now that I'm not exactly streaming anymore, so I have set the loadSound to false. Now I wonder if the onID3 method I used for getting some specific information out of the mp3 also acts like a none streaming file stream?Also something is wrong with my check if the loading process is half way.I have some songs on my pc and one on the internet. The songs on my pc load very well. (offcourse ) But they don't get into my if statement. And the song loaded from an internet adress doesn't even get into the onload function

View 2 Replies

Javascript :: Soundmanager2 IE Playback - 'onload' Callback Function Is Defined As Null

Apr 5, 2012

I'm currently working with soundmanager2 in an IE/flash context (not html5). The issue is that audio playback of mp3 content does not occur for the following case where the 'onload' callback function is defined as null OR as a function that does almost nothing.

[Code]...

View 1 Replies

Flash :: Calling OnLoadProgress Function From Inside Another Function?

Sep 23, 2011

I have an AS3 function that loads and audio file and then plays it. I have the pre-loader for the first audio file working - now I need to run the pre-load function before the 2nd audio file starts.

myMusic.addEventListener(ProgressEvent.PROGRESS, onLoadProgress2, false,0, true);
myMusic.addEventListener(Event.COMPLETE, playMusicNow, false, 0,true);
myMusic.load(soundFile, myContext); //This code works

[code].....

View 2 Replies

ActionScript 3.0 :: Calling A Function From A Private Static Function?

Feb 26, 2010

i'm trying to modify some code and can't figure out what the issue i'm having it. this is the(shortened) code:

public static function Lose():void {
trace("OVER!");
Clock.stop();[code]...

this is the error i get: 1180: Call to a possibly undefined method OverIt.i just want to call a function from inside of the public static funtion.both function are inside this class:

public class Game extends MovieClip {
}

View 4 Replies

ActionScript 2.0 :: OOP In Flash: Calling A Function W/in A Function Class?

May 12, 2004

Okay so I am reading through sens tutorial on OOP and updating my game that I am making. It is much easier to code this way (IMO) but still hitting snags.I am trying to get through this code:

[Code]...

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved