by Woocifer » Fri Dec 14, 2007 12:45 am
Hey there,
Thanks for responding so quickly, I really appreciate it!!
Okay so I'm using this code in the root stage to create the Full Flash Browser:
import flash.display.BitmapData;
mainmov._x = Stage.width / 2;
mainmov._y = Stage.height / 2;
var tile:BitmapData = BitmapData.loadBitmap ("tile");
function fillBG () {
this.beginBitmapFill (tile);
this.moveTo (0,0);
this.lineTo (Stage.width,0);
this.lineTo (Stage.width,Stage.height);
this.lineTo (0,Stage.height);
this.lineTo (0,0);
this.endFill ();
}
fillBG ();
var stageL:Object = new Object ();
stageL.onResize = function () {
fillBG ();
mainmov._x = Stage.width / 2;
mainmov._y = Stage.height / 2;
}
Stage.addListener(stageL) ;
And then as a library object I have a rectangular movie clip called holder in the library that is placed within another movie clip called mainmov that centers in the root clip as you can see above.
The code I have on that 'holder' instance is this, from your tutorial:
#include "mc_tween2.as"
//this.createEmptyMovieClip("holder",100);
holder._alpha = 0;
var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();
mclL.onLoadInit = function() {
//var centerX:Number = holder._width /2;
//var centerY:Number = holder._height /2;
//holder._x = (Stage.width / 2) - centerX;
//holder._y = (Stage.height / 2) - centerY;
loadText.text = "";
holderIn();
imageNav();
}
mclL.onLoadProgress = function (target,bytesLoaded,bytesTotal) {
var loaded:Number = bytesLoaded;
var total:Number = bytesTotal;
var percent:Number = Math.round((loaded/total) * 100);
loadTxt.text = percent + "&";
if(percent<50) {
loadTxt._alpha = percent * 2;
} else if (percent >= 50) {
loadTxt._alpha = 200 - (percent * 2);
}
}
var xml:XML = new XML();
xml.ignoreWhite=true;
var whoIsOn:Number;
var images:Array = new Array();
var captions:Array = new Array();
xml.onLoad = function(success) {
if (success) {
var nodes = xml.firstChild.childNodes;
for (var i:Number = 0;i<nodes.length;i++){
images.push (nodes[i].attributes.src);
captions.push(nodes[i].attributes.caption);
}
}
whoIsOn = 0;
loadImage();
}
xml.load("images.xml");
function loadImage() {
mcl.loadClip(images[whoIsOn],holder);
mcl.addListener(mclL);
}
function holderIn() {
holder.alphaTo(100,1,"linear");
captionTxt.text = captions[whoIsOn];
}
function imageNav() {
holder.onRelease = function() {
captionTxt.text = "";
holder.alphaTo(0,1,"linear");
holder.onTweenComplete = function () {
if(whoIsOn == images.length - 1) {
whoIsOn = 0;
} else if(whoIsOn < images.length - 1) {
whoIsOn++;
}
loadImage();
}
}
}
I've commented out the certain lines of code that you, in a previous post, said to comment out when using a pre-existing instance in the library as the holder for the image loader.
Am I going nuts? screwing up with the code? A complete and utter noob? heh
I would appreciate any of your help.
Thanks bro!
Dennis