A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] MovieClipLoader Problem: Passing a variable to a dynamic clip

  1. #1
    Member
    Join Date
    May 2004
    Posts
    57

    [F8] MovieClipLoader Problem: Passing a variable to a dynamic clip

    Hi folks,

    I have a for loop that loops through an array and loads a clip into an empty movie clip.

    Works perfect, except for when I try and create a variable for the movieclip i.e. mc.imageName="My Cat"+i;

    When I try to access it from within mcListener.onLoadInit {} with target.imageName, it comes back as undefined.

    I know I am loading in a clip, and that the loop runs quicker than loadClip(), but it's as if the variable is being ignored completely once the clip has been loaded in. Am I going about this the wrong way?

    Any ideas?

    Many thanks


    Code Snippet:

    Code:
    var mcListener:Object = new Object();
    mcListener.onLoadInit = function(target:MovieClip)
    {
    target._x = currentx;
    currentx += target._width;
    target.onRelease=function()
    {
    trace(target.imageName);
    // displays undefined
    }
    }
    	
    var mcloader:MovieClipLoader = new MovieClipLoader();
    mcloader.addListener(mcListener);
    	
    for(var i=0; i<images.length; i++)
    {
    mc=_root.createEmptyMovieClip("catimage"+i,i);
    mc.imageName="My Cat"+i;
    trace(mc.imageName);
    // displays My Cat 1 etc
    mcloader.loadClip(images[i],mc);
    }
    }
    createThumbs();
    He took daddy's umbrella!

  2. #2
    Member
    Join Date
    May 2004
    Posts
    57
    Sorry, I think I've found a thread covering this.

    Thanks.
    He took daddy's umbrella!

  3. #3
    Bmcc*81 bmcc81's Avatar
    Join Date
    Jul 2007
    Location
    Montreal
    Posts
    299
    could you post that thread?
    Bmcc81
    Flash Designer / Web Developer
    -----------------------------------
    http://www.webinkgraphics.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center