all groups > flash actionscript > october 2006 >
You're in the

flash actionscript

group:

onRelease for createEmptyMovieClip


onRelease for createEmptyMovieClip exboywonder
10/12/2006 9:40:34 PM
flash actionscript: 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!

Re: onRelease for createEmptyMovieClip adam NO[at]SPAM blueapplestudio
10/12/2006 9:55:23 PM
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.
Re: onRelease for createEmptyMovieClip AnandMX
10/13/2006 12:00:00 AM
newThumb = _root.createEmptyMovieClip("thumb_mc", this.getNextHighestDepth());
newThumb.loadMovie("one_img.jpg");
newThumb.onLoad=function(){

this.onRelease = function() {
this._alpha = 50;
};
}
Re: onRelease for createEmptyMovieClip S4Potential
10/13/2006 12:19:06 AM
Re: onRelease for createEmptyMovieClip exboywonder
10/13/2006 5:14:07 PM
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?
Re: onRelease for createEmptyMovieClip yachts99
10/13/2006 7:23:59 PM
newThumb.onrelease = function() {

Re: onRelease for createEmptyMovieClip S4Potential
10/13/2006 7:33:47 PM
AddThis Social Bookmark Button