Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

AniMi

Members
  • Posts

    11
  • Joined

  • Last visited

AniMi's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. private function imageLoaded(e:LoaderEvent):void { var imgClip:ContentDisplay = LoaderMax.getContent(e.currentTarget.name); TweenMax.to(imgClip, 0, { colorTransform: { exposure:2 }} ); TweenMax.to(imgClip, 1.5, { colorTransform: { exposure:1 }, autoAlpha:1, delay:3} ); } I have already tried it here, but then all the pictures loads very slowly, I only need the first one do that.
  2. I tried to add it here private function thumbsLoaded(e:LoaderEvent):void { //Setup Click Events for (var i:int = 0; i < xImgList.length(); i++) { var cdImg:ContentDisplay = LoaderMax.getContent("p"+(i+1)); cdImg.buttonMode = true; cdImg.addEventListener(MouseEvent.ROLL_OVER, onOver); cdImg.addEventListener(MouseEvent.ROLL_OUT, onOut); cdImg.addEventListener(MouseEvent.CLICK, onClick); //do something only for first thumb if(i == 0){ TweenMax.to(cdImg, .5, {autoAlpha:1, [b]delay:3[/b]}); loadImage(0); } } }
  3. thank you so much ) you rock!!!! am ok... now I want that the image doesn't appear so fast, I tried to write delay:4, but it doesn't work... WEll it doesn't throw errors, but there is no delay )) whats the problem?
  4. Ok, i'm done with a gallery, Everything works, but I need that on load the first image and first thumbnail to show up. Here is my code: package { import com.greensock.events.LoaderEvent; import com.greensock.loading.XMLLoader; import com.greensock.loading.LoaderMax; import com.greensock.loading.ImageLoader; import com.greensock.loading.data.ImageLoaderVars; import com.greensock.loading.display.ContentDisplay; import com.greensock.*; import flash.filters.*; import flash.display.Sprite; import flash.display.MovieClip; import flash.events.Event; import flash.events.EventDispatcher; import flash.events.MouseEvent; import flash.net.URLRequest; /** * ... * @author */ public class main extends MovieClip { private var xImgList:XMLList; public function main() { //Load XML var xPhotography:XMLLoader = new XMLLoader("photography.xml"); xPhotography.addEventListener(LoaderEvent.COMPLETE, xmlLoaded); xPhotography.load(); } private function xmlLoaded(e:LoaderEvent):void { var xData:XML = e.target.content; xImgList = new XMLList(xData.img); //setup loader max object var thumbLoader:LoaderMax = new LoaderMax( { name:"thumbLoader" } ); thumbLoader.addEventListener(LoaderEvent.COMPLETE, thumbsLoaded); //setup variables for ImageLoaderVars var nImgWidth:Number = 80; var nImgHeight:Number = 52; var nMaxCols:Number = 4; for (var i:int = 0; i < xImgList.length(); i++) { addChild(galerijaTXT_mc); var iLoad:ImageLoader = new ImageLoader("images/thumbs/" + xImgList[i].@url, new ImageLoaderVars() .name(xImgList[i].@name) .width(nImgWidth) .height(nImgHeight) .smoothing(true) .container(galerijaTXT_mc.container_mc["p"+i] as MovieClip) .x(513) .y(242) .prop("index", i) .prop("url",xImgList[i].@url) ) thumbLoader.append(iLoad); } thumbLoader.load(); } private function thumbsLoaded(e:LoaderEvent):void { //Setup Click Events for (var i:int = 0; i < xImgList.length(); i++) { var cdImg:ContentDisplay = LoaderMax.getContent("p"+(i+1)); cdImg.buttonMode = true; cdImg.addEventListener(MouseEvent.ROLL_OVER, onOver); cdImg.addEventListener(MouseEvent.ROLL_OUT, onOut); cdImg.addEventListener(MouseEvent.CLICK, onClick); } } var glow:GlowFilter = new GlowFilter(0x999999, 1, 2, 2, 3, 255, false, false); private function onOver(e:MouseEvent):void { e.target.filters = [glow]; } private function onOut(e:MouseEvent):void { e.target.filters = []; } private function onClick(e:MouseEvent):void { var vars:Object = ImageLoader(e.currentTarget.loader).vars; checkOldImage(vars.index) } private function checkOldImage(index:Number):void { //check if there is already an image if (galerijaTXT_mc.container_mc.mainHolder.numChildren > 0) { var oldClip:Sprite = Sprite(galerijaTXT_mc.container_mc.mainHolder.getChildAt(0)); TweenMax.to(oldClip, 0.5, { autoAlpha:0, onComplete:function() { galerijaTXT_mc.container_mc.mainHolder.removeChildAt(0); loadImage(index) }} ) } else { loadImage(index); } } private function loadImage(index:Number):void { //Get filename var file:String = xImgList[index].@url; //Setup main Image loader var mainLoad:ImageLoader = new ImageLoader("images/main/" + file, new ImageLoaderVars() .width(557) .height(400) .x(352) .y(255) //.scaleMode("proportionalInside") .crop(true) .container(galerijaTXT_mc.container_mc.mainHolder as MovieClip) .smoothing(true) .alpha(50) ) //setup EventListeners mainLoad.addEventListener(LoaderEvent.COMPLETE, imageLoaded); mainLoad.load(); } private function imageLoaded(e:LoaderEvent):void { var imgClip:ContentDisplay = LoaderMax.getContent(e.currentTarget.name); TweenMax.to(imgClip, 0, { colorTransform: { exposure:2 }} ); TweenMax.to(imgClip, 1.5, { colorTransform: { exposure:1 }, autoAlpha:1 } ); } } }
  5. omg, I think I'm giving up .... (( that slideshow is different then I want.. I want http://www.files.riacodes.com/flash_zoom-photos-panel/
  6. Ok, I solved this...)) thank you.. It's amazing... now I want that when a thumb is clicked it fade in (and load a big picture), and when clicked again it fade out to it's place... I don't know how to write an OnClick function, becouse onClick image must tween and fade in I want it to act like this http://www.files.riacodes.com/flash_zoom-photos-panel/ code private function thumbsLoaded(e:LoaderEvent):void { //Setup Click Events for (var i:int = 0; i < xImgList.length(); i++) { var cdImg:ContentDisplay = LoaderMax.getContent("p"+(i+1)); cdImg.buttonMode = true; cdImg.addEventListener(MouseEvent.ROLL_OVER, onOver); cdImg.addEventListener(MouseEvent.ROLL_OUT, onOut); cdImg.addEventListener(MouseEvent.CLICK, onClick); } } var glow:GlowFilter = new GlowFilter(0x999999, 1, 2, 2, 3, 255, false, false); private function onOver(e:MouseEvent):void { e.target.filters = [glow]; } private function onOut(e:MouseEvent):void { e.target.filters = []; } var zoom : MovieClip; private function onClick(e:MouseEvent):void { } } }
  7. Hi there. It's again me and my problems Well I have done tutorial by Zync. It's cool ar actually not so hard to understand. The thing I want to do is to position all my thumbs around the main image. And I want that when the gallery is opened it shows the first image in the mainHolder already. It's so uncool to see that space, before you pressed a thumb. so here is the code package { import com.greensock.events.LoaderEvent; import com.greensock.loading.XMLLoader; import com.greensock.loading.LoaderMax; import com.greensock.loading.ImageLoader; import com.greensock.loading.data.ImageLoaderVars; import com.greensock.loading.display.ContentDisplay; import com.greensock.TweenMax; import flash.display.Sprite; import flash.display.MovieClip; import flash.events.Event; import flash.events.EventDispatcher; import flash.events.MouseEvent; /** * ... * @author */ public class main extends Sprite { public var thumbHolder:MovieClip; public var mainHolder:MovieClip; private var xImgList:XMLList; public function main() { //Load XML var xPhotography:XMLLoader = new XMLLoader("photography.xml"); xPhotography.addEventListener(LoaderEvent.COMPLETE, xmlLoaded); xPhotography.load(); } private function xmlLoaded(e:LoaderEvent):void { var xData:XML = e.target.content; xImgList = new XMLList(xData.img); //setup loaderMax object var thumbLoader:LoaderMax = new LoaderMax( { name:"thumbLoader" } ); thumbLoader.addEventListener(LoaderEvent.COMPLETE, thumbsLoaded); //setup variables for ImageLoaderVars var nImgWidth:Number = 120; var nImgHeight:Number = 100; var nMaxCols:Number = 2; for (var i:int = 0; i < xImgList.length(); i++) { var iLoad:ImageLoader = new ImageLoader("images/thumbs/" + xImgList[i].@url, new ImageLoaderVars() .name(xImgList[i].@name) .width(nImgWidth) .height(nImgHeight) .smoothing(true) .container(thumbHolder) .x((i % nMaxCols) * nImgWidth) .y(int(i / nMaxCols) * nImgHeight) .scaleMode("proportionalOutside") .crop(true) .prop("index", i) .prop("url", xImgList[i].@url) .alpha(0) ) thumbLoader.append(iLoad); } thumbLoader.load(); } private function thumbsLoaded(e:LoaderEvent):void { //Setup Click Events for (var i:int = 0; i < xImgList.length(); i++) { var cdImg:ContentDisplay = LoaderMax.getContent("p" + (i + 1)); cdImg.buttonMode = true; cdImg.addEventListener(MouseEvent.CLICK, thumbClick); TweenMax.to(cdImg, 1, { autoAlpha:1, delay:(i * 0.2) } ); } } private function thumbClick(e:MouseEvent):void { var vars:Object = ImageLoader(e.currentTarget.loader).vars; checkOldImage(vars.index) } private function checkOldImage(index:Number):void { //check if there is already an image if (mainHolder.numChildren > 0) { var oldClip:Sprite = Sprite(mainHolder.getChildAt(0)); TweenMax.to(oldClip, 0.5, { autoAlpha:0, onComplete:function() { mainHolder.removeChildAt(0); loadImage(index) }} ) } else { loadImage(index); } } private function loadImage(index:Number):void { //Get filename var file:String = xImgList[index].@url; //Setup main Image loader var mainLoad:ImageLoader = new ImageLoader("images/main/" + file, new ImageLoaderVars() .width(500) .height(500) .y(300) .scaleMode("proportionalInside") .container(mainHolder) .smoothing(true) .alpha(50) ) //setup EventListeners mainLoad.addEventListener(LoaderEvent.COMPLETE, imageLoaded); mainLoad.load(); } private function imageLoaded(e:LoaderEvent):void { var imgClip:ContentDisplay = LoaderMax.getContent(e.currentTarget.name); TweenMax.to(imgClip, 0, { colorTransform: { exposure:2 }} ); TweenMax.to(imgClip, 1.5, { colorTransform: { exposure:1 },autoAlpha:1} ); } } }
  8. Hey, thank you. i'm new to flash, actually, I'm not a programmer. So I'm trying to use zync gallery tutorial for this... I tried to addChild, but that doesn't help... I think something is wrong with my code
  9. Hello I'm stuck on my project, I don't know how to add buttonMode true in my gallery and somehow it doesn't loop for all the images in XML. it starts not from first image, it starts from second. Please help me! Code is in class "main" package { import com.greensock.events.LoaderEvent; import com.greensock.loading.XMLLoader; import com.greensock.loading.LoaderMax; import com.greensock.loading.ImageLoader; import com.greensock.loading.data.ImageLoaderVars; import com.greensock.loading.display.ContentDisplay; import flash.display.Sprite; import flash.display.MovieClip; import flash.events.Event; import flash.events.EventDispatcher; /** * ... * @author */ public class main extends MovieClip { private var xImgList:XMLList; public function main() { //Load XML var xPhotography:XMLLoader = new XMLLoader("photography.xml"); xPhotography.addEventListener(LoaderEvent.COMPLETE, xmlLoaded); xPhotography.load(); } private function xmlLoaded(e:LoaderEvent):void { var xData:XML = e.target.content; xImgList = new XMLList(xData.img); //setup loader max object var thumbLoader:LoaderMax = new LoaderMax( { name:"thumbLoader" } ); thumbLoader.addEventListener(LoaderEvent.COMPLETE, thumbsLoaded); //setup variables for ImageLoaderVars var nImgWidth:Number = 100; var nImgHeight:Number = 72; var nMaxCols:Number = 4; for (var i:int = 0; i < xImgList.length(); i++) { var iLoad:ImageLoader = new ImageLoader("images/thumbs/" + xImgList[i].@url, new ImageLoaderVars() .name(xImgList[i].@name) .width(nImgWidth) .height(nImgHeight) .smoothing(true) .container(galerijaTXT_mc.container_mc["p"+i] as MovieClip) .x(-50) .y(-20) ) thumbLoader.append(iLoad); } thumbLoader.load(); } private function thumbsLoaded(e:LoaderEvent):void { //Setup Click Events for (var i:int = 0; i < xImgList.length; i++) { var cdImg:ContentDisplay = LoaderMax.getContent["p"+(i+1)]; cdImg.buttonMode = true; } } } } animation (for my gallery) is in .fla file var galerijaTXT_clips = []; for (var i:Number = 1; i <=12; i++) { galerijaTXT_clips.push(galerijaTXT_mc.container_mc["p"+i] as MovieClip); mv.addLabel("galerija_in", mv.duration); mv.append(TweenMax.to(galerijaTXT_mc.container_mc, 0, {alpha:1, immediateRender:false, onStart:setSection, onStartParams:["galerija"]})); mv.append(TweenMax.from(galerijaTXT_mc.galerijos_mc, .5, {x:"100", alpha:0})); mv.appendMultiple(TweenMax.allFrom(galerijaTXT_clips, .5, {y:"50", alpha:0}, .1)); mv.addLabel("galerija_complete", mv.duration); mv.appendMultiple(TweenMax.allTo(galerijaTXT_clips, .5, {scaleX:4, scaleY:4, alpha:0}, .1)); mv.insert(TweenMax.to(galerijaTXT_mc, 1, {alpha:0}), mv.duration -1); My XML structure <?xml version="1.0" encoding="utf-8" ?>
  10. Hello, i'm new here. i want to ask you how to make these buttons to load and unload external swf? I know hot to do this with with usual buttons, but not with movie clips ;\ I tried and tried but nothing helps... Please answer me...
×