Hey again!
I again came across a new problem (something that I dont know how to solve) so here’s the deal:
I’m making a website that dynamically loads images from an array, like a slideshow. Now I want to load external SWF’s (instead of JPG’s) from an array.
So what I thought was obvious, is to change the array from “image.jpg” into “movie.swf” but that didnt work ofcourse. I checked my AS Cookbook and it says that I need to use AttachMovie for this. Awesome! But… HOW do I add that to my current code? Help!
Here’s what I have now (I changed the existing image array to what i thought was right):
this.pathToPrint = "images/graphic/print/";
photo = function(picture, caption) {
this.picture = picture;
this.caption = caption;
}
printArray = new Array();
objPhoto = new photo("project3.swf", "project 3 beatrixhoofd");
printArray.push(objPhoto);
objPhoto = new photo("clavers.swf", "clavers brochure");
printArray.push(objPhoto);
objPhoto = new photo("bla.swf", "caption");
printArray.push(objPhoto);
trace(printArray);
//
// sliding code
easeSpeed = 3;
var xMove = numb1._x;
slider.onEnterFrame = function() {
this._x += (xMove-this._x)/easeSpeed;
};
for (var i = 1; i<=26; i++) {
but = this["numb"+i];
but.id = i;
but.onPress = function() {
xMove = this._x;
changePhoto(this.id-1);
};
// visited button color changing
but.onRollOver = function () {
//assign a var to this buttons name and ful path on RollOver
getButName = this;
}
but.onRelease = function () {
//make sure the name of the btn has been assigned in the RollOver
trace(getButName);
getButName._alpha = 40;
//do a color tint instead of alpha property
//btnColor = new Color(getButName);
//btnColor.setRGB(0xFF0000);
}
//end
}
next_btn.onRelease = function() {
this._parent.printIndex<this._parent.printArray.length-1 ? this._parent.printIndex++ : this._parent.printIndex=0;
changePhoto(this._parent.printIndex);
xMove = this._parent["numb"+(this._parent.printIndex+1)]._x
};
back_btn.onRelease = function() {
this._parent.printIndex>0 ? this._parent.printIndex-- : this._parent.printIndex=this._parent.printArray.length-1;
changePhoto(this._parent.printIndex);
xMove = this._parent["numb"+(this._parent.printIndex+1)]._x
};
changePhoto(0);
Also, when attaching an external SWF… how do you tell it Where to load exactly? Like x and y? Or do you have to load them in a movieHolder? That seems obvious…
Thanks
ps: let me know if you want to have the FLA (mx or mx2004)