开发者

Mouse Over Movie Clip is Buggy...It has text boxes on top that cancel the effect can I bypass this?

开发者 https://www.devze.com 2023-04-10 09:21 出处:网络
So I have a movieclip in my flash that has an event listener that calls it to pull up when the mouse is over and go down when the mouse is out. Kinda like a menu. But this object that I am accessing h

So I have a movieclip in my flash that has an event listener that calls it to pull up when the mouse is over and go down when the mouse is out. Kinda like a menu. But this object that I am accessing has text over it. The problem is it works until the the mouse that hits the text over it. Then it drops down.

I will paste my code if it helps...The code below is in the main timeline in scene 1.

//FeedBox Tween Stuff----------------------
var feedup:Tween = new Tween(FeedBox, "y", Strong.easeOut, 560, 290, 2, true);
var feeddown:Tween = new Tween(FeedBox, "y", Strong.easeOut, 290, 560, 2, true);

FeedBox.addEventListener(MouseEvent.MOUSE_OVER, mouseyOnFeed);
FeedBox.addEventListener(MouseEvent.MOUSE_OUT, mouseyOutBox);

function mouseyOnFeed(e:Event){
    feedup.start();
}

function mouseyOutBox(e:Event){
    feeddown.start();
}

Now the FeedBox has text over it in a text box that is generated from my twitter. This actionscript is actually in the library object.

var myXMLLoader:URLLoader = new URLLoader(); 
myXMLLoader.load(new URLRequest("http://twit开发者_运维技巧ter.com/statuses/user_timeline.xml?screen_name=allencoded"));
myXMLLoader.addEventListener(Event.COMPLETE, processXML); 

function processXML(e:Event):void{ 
var myXML:XML = new XML(e.target.data);

tweet1.text = myXML.status[0].text;
tweet2.text = myXML.status[1].text;
tweet3.text = myXML.status[2].text;
tweet4.text = myXML.status[3].text; 
}


Set the mouseChildren property of your movie clip false. Then the children (text in this case) will not interact with mouse.

FeedBox.mouseChildren = false;


Disable mouse events for children.

FeedBox.mouseChildren = false;


Seems like feedbox is not the children. You have to remove text from event loop,

textfield.mouseenabled = false; 

In your cases its like

tweet1.mouseenabled = false;
tweet2.mouseenabled = false;
tweet3.mouseenabled = false;
tweet4.mouseenabled = false;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号