Hallo ik ben voor een toeter vereniging uit de buurt een website aan het maken (vrijwillig)
En omdat ze graag een aantal foto's op de site willen hebben heb ik via FlashDen een Gallery gekocht welke werkt via een XML import bestand dit is redelijk makkelijk aan te passen en een kind kan straks de was doen hiermee.
Alleen nu zit bij dit gekochte bestand (voorbeeld) geen html bestand bij of een map-structuur, dus alles staat nu gewoon in de "hoofd FTP" map en omdat dit een rommeltje is op deze manier wil ik een apart mapje hiervoor maken.
Dus ik heb een map gemaakt "album" en daar alles ingezet wat met de flash gallery te maken heeft.
Daarna heb ik via DreamWeaver "Media >> .swf >> invoegen" gedaan.
Maar als ik ga testen zijn mijn foto's NIET zichtbaar, nu denk ik dat dit komt omdat de .swf niet weet dat hij het .xml bestand moet gaan zoeken in de map "album" Dus ben ik opzoek gegaan naar de broncode in de .fla bestand en nu zie ik een hoop Chinese taal in de ActionScript en nu weet ik niet waar ik mijn MAP moet toevoegen?
///parsing the xml and loading the images from outside
var xx:XML = new XML();
xx.ignoreWhite = true;
xx.onLoad = function() {
///creating an array and passing the same to two more functions
var arr:Array = new Array();
for (i=0; i<xx.firstChild.childNodes.length; i++) {
arr.push(xx.firstChild.childNodes[i].attributes.name);
}
/// below the number 3 is for 3 image icons at one line
len = xx.firstChild.childNodes.length/3;
/// bellow I am finding the height for the "movie" movieclip so that I can scroll it up
content_height=len*126;
// for creating the display and resizing the images
movie.createitems(arr);
movie.reseize(arr);
///scroll bar
dragger.useHandCursor = true;
friction = 0.3; // set this for distance move
speed = 4; //scrolling speed
y = dragger._y;
top = movie._y;
bottom = movie._y+mask_mc._height-content_height; /// getting the top and bottom to move
dragger.onPress = function() {
drag = true;
// drag area to be fixed
this.startDrag(false, this._x, this._parent.y, this._x, this._parent.y+this._parent.bar._height-this._height);
dragger.scrollEase();
};
dragger.onMouseUp = function() {
//stoping drag
this.stopDrag();
drag = false;
};
moveDragger = function (d) {
if ((dragger._y>=y+bar._height-dragger._height && d == 1) || (dragger._y<=y && d == -1)) {
clearInterval(myInterval);
// checking whether its top or buttom and then clearing the function
} else {
/// updating the y position
dragger._y += d;
dragger.scrollEase();
updateAfterEvent();
}
};
MovieClip.prototype.scrollEase = function() {
this.onEnterFrame = function() {
///finding the direction to move
if (Math.abs(dy) == 0 && drag == false) {
delete this.onEnterFrame;
}
r = (this._y-y)/(bar._height-this._height);
dy = Math.round((((top-(top-bottom)*r)-movie._y)/speed)*friction);
movie._y += dy;
};
};
up_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, -1);
};
down_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, 1);
};
up_btn.onMouseUp = down_btn.onMouseUp=function () {
clearInterval(myInterval);
};
////scroll bar
//mouse scroller
mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
dragger.scrollEase();
dragger._y = dragger._y-delta*5;
if (dragger._y<113) { //// fixing the up and down positions
dragger._y = 113;
}
if (dragger._y>bar._height-dragger._height+113) {
dragger._y = bar._height-dragger._height+113;
}
};
Mouse.addListener(mouseListener);
//mouse scroller
};
xx.load("pictures.xml");
function createitems(newarr) { /////creating the icons for the images
for (m=0; m<newarr.length; m++) {
duplicateMovieClip("mc", "mc"+m, m);
this["mc"+m].loadMovie(newarr[m]);
}
}
function reseize(mr) {
p = 0;
this.onEnterFrame = function() {
for (s=0; s<mr.length; s++) {
if (this["mc"+s]._width>1 && this["mc"+s]._height>1) {
this["mc"+s]._width = 150; ///// width of icon
this["mc"+s]._height = 100; ///// height of icon
mrl = Math.ceil(mr.length/3); ///// number of icons in a line
_parent.content_height = (mrl*126)+70;
for (i=0; i<mrl; i++) {
for (j=0; j<3; j++) { ///// j<number of icons in a line
this["mc"+p]._x = 35+j*170;
this["mc"+p]._y = 35+i*125;
p++;
}
}
this["mc"+s].no = s;
this["mc"+s].onPress = function() {
_parent.loadd.createEmptyMovieClip("pp", this.getNextHighestDepth()); ////creating a new movieclip and loading images in a new movieclip
_parent.loadd.pp.loadMovie(mr[this.no]); /// loading images
};
_parent.loadd.onPress=function(){
_parent.loadd.pp.unloadMovie(); ///unloading the movie while clicking
}
mc.setMask(mask_mc); /// setting mask
//delete this.onEnterFrame;
}
}
};
}