Skip to main content
Inspiring
June 3, 2011
Question

Ease the transition

  • June 3, 2011
  • 1 reply
  • 536 views

How do I ease the photo transition?

myGalleryXML.onLoad = function() {

_root.gallery_x = myGalleryXML.firstChild.attributes.gallery_x;

_root.gallery_y = myGalleryXML.firstChild.attributes.gallery_y;

_root.gallery_width = myGalleryXML.firstChild.attributes.gallery_width;

_root.gallery_height = myGalleryXML.firstChild.attributes.gallery_height;

_root.myImages = myGalleryXML.firstChild.childNodes;

_root.myImagesTotal = myImages.length;

_root.thumb_height = myGalleryXML.firstChild.attributes.thumb_height;

_root.thumb_width = myGalleryXML.firstChild.attributes.thumb_width;

_root.full_x = myGalleryXML.firstChild.attributes.full_x;

_root.full_y = myGalleryXML.firstChild.attributes.full_y;

};

function callThumbs() {

var clipLoader = new MovieClipLoader();

var preloader = new Object();

clipLoader.addListener(preloader);

for (i=0; i<myImagesTotal; i++) {

thumbURL = myImages.attributes.thumb_url;

myThumb_mc = placeholder.placeholder2.createEmptyMovieClip(i, placeholder.placeholder2.getNextHighestDepth());

myThumb_mc._y = _root.thumb_height*i;

clipLoader.loadClip("http://www.myweb.org/photos/"+thumbURL,myThumb_mc);

preloader.onLoadStart = function(target) {

fullImg_mc.heading.selectable = false;

fullImg_mc.caption.selectable = false;

};

preloader.onLoadComplete = function(target) {

fullImg_mc.heading.text="";

fullImg_mc.caption.text="";

target.onRelease = function() {

callFullImage(this._name);

clearTimeout(srch1TO);

srch1TO=setTimeout(srch1F,6000);

}

function srch1F(){

}

}

}

}

function callFullImage(myNumber) {

fullImg_mc.heading.text = "";

fullImg_mc.caption.text = "";

percentClip.percentDisplay.text = "";

percentClip._visible =true;

myURL = myImages[myNumber].attributes.full_url;

myTitle = myImages[myNumber].attributes.heading;

myCaption = myImages[myNumber].attributes.title;

var fullClipLoader = new MovieClipLoader();

var fullPreloader = new Object();

fullClipLoader.addListener(fullPreloader);

fullPreloader.onLoadStart = function(target) {

fullImg_mc.heading.selectable = false;

fullImg_mc.caption.selectable = false;

};

fullPreloader.onLoadProgress = function(target, loadedBytes, totalBytes) {

bar._width = (loadedBytes/totalBytes)*310;

percentClip._x = bar._x + bar._width;

var percentage:Number = Math.round((loadedBytes/totalBytes)*100);

bar._xscale = percentage;

percentClip.percentDisplay.text = percentage + "%";

if (loadedBytes >= totalBytes) {

percentClip._visible = false;

}

};

fullClipLoader.loadClip("http://www.myweb.org/photos/"+myURL,fullImg_mc.fullImage_mc);

}

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
June 3, 2011

what transition?


Inspiring
June 6, 2011

The 2 sections highlighted in bold. All I need is to make the images always appear/load easy and smooth over the previously loaded image.

Thanks Kglad.

import mx.transitions.Tween;

import mx.transitions.easing.*;

var urls:Array = new Array();

var captions:Array = new Array();

var headings:Array = new Array();

var imgNow:Number;

var myGalleryXML = new XML();

myGalleryXML.ignoreWhite = true;

myGalleryXML.load("http://www.myweb.com/gallery.xml);

myGalleryXML.onLoad = function() {

_root.myImages = myGalleryXML.firstChild.childNodes;

_root.myImagesTotal = myImages.length;

var photos:Array = this.firstChild.childNodes;

for(i=0;i<9; i++) {

urls.push(photos.attributes.full_url);

captions.push(photos.attributes.title);

headings.push(photos.attributes.heading);

}

_root.holder.loadMovie(urls[0]);

_root.caption.text = captions[0];

_root.heading.text = headings[0];

imgNow = 0;

callThumbs();

createMask();

scrolling();

myShow();

};

function callThumbs() {

var clipLoader = new MovieClipLoader();

var preloader = new Object();

clipLoader.addListener(preloader);

for (i=0; i<myImagesTotal; i++) {

thumbURL = myImages.attributes.thumb_url;

myThumb_mc = placeholder.placeholder2.createEmptyMovieClip(i, placeholder.placeholder2.getNextHighestDepth());

myThumb_mc._y = _root.thumb_height*i;

clipLoader.loadClip(thumbURL,myThumb_mc);

preloader.onLoadComplete = function(target) {

target.onRelease = function() {

callFullImage(this._name);

clearTimeout(srch1TO);

srch1TO=setTimeout(srch1F,6000);

fullImg_mc._visible = true;

}

function srch1F(){

fullImg_mc._visible=false;

};

}

}

}

function callFullImage(myNumber) {

fullImg_mc.heading.text = "";

fullImg_mc.caption.text = "";

myURL = myImages[myNumber].attributes.full_url;

myTitle = myImages[myNumber].attributes.heading;

myCaption = myImages[myNumber].attributes.title;

var fullClipLoader = new MovieClipLoader();

var fullPreloader = new Object();

fullClipLoader.addListener(fullPreloader);

fullPreloader.onLoadProgress = function(target, loadedBytes, totalBytes) {

bar._width = (loadedBytes/totalBytes)*310;

percentClip._x = bar._x + bar._width;

var percentage:Number = Math.round((loadedBytes/totalBytes)*100);

bar._xscale = percentage;

percentClip.percentDisplay.text = percentage + "%";

if (loadedBytes >= totalBytes) {

percentClip._visible = false;

}

};

fullPreloader.onLoadComplete = function(target) {

fullImg_mc.heading.text = myTitle;

fullImg_mc.caption.text = myCaption;

};

fullClipLoader.loadClip(myURL,fullImg_mc.fullImage_mc);

}

function myShow() {

     if(imgNow < urls.length-1) {

          imgNow++;

     } else {

          imgNow = 0;

     }

_root.heading.text = "";

_root.caption.text = "";

    _root.holder.loadMovie(urls[imgNow]);

    _root.caption.text = captions[imgNow];

_root.heading.text = headings[imgNow];

}

var IntervalID = setInterval(myShow, 6000);

kglad
Community Expert
Community Expert
June 6, 2011

there's no transition, at all.  there's no way to add easing to a non-existant transition.

use the flash tween class or one of the 3rd party tween classes to add a transition of some type.