Skip to main content
Participant
October 12, 2006
Question

onRelease for createEmptyMovieClip

  • October 12, 2006
  • 4 replies
  • 463 views
I have an XML file that I am pulling thumbnails from. I would like these thumbnails to be links, but for some reason onRelease does not work on my movie clip created with createEmptyMovieClip.

I have this theory that my onRelease function is being called before my thumbnail image is fully loaded, but I may be completely wrong. Here is some example code of what I am trying to do.

-----------------------------------------------

newThumb = _root.createEmptyMovieClip("thumb_mc", this.getNextHighestDepth());
newThumb.loadMovie("one_img.jpg");


newThumb.onRelease = function() {
this._alpha = 50;
};

-----------------------------------------------

Any help or suggestions would be great! Thanks!
This topic has been closed for replies.

4 replies

October 13, 2006
Yup, that would do it. Flash is case sensitive. Be carefull with that keyboard :o)
Inspiring
October 13, 2006
newThumb = _root.createEmptyMovieClip("thumb_mc", this.getNextHighestDepth());
newThumb.loadMovie("one_img.jpg");
newThumb.onLoad=function(){

this.onRelease = function() {
this._alpha = 50;
};
}
Participant
October 13, 2006
Okay... using the MovieClipLoader class here is what I have come up with. The .jpg is now recognized as a button when moving the mouse over it. But nothing happens when its clicked. I'm still new to ActionScript (as you can probably tell) so this may just be a syntax error.

------------------------------------------------------------------------------

newThumb = _root.createEmptyMovieClip("thumb_mc", this.getNextHighestDepth());

myMCL = new MovieClipLoader();
myMCL.loadClip("one_img.jpg","_root.thumb_mc");

myMCL.onLoadComplete = function ()
{
newThumb.onrelease = function() {
this._alpha = 50;
}
}

------------------------------------------------------------------------------

Any thoughts on the above?
Participating Frequently
October 13, 2006
newThumb.onrelease = function() {

Capital R in onRelease
October 13, 2006
Use the MovieClipLoader class. It's all well documenmted in the help.
Known Participant
October 12, 2006
You may be right. I split your code and put the first two lines on frame 1, and the last three lines on frame 9. That works just fine. Then I went back and put it all on frame 1 and the cursor won't change over the image at all.

You might need to try waiting for the image/s to load before you add the onRelease to your MovieClips.

Good luck.