Re: [Flashcoders] AS2 Delegate event won't fire in my multi swf load class

2008-01-31 Thread Kenneth Kawamoto

Your code works fine if you just change

var tmpFun:Function = mcLoaded;

to

var tmpFun:Function = Delegate.create(this, mcLoaded);

as Glen said, and also change

var tempLoad:LoadObj = itemsToLoad_ar[arRef];

to

var tempLoad:Object = itemsToLoad_ar[arRef];

Kenneth Kawamoto
http://www.materiaprima.co.uk/

ali drongo wrote:

Hiya, I've written a class that will load multiple SWFs and then call a
passed function when complete. My problem is that when all the 
movies have
downloaded the passed function won't fire. If anyone could help me 
figure

this that would be really helpful.Cheers,
Ali



//
//  LoadChecker

// this class is passed am array and calls a function when all of the
objects in the array are loaded
//
//  Created by Alistair Colling on 2008-01-30.
//  Copyright FPP Design Ltd 2008. All rights reserved.
//
// pass mcs to load and start loading

import mc.*;
import mx.utils.Delegate;


class mc.LoadChecker {
private var allLoadedFn:Function;
public var itemsToLoad_ar:Array;
private var itemsLoaded:Array;

 public function LoadChecker(a:Array, f:Function) {
trace("loadchecker! created:"+a.toString());
allLoadedFn = f;
itemsLoaded = new Array();
itemsToLoad_ar = a;
for (var i = 0; i} 






___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AS2 Delegate event won't fire in my multi swf load class

2008-01-31 Thread Glen Pike
It looks like your loadListener object goes out of scope as you only 
declare it inside the function - try making it a class variable then 
creating a new one for each movieclip that you want to load in.  Same 
with your tmpFun assignment and you may want to look at using Delegate 
if this is still not working:
  
   tmpFun = Delegate.create(this, mcLoaded);


   Glen

Alistair Colling wrote:
Thanks for your quick reply Glen, thing is, I want to allow the class 
to trigger different functions that are passed to it and also to 
monitor the progress of a number of SWFs. Sorry if I'm missing 
something here.

Cheers,
Ali




On 31 Jan 2008, at 10:55, Glen Pike wrote:


Hi,

   Why don't you just make your class the listener for the 
MovieClipLoader and then implement the functions in your class?


   class LoadChecker {
  var mcLoader:MovieClipLoader;

  function LoadChecker() {
 mcLoader = new MovieClipLoader();
 mcLoader.addListener(this);
  }

  function myLoader(str, mc) {
 //...
 mcLoader.loadClip(str, mc);
  }


  function onLoadInit(mc...) {
 trace("loaded mc " + mc) ;
 //...doStuff.
 mcLoaded(mc);
   }

  function onLoadError(mc...) {
 trace("oops, there was an error ");
 //...carry on?
  }

  function mcLoaded(mc) {
 //...
  }
   }
 Put a trace in your onLoadInit function and also implement the 
onLoadError function for the listener so you can see if they are 
called - you can also stub out the other functions for 
MovieClipLoader listeners and put traces in those to make sure it 
starts loading, etc.


   HTH

   Glen


ali drongo wrote:

Hiya, I've written a class that will load multiple SWFs and then call a
passed function when complete. My problem is that when all the 
movies have
downloaded the passed function won't fire. If anyone could help me 
figure

this that would be really helpful.Cheers,
Ali



//
//  LoadChecker

// this class is passed am array and calls a function when all of the
objects in the array are loaded
//
//  Created by Alistair Colling on 2008-01-30.
//  Copyright FPP Design Ltd 2008. All rights reserved.
//
// pass mcs to load and start loading

import mc.*;
import mx.utils.Delegate;


class mc.LoadChecker {
private var allLoadedFn:Function;
public var itemsToLoad_ar:Array;
private var itemsLoaded:Array;

 public function LoadChecker(a:Array, f:Function) {
trace("loadchecker! created:"+a.toString());
allLoadedFn = f;
itemsLoaded = new Array();
itemsToLoad_ar = a;
for (var i = 0; ihttp://chattyfig.figleaf.com/mailman/listinfo/flashcoders





--

Glen Pike
01736 759321
www.glenpike.co.uk 
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




--

Glen Pike
01736 759321
www.glenpike.co.uk 
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AS2 Delegate event won't fire in my multi swf load class

2008-01-31 Thread Alistair Colling
Thanks for your quick reply Glen, thing is, I want to allow the class  
to trigger different functions that are passed to it and also to  
monitor the progress of a number of SWFs. Sorry if I'm missing  
something here.

Cheers,
Ali




On 31 Jan 2008, at 10:55, Glen Pike wrote:


Hi,

   Why don't you just make your class the listener for the  
MovieClipLoader and then implement the functions in your class?


   class LoadChecker {
  var mcLoader:MovieClipLoader;

  function LoadChecker() {
 mcLoader = new MovieClipLoader();
 mcLoader.addListener(this);
  }

  function myLoader(str, mc) {
 //...
 mcLoader.loadClip(str, mc);
  }


  function onLoadInit(mc...) {
 trace("loaded mc " + mc) ;
 //...doStuff.
 mcLoaded(mc);
   }

  function onLoadError(mc...) {
 trace("oops, there was an error ");
 //...carry on?
  }

  function mcLoaded(mc) {
 //...
  }
   }
 Put a trace in your onLoadInit function and also implement the  
onLoadError function for the listener so you can see if they are  
called - you can also stub out the other functions for  
MovieClipLoader listeners and put traces in those to make sure it  
starts loading, etc.


   HTH

   Glen


ali drongo wrote:
Hiya, I've written a class that will load multiple SWFs and then  
call a
passed function when complete. My problem is that when all the  
movies have
downloaded the passed function won't fire. If anyone could help me  
figure

this that would be really helpful.Cheers,
Ali



//
//  LoadChecker

// this class is passed am array and calls a function when all of the
objects in the array are loaded
//
//  Created by Alistair Colling on 2008-01-30.
//  Copyright FPP Design Ltd 2008. All rights reserved.
//
// pass mcs to load and start loading

import mc.*;
import mx.utils.Delegate;


class mc.LoadChecker {
private var allLoadedFn:Function;
public var itemsToLoad_ar:Array;
private var itemsLoaded:Array;

 public function LoadChecker(a:Array, f:Function) {
trace("loadchecker! created:"+a.toString());
allLoadedFn = f;
itemsLoaded = new Array();
itemsToLoad_ar = a;
for (var i = 0; ihttp://chattyfig.figleaf.com/mailman/listinfo/flashcoders





--

Glen Pike
01736 759321
www.glenpike.co.uk 
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AS2 Delegate event won't fire in my multi swf load class

2008-01-31 Thread Glen Pike

Hi,

   Why don't you just make your class the listener for the 
MovieClipLoader and then implement the functions in your class?


   class LoadChecker {
  var mcLoader:MovieClipLoader;

  function LoadChecker() {
 mcLoader = new MovieClipLoader();
 mcLoader.addListener(this);
  }

  function myLoader(str, mc) {
 //...
 mcLoader.loadClip(str, mc);
  }


  function onLoadInit(mc...) {
 trace("loaded mc " + mc) ;
 //...doStuff.
 mcLoaded(mc);
   }

  function onLoadError(mc...) {
 trace("oops, there was an error ");
 //...carry on?
  }

  function mcLoaded(mc) {
 //...
  }
   }
  
   Put a trace in your onLoadInit function and also implement the 
onLoadError function for the listener so you can see if they are called 
- you can also stub out the other functions for MovieClipLoader 
listeners and put traces in those to make sure it starts loading, etc.


   HTH

   Glen

  


ali drongo wrote:

Hiya, I've written a class that will load multiple SWFs and then call a
passed function when complete. My problem is that when all the movies have
downloaded the passed function won't fire. If anyone could help me figure
this that would be really helpful.Cheers,
Ali



//
//  LoadChecker

// this class is passed am array and calls a function when all of the
objects in the array are loaded
//
//  Created by Alistair Colling on 2008-01-30.
//  Copyright FPP Design Ltd 2008. All rights reserved.
//
// pass mcs to load and start loading

import mc.*;
import mx.utils.Delegate;


class mc.LoadChecker {
private var allLoadedFn:Function;
public var itemsToLoad_ar:Array;
private var itemsLoaded:Array;

 public function LoadChecker(a:Array, f:Function) {
trace("loadchecker! created:"+a.toString());
allLoadedFn = f;
itemsLoaded = new Array();
itemsToLoad_ar = a;
for (var i = 0; ihttp://chattyfig.figleaf.com/mailman/listinfo/flashcoders


  


--

Glen Pike
01736 759321
www.glenpike.co.uk 
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] AS2 Delegate event won't fire in my multi swf load class

2008-01-31 Thread ali drongo
Hiya, I've written a class that will load multiple SWFs and then call a
passed function when complete. My problem is that when all the movies have
downloaded the passed function won't fire. If anyone could help me figure
this that would be really helpful.Cheers,
Ali



//
//  LoadChecker

// this class is passed am array and calls a function when all of the
objects in the array are loaded
//
//  Created by Alistair Colling on 2008-01-30.
//  Copyright FPP Design Ltd 2008. All rights reserved.
//
// pass mcs to load and start loading

import mc.*;
import mx.utils.Delegate;


class mc.LoadChecker {
private var allLoadedFn:Function;
public var itemsToLoad_ar:Array;
private var itemsLoaded:Array;

 public function LoadChecker(a:Array, f:Function) {
trace("loadchecker! created:"+a.toString());
allLoadedFn = f;
itemsLoaded = new Array();
itemsToLoad_ar = a;
for (var i = 0; ihttp://chattyfig.figleaf.com/mailman/listinfo/flashcoders