Skip navigation
chironisis
Currently Being Moderated

accessing dynamic created clips

Apr 15, 2007 1:43 PM



I am having trouble accessing the clips for applying actions.

photAmount, thumb1xpo, thumb1ypo, sm_photo are variables.
thumbLdr is a mc holding the mc's which are created. I know they are being created as they show their respective pics. I just can't seem to apply any actions to them.

Thanks



 
Replies
  • Currently Being Moderated
    Apr 15, 2007 3:30 PM   in reply to chironisis
    When the image has been loaded into the clip you're loading it to, that clip will reset any actions applied to it. two ways to solve this:

    1. Apply the action when the image has been fully loaded to the clip. This would require a pulse (either an onenterframe or interval) that checks to see when the movieclip has been fully loaded (getBytesLoaded()>=getBytesTotal(), or in your case, a simple and actually more safe way would be checking _width>0).

    2. Load that image into a holder clip within the holder, in other words:
    ...
    _root.thumbLdr.createEmptyMovieClip ("thumb" + i, i);
    _root.thumbLdr["thumb" + i]._x = (i - 1) * thumb1xpo;
    _root.thumbLdr["thumb" + i]._y = thumb1ypo;
    _root.thumbLdr["thumb" + i].createEmptyMovieClip ("imageholder", 1);
    _root.thumbLdr["thumb" + i].imageholder.loadMovie (_root["sm_photo" + i]);
    _root.thumbLdr["thumb" + i].onRelease = function(){
    trace("release" + i);
    };
    ...

    I would definately go for option nr 2 in your case :)
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points