PDA

Volledige versie bekijken : button op mc verdwijnt na klik


caro1966
%Europe/Berlin %459 %2006, 12:01
Hallo allemaal, dit is waarschijnlijk iets simpels, maar ik kom er niet uit.
Ik heb een button op MC (btn staat op de hoofdtijdlijn, niet in MC). De MC heeft een onRelease functie. Als ik op MC klik is de button weg.
AS staat in het 1e frame op de hoofdtijdlijn.
Ik hoop dat er iemand kan helpen. Alvast bedankt.
Gr. Caroline

Hierbij de link naar het swf bestand:
http://www.caroscopyright.nl/colums.swf
Hieronder de code van de mc en button:

stop();

button1.onRelease = function() {
getURL("http://www.caroscopyright.nl/francien/index.html", _blank);
}


myMC1_mc.onRelease = function() {
this.swapDepths(getNextHighestDepth());
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);
} // end if
} // End of the function
function updateSlide(newSlideNode) {
imagePath = newSlideNode.attributes.jpegURL;
slideText = newSlideNode.firstChild.nodeValue;
loadMovie(imagePath, targetClip);
} // End of the function
gotoAndStop(20);
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("slides3.xml");
slides_xml.ignoreWhite = true;
next_btn.onRelease = function() {
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
} else {
++currentIndex;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
} // end if
};
back_btn.onRelease = function() {
previousSlideNode = currentSlideNode.previousSibling;
if (previousSlideNode == null) {
} else {
--currentIndex;
currentSlideNode = previousSlideNode;
updateSlide(previousSlideNode);
} // end if
};
};


myMC2_mc.onRelease = function() {
this.swapDepths(getNextHighestDepth());
}

myMC3_mc.onRelease = function() {
this.swapDepths(getNextHighestDepth());
}

rackdoll
%Europe/Berlin %529 %2006, 13:42
de button verdwijnt omdat hij achter alle vlakken wordt gezet... ik kijk effe naar je code maar dat is in ieder geval wat er fout gaat..

rackdoll
%Europe/Berlin %532 %2006, 13:46
Je moet zorgen dat je de knop meestuurt als je de depth swapt
myMC2_mc.onRelease = function() {
this.swapDepths(getNextHighestDepth());
this._parent.button1.swapDepths(getNexthighestDept h());
}

kijk eens of dit werkt..
als het werkt moet je hem dus zoo toevoegen bij elke onrelease

caro1966
%Europe/Berlin %551 %2006, 14:14
Nee helaas, hij blijft niet staan.
wel als ik eerst op de andere twee klik, maar klik ik nog een keer op de eerste, dan is de button weer weg.

Ik heb trouwens ook geprobeerd om de button in de movieclip te zetten, zodat hij mee "swap depth". Als ik de button dan de normale code mee geef:


button1.onRelease = function() {
getURL("http://www.caroscopyright.nl/francien/index.html", _blank);}


dan reageert hij niet. Moet ik dan terugverwijzen naar de hoofdtijdlijn met _root. of this._parent?
Gr. Caro