Re: [Flashcoders] Class to loop sound objects in order

2007-08-16 Thread Daniel Glue
Muzak, thanks so much for that :) Alain I have been using your classes you
kindly posted and they are working great, I've customised them a little to
my needs so I can start and stop them and set the volume and they do exactly
what I want.Thanks again everyone,
Dan


On 16/08/07, Muzak [EMAIL PROTECTED] wrote:

 function play():Void {
 currSound.onSoundComplete = Delegate.create(this,
 this.soundCompleteHandler);
 }

 function soundCompleteHandler():Void {
 // code
 }

 regards,
 Muzak

 - Original Message -
 From: Daniel Glue [EMAIL PROTECTED]
 To: flashcoders@chattyfig.figleaf.com
 Sent: Wednesday, August 15, 2007 3:38 PM
 Subject: Re: [Flashcoders] Class to loop sound objects in order


  Hey Muzak, thanks for yr response, I'm not sure of the syntax to use
  Delegate in this instance, I tried this:
  currSound.onSoundComplete = function() {
  trace(mp3c:+mp3C+  length:+snds_ar.length)
  //if there are more sound objects to play iterate thru array and
 retrigger
  play()
  if (mp3Csnds_ar.length) {
  mp3Count++;
  //this bit isn't working!
  Delegate.create(this, play); //  play();
  } else {
  if (loopForever) {
  mp3Count = 0;
  this.play();
  } else {
  //all sound objects have played and play() is not retriggered
  mp3Count = 0;
  }
  }
  };
 
 
  but it won't work and I can't find an event to tie this to. If you could
  spell it out for me I would be very grateful.
  Thanks!,
  Dan
 


 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Class to loop sound objects in order

2007-08-15 Thread Daniel Glue
Hey Muzak, thanks for yr response, I'm not sure of the syntax to use
Delegate in this instance, I tried this:
currSound.onSoundComplete = function() {
trace(mp3c:+mp3C+  length:+snds_ar.length)
//if there are more sound objects to play iterate thru array and retrigger
play()
if (mp3Csnds_ar.length) {
mp3Count++;
//this bit isn't working!
Delegate.create(this, play); //  play();
} else {
if (loopForever) {
mp3Count = 0;
this.play();
} else {
//all sound objects have played and play() is not retriggered
mp3Count = 0;
}
}
 };


but it won't work and I can't find an event to tie this to. If you could
spell it out for me I would be very grateful.
Thanks!,
Dan

On 15/08/07, Muzak [EMAIL PROTECTED] wrote:

 get rid of the nested function and use Delegate.

 regards,
 Muzak

 - Original Message -
 From: [EMAIL PROTECTED]
 To: flashcoders@chattyfig.figleaf.com
 Sent: Wednesday, August 15, 2007 12:45 PM
 Subject: [Flashcoders] Class to loop sound objects in order


  Hi there, thanks for checking my post. I am trying to create a class
 that will play a number of mp3 loops each a specified number
  of times and in the specified order. I have tried to find an existing
 class but cant find one anywhere.
 
  My solution (which may not be that efficient), is to create all of the
 sound objects in the fla then load the mp3s into them. When
  they are all loaded each sound object is added to a new object that
 holds it as well as a 'loops' property that says how many
  times the sound object must play. These objects are then put into an
 array in the order they are to be heard. This array is passed
  to my LoopSound class that controls the playback. I can also pass a
 'loopForever' property that will make the series repeat
  indefinitely.
 
  The problem I am having is re-triggering the play() function from within
 my LoopSound Class to move onto the next sound in the
  array. I am sure that there will be a much neater way of achieving what
 I want, and maybe even a pre-written class!
 
  Any direction / suggestions / encouragement much appreciated :)
 
  Thanks!
  Danny


 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Setting up loadVars onLoad handler within custom class

2007-06-04 Thread Daniel Glue

Hey there, I am creating a custom class with a loadVars object that
gets data from a web page. My problem is I can't get my loadVars
object to load! I think I am setting the onLoad handler in the wrong
place. Might anyone have any ideas how I set this inside my custom
class?

Thanks in advance guys!
Danny


Here is my code:

Class VersionChecker{
private var my_lv:LoadVars;
   private var xmlAdd:String;
 private var browserType:String;
 private var ipAddress:String;


//receives url to connect to sets onLoad handler
public function VersionCheck(xmlAddy:String {
xmlAdd = xmlAddy;
my_lv.onLoad = function(success:Boolean) {
if (success) {
   trace(loaded);
browserType = this.browser;
ipAddress = this.ip;
} else {
trace(load failed);
}
};
startCheck();
}

 private function startCheck() {
trace(version checker starting to check:+xmlAdd);
my_lv.load(xmlAdd);
}
}
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com