vi prego, ogni suggerimento mi sarà utile.
Ci sto sbattendo la testa da giorni, ma non riesco ad uscirne.
cortesemente spero possiate aiutarmi.
se vi collegate a questo sito
http://www.nartdesign.com/paolo/
e cliccate su photogallery come vedete non appare nulla, se non lo scroll bar che x fi più è spostato piu a destra d dove dovrebbe essere. COme mai?
io ho l'swf principale "index.swf" con il menu. Ogni bottone del menu m carica un altro swf che ha qst posizione:
this._x = 20;
this._y = 215;
funzionano tutte le pagine, la gallery no!
ma x quale razza di motivo?
è stata fatta nel medesimo modo delle altre pagine
nel swf della gallery nel prim oframe della time line ho inserito qst codice:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var myGalleryXML = new XML();
myGalleryXML.ignoreWhite = true;
myGalleryXML.load("gallery.xml");
myGalleryXML.onLoad = function() {
_root.gallery_width = myGalleryXML.firstChild.attributes.width;
_root.gallery_height = myGalleryXML.firstChild.attributes.height;
_root.gallery_y = myGalleryXML.firstChild.attributes.y;
_root.spacing = myGalleryXML.firstChild.attributes.vertical_spacing;
_root.bar_y = Number(_root.gallery_height)+Number(_root.spacing);
_root.bar_thickness = myGalleryXML.firstChild.attributes.bar_thickness;
_root.scroller_width = _root.bar_thickness*2;
_root.image_width = myGalleryXML.firstChild.attributes.image_width;
_root.myImages = myGalleryXML.firstChild.childNodes;
_root.myImagesTotal = _root.myImages.length;
createContainer();
callImages();
masking();
scrollbar();
scroller();
};
function createContainer() {
_root.myGallery_mc = _root.createEmptyMovieClip("myGallery_mc", _root.getNextHighestDepth());
_root.myGallery_mc._y = _root.gallery_y;
_root.myGallery_mc._x = (Stage.width-_root.gallery_width)/2;
}
function callImages() {
_root.myImages_mc = _root.myGallery_mc.createEmptyMovieClip("myImages_mc", _root.myGallery_mc.getNextHighestDepth());
var myMCL:MovieClipLoader = new MovieClipLoader();
for (i=0; i<_root.myImagesTotal; i++) {
imageURL = _root.myImages.attributes.url;
image_mc = _root.myImages_mc.createEmptyMovieClip(i, _root.myImages_mc.getNextHighestDepth());
image_mc._x = _root.image_width*i;
myMCL.loadClip(imageURL,image_mc);
}
}
function masking() {
_root.myMask_mc = _root.myGallery_mc.createEmptyMovieClip("myMask_mc", _root.myGallery_mc.getNextHighestDepth());
_root.myMask_mc.beginFill(0x000000,100);
_root.myMask_mc.lineTo(_root.gallery_width,0);
_root.myMask_mc.lineTo(_root.gallery_width,_root.gallery_height);
_root.myMask_mc.lineTo(0,_root.gallery_height);
_root.myMask_mc.lineTo(0,0);
_root.myMask_mc.endFill();
_root.myImages_mc.setMask(_root.myMask_mc);
}
function scrollbar() {
_root.scrollbar_mc = _root.myGallery_mc.createEmptyMovieClip("scrollbar_mc", _root.myGallery_mc.getNextHighestDepth());
_root.scrollbar_mc._y = _root.bar_y;
_root.scrollbar_mc.beginFill(0x000000,100);
_root.scrollbar_mc.lineTo(gallery_width,0);
_root.scrollbar_mc.lineTo(gallery_width,_root.bar_thickness);
_root.scrollbar_mc.lineTo(0,_root.bar_thickness);
_root.scrollbar_mc.lineTo(0,0);
_root.scrollbar_mc.endFill();
_root.scrollbar_mc.onPress = function() {
_root.scroller_mc._x = this._xmouse;
if (_root.scroller_mc._x>(this._width-_root.scroller_mc._width)) {
_root.scroller_mc._x = this._width-_root.scroller_mc._width;
}
mover();
};
}
function scroller() {
_root.scroller_mc = _root.myGallery_mc.createEmptyMovieClip("scroller_mc", _root.myGallery_mc.getNextHighestDepth());
_root.scroller_mc._y = _root.bar_y;
_root.scroller_mc.beginFill(0x660000,100);
_root.scroller_mc.lineTo(_root.scroller_width,0);
_root.scroller_mc.lineTo(_root.scroller_width,_root.bar_thickness);
_root.scroller_mc.lineTo(0,_root.bar_thickness);
_root.scroller_mc.lineTo(0,0);
_root.scroller_mc.endFill();
_root.scroller_mc.onPress = function() {
startDrag(this, false, 0, this._y, _root.scrollbar_mc._width-this._width, this._y);
moverInterval = setInterval(mover,250);
};
_root.scroller_mc.onRelease = _root.scroller_mc.onReleaseOutside=function () {
stopDrag();
clearInterval(moverInterval);
mover();
};
}
function mover() {
var scrollerLocation = _root.scroller_mc._x/(_root.scrollbar_mc._width-_root.scroller_mc._width);
var galleryLocation = scrollerLocation*(_root.myMask_mc._width-_root.myImages_mc._width);
new Tween(_root.myImages_mc, "_x", Strong.easeOut, _root.myImages_mc._x, galleryLocation, 1.5, true);
}
ho il mio file xml che m richiama le img:
<?xml version="1.0" encoding="utf-8" ?>
- <gallery x="10" y="40" width="910" height="266" image_width="376" vertical_spacing="10" bar_thickness="10">
<image url="images/1.jpg" />
<image url="images/2.jpg" />
<image url="images/3.jpg" />
<image url="images/4.jpg" />
<image url="images/5.jpg" />
<image url="images/6.jpg" />
<image url="images/7.jpg" />
<image url="images/8.jpg" />
<image url="images/9.jpg" />
<image url="images/10.jpg" />
<image url="images/11.jpg" />
<image url="images/12.jpg" />
<image url="images/13.jpg" />
<image url="images/14.jpg" />
</gallery>
la mia cartella "IMAGE" contenente le img..
e ora qualche luminare m spiega che nn va bene?????
la gallery se la lancio in locale funziona perfettamente, si visualizzano pure le img.
Se la carica dentro l'swf principale, si visualizzano le img ma sempre nn tiene la posizione data, se pubblico il sito, non si vedono nè le img nè la posizione.
Spero che qlc possa aiutarmi seriamente perchè non so più dove sbattere la testa... e mi viene da piangere...
grazie x tutto quello chefarete, x tt quello che direte.
Nadia
Ci sto sbattendo la testa da giorni, ma non riesco ad uscirne.
cortesemente spero possiate aiutarmi.
se vi collegate a questo sito
http://www.nartdesign.com/paolo/
e cliccate su photogallery come vedete non appare nulla, se non lo scroll bar che x fi più è spostato piu a destra d dove dovrebbe essere. COme mai?
io ho l'swf principale "index.swf" con il menu. Ogni bottone del menu m carica un altro swf che ha qst posizione:
this._x = 20;
this._y = 215;
funzionano tutte le pagine, la gallery no!
ma x quale razza di motivo?
è stata fatta nel medesimo modo delle altre pagine
nel swf della gallery nel prim oframe della time line ho inserito qst codice:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var myGalleryXML = new XML();
myGalleryXML.ignoreWhite = true;
myGalleryXML.load("gallery.xml");
myGalleryXML.onLoad = function() {
_root.gallery_width = myGalleryXML.firstChild.attributes.width;
_root.gallery_height = myGalleryXML.firstChild.attributes.height;
_root.gallery_y = myGalleryXML.firstChild.attributes.y;
_root.spacing = myGalleryXML.firstChild.attributes.vertical_spacing;
_root.bar_y = Number(_root.gallery_height)+Number(_root.spacing);
_root.bar_thickness = myGalleryXML.firstChild.attributes.bar_thickness;
_root.scroller_width = _root.bar_thickness*2;
_root.image_width = myGalleryXML.firstChild.attributes.image_width;
_root.myImages = myGalleryXML.firstChild.childNodes;
_root.myImagesTotal = _root.myImages.length;
createContainer();
callImages();
masking();
scrollbar();
scroller();
};
function createContainer() {
_root.myGallery_mc = _root.createEmptyMovieClip("myGallery_mc", _root.getNextHighestDepth());
_root.myGallery_mc._y = _root.gallery_y;
_root.myGallery_mc._x = (Stage.width-_root.gallery_width)/2;
}
function callImages() {
_root.myImages_mc = _root.myGallery_mc.createEmptyMovieClip("myImages_mc", _root.myGallery_mc.getNextHighestDepth());
var myMCL:MovieClipLoader = new MovieClipLoader();
for (i=0; i<_root.myImagesTotal; i++) {
imageURL = _root.myImages.attributes.url;
image_mc = _root.myImages_mc.createEmptyMovieClip(i, _root.myImages_mc.getNextHighestDepth());
image_mc._x = _root.image_width*i;
myMCL.loadClip(imageURL,image_mc);
}
}
function masking() {
_root.myMask_mc = _root.myGallery_mc.createEmptyMovieClip("myMask_mc", _root.myGallery_mc.getNextHighestDepth());
_root.myMask_mc.beginFill(0x000000,100);
_root.myMask_mc.lineTo(_root.gallery_width,0);
_root.myMask_mc.lineTo(_root.gallery_width,_root.gallery_height);
_root.myMask_mc.lineTo(0,_root.gallery_height);
_root.myMask_mc.lineTo(0,0);
_root.myMask_mc.endFill();
_root.myImages_mc.setMask(_root.myMask_mc);
}
function scrollbar() {
_root.scrollbar_mc = _root.myGallery_mc.createEmptyMovieClip("scrollbar_mc", _root.myGallery_mc.getNextHighestDepth());
_root.scrollbar_mc._y = _root.bar_y;
_root.scrollbar_mc.beginFill(0x000000,100);
_root.scrollbar_mc.lineTo(gallery_width,0);
_root.scrollbar_mc.lineTo(gallery_width,_root.bar_thickness);
_root.scrollbar_mc.lineTo(0,_root.bar_thickness);
_root.scrollbar_mc.lineTo(0,0);
_root.scrollbar_mc.endFill();
_root.scrollbar_mc.onPress = function() {
_root.scroller_mc._x = this._xmouse;
if (_root.scroller_mc._x>(this._width-_root.scroller_mc._width)) {
_root.scroller_mc._x = this._width-_root.scroller_mc._width;
}
mover();
};
}
function scroller() {
_root.scroller_mc = _root.myGallery_mc.createEmptyMovieClip("scroller_mc", _root.myGallery_mc.getNextHighestDepth());
_root.scroller_mc._y = _root.bar_y;
_root.scroller_mc.beginFill(0x660000,100);
_root.scroller_mc.lineTo(_root.scroller_width,0);
_root.scroller_mc.lineTo(_root.scroller_width,_root.bar_thickness);
_root.scroller_mc.lineTo(0,_root.bar_thickness);
_root.scroller_mc.lineTo(0,0);
_root.scroller_mc.endFill();
_root.scroller_mc.onPress = function() {
startDrag(this, false, 0, this._y, _root.scrollbar_mc._width-this._width, this._y);
moverInterval = setInterval(mover,250);
};
_root.scroller_mc.onRelease = _root.scroller_mc.onReleaseOutside=function () {
stopDrag();
clearInterval(moverInterval);
mover();
};
}
function mover() {
var scrollerLocation = _root.scroller_mc._x/(_root.scrollbar_mc._width-_root.scroller_mc._width);
var galleryLocation = scrollerLocation*(_root.myMask_mc._width-_root.myImages_mc._width);
new Tween(_root.myImages_mc, "_x", Strong.easeOut, _root.myImages_mc._x, galleryLocation, 1.5, true);
}
ho il mio file xml che m richiama le img:
<?xml version="1.0" encoding="utf-8" ?>
- <gallery x="10" y="40" width="910" height="266" image_width="376" vertical_spacing="10" bar_thickness="10">
<image url="images/1.jpg" />
<image url="images/2.jpg" />
<image url="images/3.jpg" />
<image url="images/4.jpg" />
<image url="images/5.jpg" />
<image url="images/6.jpg" />
<image url="images/7.jpg" />
<image url="images/8.jpg" />
<image url="images/9.jpg" />
<image url="images/10.jpg" />
<image url="images/11.jpg" />
<image url="images/12.jpg" />
<image url="images/13.jpg" />
<image url="images/14.jpg" />
</gallery>
la mia cartella "IMAGE" contenente le img..
e ora qualche luminare m spiega che nn va bene?????
la gallery se la lancio in locale funziona perfettamente, si visualizzano pure le img.
Se la carica dentro l'swf principale, si visualizzano le img ma sempre nn tiene la posizione data, se pubblico il sito, non si vedono nè le img nè la posizione.
Spero che qlc possa aiutarmi seriamente perchè non so più dove sbattere la testa... e mi viene da piangere...
grazie x tutto quello chefarete, x tt quello che direte.
Nadia