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!
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.
newThumb = _root.createEmptyMovieClip("thumb_mc", this.getNextHighestDepth()); newThumb.loadMovie("one_img.jpg"); newThumb.onLoad=function(){ this.onRelease = function() { this._alpha = 50; }; }
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?
newThumb.onrelease = function() {
Don't see what you're looking for? Try a search.
|