I need some major help! I am trying to complete this thing today and I am sooo close!
I had a bunch of internal code that worked all fine to make an image gallery with motion and forward and back buttons etc. I turn it into external code and it does not work anymore. I am not getting any errors anymore but its not doing anything when I publish! I have gone over the code many times trying to figure out what is wrong but now I am about to explode - I am not sure where to look or what do do!
If you would be willing to review my code and if you find something to dubug me I will be forever greatful!!!
I have included notes in the code to give you more info to think with.
[AS]//this .as file is in the same folder as the .fla file
//so in the properties panel of the .fla I do not have a document class specified.
//I also have both the .fla and .as files open in CS4 and the “Target” is directed towards the .fla
package imageGallery{
import com.pixelfumes.reflect.*;
import flash.display.*;
import flash.events.*;
import flash.utils.clearInterval;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.display.Loader;
import gs.TweenMax;
import gs.easing.*;
public class ImageGallery extends Sprite {
public var xmlRequest:URLRequest = new URLRequest("imageData.xml");
public var xmlLoader:URLLoader = new URLLoader();
public var imgData:XML;
public var imageReflect:Reflect;
public var imageLoader:Loader;
public var rawImage:String;
public var rawH:String;
public var rawW:String;
public var imgNum:int = 0;
public var lastImageIndex:int = 0;
public var imageLoaderHost:MovieClip;
public function ImageGallery(event:Event):void {
xmlLoader.addEventListener(Event.COMPLETE, xmlLoadedF);
xmlLoader.load(xmlRequest);
}
public function xmlLoadedF(event:Event):void {
imgData = new XML(event.target.data);
packagedF();
}
//Loads picture:
public function packagedF(e:Event = null):void {
rawImage = imgData.image[imgNum].imgURL;
lastImageIndex = imgData.*.length() - 1;
rawW = imgData.image[imgNum].imgW;
rawH = imgData.image[imgNum].imgH;
imageLoaderHost = new MovieClip;
imageLoader = new Loader;
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadCompleteHandler);
imageLoader.load(new URLRequest(rawImage));
//I have master_mc on the stage as a movieclip exported with a class name of Picture_mc.
//“master_mc” is the instance name that I used when it was internal code.
master_mc.addChild(imageLoaderHost);
imageLoaderHost.addChild(imageLoader);
imageLoaderHost.y = (stage.stageHeight - Number(rawH)) /5;
imageLoaderHost.x = 1500;
TweenMax.to(imageLoaderHost, 1.5, {x:(stage.stageWidth - Number(rawW)) /1.59, y:(stage.stageHeight - Number(rawH)) /5, ease:Quad.easeInOut});
TweenMax.from(imageLoader, 1.5, {blurFilter:{blurX:100}});
imageLoader.scaleX = .75;
imageLoader.scaleY = .75;
}
public function loadCompleteHandler(event:Event) {
imageLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, loadCompleteHandler);
imageReflect = new Reflect({mc:imageLoaderHost,alpha:50,ratio:50,distance:1,updateTime:2,reflectionDropoff:2});
}
}
} [/AS]