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
for (var i:int = 0; i < xmlThumbs.length() / 2; i++) { | |
var thumb:JThumbnail = new JThumbnail(xmlThumbs[i].img.toString(), xmlThumbs[i].url.toString(), xmlThumbs[i].name.toString()); | |
line1.addChild(thumb); | |
thumb.x = i * (150 + thumbSpacing); | |
} | |
for (var j:int = 0; j < xmlThumbs.length() / 2; j++) { | |
var thumb2:JThumbnail = new JThumbnail(xmlThumbs[j + 5].img.toString(), xmlThumbs[j + 5].url.toString(), xmlThumbs[j + 5].name.toString()); | |
line2.addChild(thumb2); | |
thumb2.x = j * (150 + thumbSpacing); |
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); |
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
var myText:TextField = new TextField(); | |
myText.text = "Jonathan"; | |
var container:Sprite = new Sprite(); | |
container.addChild(myText); | |
addChild(container); |
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
var circle1:Sprite = new Sprite(); | |
circle1.graphics.beginFill(0xFF0000, 1); | |
circle1.graphics.drawCircle(0, 0, 30); | |
circle1.graphics.endFill(); | |
var circle2:Sprite = new Sprite(); | |
circle2.graphics.beginFill(0x00FF00, 1); | |
circle2.graphics.drawCircle(0, 0, 20); | |
circle2.graphics.endFill(); |
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
var circle2:Sprite = new Sprite(); | |
circle2.graphics.beginFill(0x00FF00, 1); | |
circle2.graphics.drawCircle(0, 0, 20); | |
circle2.graphics.endFill(); | |
var circle3:Sprite = new Sprite(); | |
circle3.graphics.beginFill(0x0000FF, 1); | |
circle3.graphics.drawCircle(0, 0, 10); | |
circle3.graphics.endFill() |
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
package com.browser | |
{ | |
import flash.display.Sprite; | |
import flash.display.MovieClip; | |
import flash.display.Loader; | |
import flash.display.Stage; | |
import flash.display.StageAlign; | |
import flash.display.StageScaleMode; | |
import flash.filters.DropShadowFilter; | |
import flash.net.URLLoader; |
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 BrowserGallery(xmlString:String) | |
{ | |
pictures = new MovieClip(); | |
addChild(pictures); | |
imgContainer = new MovieClip(); | |
pictures.addChild(imgContainer); | |
imgContainer.addChild(imgLoader); | |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<gallery> | |
<image width="940" height="680">images_browser/places/img1.jpg</image> | |
<image width="510" height="680">images_browser/places/img2.jpg</image> | |
<image width="510" height="680">images_browser/places/img3.jpg</image> | |
<image width="880" height="680">images_browser/places/img4.jpg</image> | |
<image width="907" height="680">images_browser/places/img5.jpg</image> | |
<image width="907" height="680">images_browser/places/img6.jpg</image> | |
<image width="907" height="680">images_browser/places/img7.jpg</image> | |
<image width="907" height="680">images_browser/places/img8.jpg</image> |
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
//LOADS THE XML PASSED IN THE CONSTRUCTOR BROWSER GALLERY - BrowserGallery(xmlString:String) | |
xml = new XML(); | |
xmlURL = new URLRequest(xmlString); | |
xmlLoader = new URLLoader(xmlURL); | |
//EVENT LISTENERS TO THE XML, PICTURES MOVIE CLIP AND THE ARROWS | |
xmlLoader.addEventListener(Event.COMPLETE, loadXML); | |
pictures.addEventListener(MouseEvent.ROLL_OVER, displayArrows); | |
pictures.addEventListener(MouseEvent.ROLL_OUT, hideArrows); | |
arrowLeftSquare.addEventListener(MouseEvent.CLICK, prevImage); |
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
private function nextImage(mouseEvent:MouseEvent):void | |
{ | |
//WHEN YOU CLICK TO THE NEXT IMAGE ARROW, REMOVES THE CURRENT IMAGE, AND LOADS THE NEXT IMAGE IN THE xml.image TAG BY ADDING 1 TO THE currentImg VARIABLE, IF currentImg EQUALS THE VALUE OF lastImg IT SETS ITS VALUE TO 0 (TO GO TO THE FIRST IMAGE ON THE GALLERY (TO START OVER), ALL THIS IS DONE WITH THE CONDITIONAL. ALSO PLACES THE ARROWS IN PLACE AGAIN FOR THE NEXT IMAGE LOADED. | |
imgLoader.unload(); | |
currentImg = (currentImg < lastImg) ? currentImg + 1 : 0; | |
loadImages(); | |
arrowRightSquare.x = 20; | |
arrowRightSquare.y = imgLoader.height / 2 - 40; | |
arrowLeftSquare.x = -20; |
OlderNewer