Chaotic Horde

Flash Applications and Games Development

Today,  

Hiya, thanks for checking my post. I am really confused as what I am trying to do is so simple!
All I want to do is increment a counter every time a movie loads. I have a method (updateMovie) that is passed an MC and the url of the swf to load into it. My loader listener object then triggers another method that should count the number of movies loaded. For some reason I can’t access my counter (’loaded’).
If anyone can point out where I am going wrong here I would be really really grateful as I can’t understand this at all.
Thanks for any help
Schm

Here is some of the code from within my class:
ActionScript Code:
private var loaded:Number = 0;
//loads passed swf into mc
private function updateMovie(mc:MovieClip, url:String) {
var mclListener:Object = new Object();
mclListener.onLoadInit = mcLoaded(mc);
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip(url,mc);

}
//trigggered when mc is loaded
private function mcLoaded(mc:MovieClip) {
trace(“loaded:”+loaded);//traces undefined
trace(“mc loadeed:”+mc);
if (loadedlength) {
loaded++;
trace(“loaded:”+loaded);
}else{
trace(“all loaded”);
}
}


(Link)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Furl
  • StumbleUpon

Posted in Flash Application and Games Development |

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.