I have a flash movie in which on main scene I add a scrollPane, and at runtime, I add a MovieClip on scrollpane. This movieclip has no instance on stage, but I pick it from Library.
On this library movie clip (say movie x) I have another movieclips and Dynamic text boxes placed that i set when I add the movie clip on scrollpane.
Now, I want to capture mouseover on these movieclip, such that when a user mouseover on these dynamically added movie on Scroll Pane, will be replaced with another movie clip (in library) or give new look to existing.
import mx.xpath.XPathAPI;
var rss:XML = new XML();
rss.ignoreWhite = true;
var mergerbg_as:MovieClip= new MovieClip();
mergerbg_sp.contentPath = "merger_bg";
mergerbg_as = mergerbg_sp.content ;
rss.onLoad = function(success:Boolean) {
if (success) {
// Retrieve all titles in the path /rss/channel/item/title.
var titleArray:Array = XPathAPI.selectNodeList(this.firstChild, "/root/product");
var j:Number;
j=0;
for (var i:Number = 0; i < titleArray.length; i++) {
var abc2:MovieClip=mergerbg_as.attachMovie("merger_box","title"+ i, mergerbg_as.getNextHighestDepth());
abc2.txtprice.text=XPathAPI.selectSingleNode(titleArray[i],"/product/deal_value/price").firstChild.nodeValue;
... //more similar settings from xml
}
}
} else {
trace("XML loading failed !!!");
}
var abc2:MovieClip=mergerbg_as.attachMovie("black_height30","blank", mergerbg_as.getNextHighestDepth());
mergerbg_sp.invalidate();
};
rss.load("myxml.xml");
Hope that help, its the only code on my main movie.... I have no code what so ever in my complete project except this
tell you what you are genius and I am so stupid.. I try abc2.onMouseOver, I try onRollOver within the abc2 library movieclip code, but I doesn't try what you suggest..
which is ofcourse a perfect solution.. however, you make a mistake too
When I place a onRollOut event for abc2, I observe that it is called even when I am rolling over to abc2, but I am on a movieclip that is added on the abc2 movie itemself.
How can I stop that ??so I doesn't lose my rollover for abc2.
i know that if there is any transperancy in a movieclip .. that can cause weird results when using the onRollOver.. because when the mouse is over the movieclip .. but over 'transparent area' it acts like you roll out of it ..
ie.. you rollover text.. but your mouse is inbetween characters.. it will fire the rollout too..