hi,
I am doing this project for a friend unpaid and the deadline is very tight. Id love somebody to help me.
Ive got a code that a couple of guys here cooked up for me a while ago for a photogallery. For a series of buttons when pressed, it increases the alpha of a box to 100% to block out a photo. it then swaps this photo for another one (corresponding to the button pressed)…when that has loaded it decreases the alpha of the box to 0% to reveal the new photo. I would like to edit this to add a corresponding body of text for each photo that is also dynamically loaded and then revealed by the same white box. Any one help me?
/*****************
IMPORTS
/
import mx.transitions.Tween;
import mx.transitions.easing.*;
/
VARS
/
var button_tween:Object;
var container_mcl:MovieClipLoader = new MovieClipLoader();
var mcl_listener:Object = new Object();
var number_of_images:Number = 5;
/
EVENTS
/
mcl_listener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number):Void {
var percentage:Number = Math.round((loadedBytes/totalBytes) * 100);
trace (percentage + “% loaded”);
}
mcl_listener.onLoadComplete = function(target_mc:MovieClip) {
button_tween = new Tween(target_mc._parent.white_block, “_alpha”, Strong.easeInOut, 100, 0, 24, false);
}
/
FUNCS
/
function initiate_button_events():Void {
for (var i:Number = 0; i<number_of_images; i++) {
var targetButton_mc:MovieClip = this[“button_”+i];
targetButton_mc.imageID = i;
targetButton_mc.onRelease = function():Void {
button_tween = new Tween(this._parent.white_block, “_alpha”, Strong.easeInOut, 0, 100, 24, false);
var obj=this
button_tween.onMotionFinished = function():Void {
var image_to_load:String = “image”+obj.imageID+".jpg";
container_mcl.loadClip(image_to_load,container_mc);
};
};
}
}
/
RUN, *****!
*****************/
loadVariables(“text0.txt”,"_root.textbox_mc");
container_mc.loadMovie(“image0.jpg”);
initiate_button_events()
white_block._alpha = 0;
container_mcl.addListener(mcl_listener);
stop();