Created
February 4, 2010 20:49
-
-
Save jonathantorres/295086 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function JThumbnail(img:String, link:String, name:String) { | |
image = new URLRequest(img); | |
imgLink = link; | |
imgName = name; | |
thumb = new MovieClip(); | |
thumb.buttonMode = true; | |
addChild(thumb); | |
thumbShadow = new GlowFilter(0x666666, 0.4, 15, 15); | |
thumb.filters = [thumbShadow]; | |
imgLoader = new Loader(); | |
imgLoader.load(image); | |
thumb.addChild(imgLoader); | |
overShape = new Sprite(); | |
overShape.graphics.beginFill(0x000000, 0.5); | |
overShape.graphics.drawRect(0, 0, 150, 150); | |
overShape.graphics.endFill(); | |
overShape.buttonMode = true; | |
overInvisibleShape = new Sprite(); | |
overInvisibleShape.graphics.beginFill(0x000000, 0); | |
overInvisibleShape.graphics.drawRect(0, 0, 150, 150); | |
overInvisibleShape.graphics.endFill(); | |
overInvisibleShape.buttonMode = true; | |
thumb.addChild(overShape); | |
overShape.alpha = 0; | |
imgLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadThumb); | |
imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded); | |
thumb.addEventListener(MouseEvent.ROLL_OVER, overThumb); | |
thumb.addEventListener(MouseEvent.ROLL_OUT, outThumb); | |
thumb.addEventListener(MouseEvent.CLICK, clickThumb); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment