Thanks Matt. I just pasted the whole thing as its not too much code. Basically the disableBtn function creates the loader and urlRequest and the onOver function is what runs it.
Let me know if you need me to clarify anything else. Thanks again.
import caurina.transitions.Tweener;
//store the buttons in as an object for later use/reference.
var btn:Object;
var disabledBtn:Object;
//The currentPage / nextPage variable holds the movieclips we will load.
var currentPage:MovieClip = null;
var nextPage:MovieClip = null;
//the loader
var loader:Loader;
//which movieclip to load
var urlRequest:URLRequest;
//first we'll reference to all the buttons on the stage
var buttons:Array = new Array (b1, b2, b3, b4, b5, b6);
//this array holds all the names we want to use for our buttons
var button_name:Array = new Array ("Home", "About Us", "Selected Work", "References", "Jobs", "Contact");
//this array stores which swf we want to load
var swf_array:Array = new Array ("pic1.png","swf2.swf","swf3.swf","swf4.swf","swf5.swf","swf6.swf");
for (var i:String in buttons) {
//assign the button_name array to the textclip of our buttons
buttons[i].button_txt.txt.text = button_name[i];
buttons[i].alpha = .25;
//assign which swf we'll load for each of the buttons
buttons[i].currentPage = swf_array[i];
//declare that we'll use the movieclip as a button
buttons[i].buttonMode = true;
//make sure that the button_txt clip doesn't react to the mouse.
buttons[i].button_txt.mouseChildren = false;
//add the listeners for our buttons
buttons[i].addEventListener(MouseEvent.MOUSE_OVER,onOVER);
buttons[i].addEventListener(MouseEvent.MOUSE_OUT,onOUT);
}
function onOVER(event:MouseEvent):void {
btn = event.currentTarget;
//here we tween to the over color we've assigned earlier on with the variables.
Tweener.addTween(btn, {alpha:1, time: 1});
disableBtn(btn);
}
function onOUT(event:MouseEvent):void {
btn = event.currentTarget;
//TweenMax.to(btn , speed , {tint:colourOut, ease:motion});
Tweener.addTween(btn, {alpha:.25, time: 1});
}
function disableBtn(btn:Object):void {
//Create a new loader instance
loader = new Loader();
//add the currentPage variable to the url request
urlRequest = new URLRequest(btn.currentPage);
//load the url request
loader.load(urlRequest);
//once the file has been loaded we'll trigger the fileLoaded function
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, isLoaded);
}
function isLoaded(event:Event):void {
//The loader now contains the page we are going to display later on.
nextPage = event.target.content;
//check if there is a currentPage
if (currentPage != null) {
//tween the alpha to zero
Tweener.addTween(currentPage, {alpha:0, time: .3, onComplete: currentPageOut});
} else {
//if there is no currentPage we'll trigger the showNextPage function.
doNextPage();
}
}
function doNextPage():void {
//position the loaderclip as nextPage
nextPage.x = 238.0;
nextPage.y = 0;
//Tween the alpha to from 0 to 1
Tweener.addTween(currentPage, {alpha:1, time: .3});
//Add the next page to the stage
addChild(nextPage);
//Next page is now our current page,confusing? it isn't. We replace the next page with our current one.
currentPage = nextPage;
}
//Once the animation is completed we'll trigger this function
function currentPageOut():void {
//Remove the current page completely from the stage
removeChild(currentPage);
//Let's show the next page
doNextPage();
}
//don't place a stop command because we will directly land on frame 2.
stop();
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101:





by: matttroutPosted on 2009-08-10 at 09:11:41ID: 25061285
Well URL not found means that the image you are telling Flash to load an image at a certain path to which it can't find. I wasn't able to download your source files (work firewall), but could you possibly paste a snippet of code where you are calling your image?