i’ve got a clip that’s being attached dynamically. within that clip is another clip. inside that clip is a button. below the button is an empty mc which loads a jpeg.
i’m trying (so far w/out success) to have both an onrollOver and an onRelease function for this button.
when the user clicks the button it should getURL to an URL i pass in dynamically. when the user mouses over it the mc that contains it should gotoAndPlay a certain frame (animation).
i can only seem to get one or the other to work properly.
orginally i had an “onRollOver” event coded directly on the button. That made my on release function (main timeline) cease working.
I’ve tried having both as functions and that doesn’t work either!
I also tried having a rollOver event on the movieclip that contains the button as well. that seems to cancell everything out…
anybody got any ideas?
stop();
getNews=new XML();
getNews.ignoreWhite=true;
var columns=1;
var list_spacing = 103;
//set .onLoad function for when xml loads
getNews.onLoad = function (success)
{
if (success)
{
newsItems = getNews.firstChild.childNodes;
//trace(newsItems);
for (var i=0; i<newsItems.length; i++) {
item = _root.contentA_mc.holderMc.attachMovie("listClip", "listClip" + i, i);
item._x = (i%columns)*list_spacing;
item._y = Math.floor(i/columns)*list_spacing;
item.index=i;
trace(item.index);
stopFrame = newsItems*.attributes.stopframe;
item.actionType = newsItems*.attributes.actiontype;
actionA = newsItems*.attributes.action;
//trace(actionA);
//trace(stopFrame);
item.gotoAndStop(stopFrame);
imagetoload = newsItems*.attributes.image;
isLinked = newsItems*.attributes.link;
//trace(isLinked);
if(isLinked=="true"){item.linkButtonMc.gotoAndStop("link");}
else if(isLinked=="false"){item.linkButtonMc.gotoAndStop("nolink");}
//determine if link is getURL or actionscript
if(item.actionType=="url"){
item.linkButtonMc.linkButton.onRelease = function(){
this.action= newsItems[this._parent._parent.index].attributes.action;
getURL(this.action, "_blank");
};
item.thumbHolder.thumbButton.onRelease = function(){
trace("buttonclicked!!!");
this.action= newsItems[this._parent._parent.index].attributes.action;
//trace(this.action);
getURL(this.action, "_blank");
}}else{
item.linkButtonMc.linkButton.onRelease = function(){
this.action= newsItems[this._parent.index].attributes.action;
action;}
item.thumbHolder.thumbButton.onRelease = function(){
this.action= newsItems[this._parent.index].attributes.action;
action;}
};
newsHeadline = newsItems*.attributes.headline;
newsDate = newsItems*.attributes.date;
theNews = newsItems*.firstChild.nodeValue;
item.newsText.text = theNews;
item.headlineText.text = newsHeadline;
item.dateText.text = newsDate;
item.imageHolder.loadMovie(imagetoload);
gotoAndStop("display");
}
}
}
//trigger xml load
getNews.load("xml/news.xml");
gotoAndStop("loading");