Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-13-2007, 10:47 AM   #1
vikasumit
Member
 
Join Date: Sep 2005
Location: India
Posts: 52
Default Mouse over on dynamically added MovieClip

Hello,

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.

Can you please suggest how to d that.

Thanks & Regards
__________________
Vikasumit

http://www.vikasumit.com | http://www.sumitgupta.net | http://www.online3d.info
--------------------------------------------------
Computer Language is not a constrain for some one who understand the logics well.
vikasumit is offline   Reply With Quote
Old 08-13-2007, 12:31 PM   #2
xxneon
Super Moderator
 
xxneon's Avatar
 
Join Date: Dec 2006
Location: Amish Country, PA
Posts: 8,570
Send a message via ICQ to xxneon Send a message via AIM to xxneon Send a message via MSN to xxneon Send a message via Skype™ to xxneon
Default

whats your current code for adding the movieclip to the scrollpane?
xxneon is offline   Reply With Quote
Old 08-13-2007, 12:57 PM   #3
vikasumit
Member
 
Join Date: Sep 2005
Location: India
Posts: 52
Default

Code:
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
__________________
Vikasumit

http://www.vikasumit.com | http://www.sumitgupta.net | http://www.online3d.info
--------------------------------------------------
Computer Language is not a constrain for some one who understand the logics well.
vikasumit is offline   Reply With Quote
Old 08-13-2007, 01:04 PM   #4
xxneon
Super Moderator
 
xxneon's Avatar
 
Join Date: Dec 2006
Location: Amish Country, PA
Posts: 8,570
Send a message via ICQ to xxneon Send a message via AIM to xxneon Send a message via MSN to xxneon Send a message via Skype™ to xxneon
Default

inside the for loop you could try this..

ActionScript Code:
abc2.onRollOver = function {         trace("you rolled over: " + this._name); }
xxneon is offline   Reply With Quote
Old 08-13-2007, 01:08 PM   #5
vikasumit
Member
 
Join Date: Sep 2005
Location: India
Posts: 52
Default

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

Code:
abc.onRollOver = function() {
is the correct line

Thanks a lot for your answer
__________________
Vikasumit

http://www.vikasumit.com | http://www.sumitgupta.net | http://www.online3d.info
--------------------------------------------------
Computer Language is not a constrain for some one who understand the logics well.
vikasumit is offline   Reply With Quote
Old 08-13-2007, 01:22 PM   #6
xxneon
Super Moderator
 
xxneon's Avatar
 
Join Date: Dec 2006
Location: Amish Country, PA
Posts: 8,570
Send a message via ICQ to xxneon Send a message via AIM to xxneon Send a message via MSN to xxneon Send a message via Skype™ to xxneon
Default

yea little typos i always miss when just typing code from my head .. glad it worked for you.
xxneon is offline   Reply With Quote
Old 08-13-2007, 01:26 PM   #7
vikasumit
Member
 
Join Date: Sep 2005
Location: India
Posts: 52
Question

One issue found..

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.

Thanks
__________________
Vikasumit

http://www.vikasumit.com | http://www.sumitgupta.net | http://www.online3d.info
--------------------------------------------------
Computer Language is not a constrain for some one who understand the logics well.
vikasumit is offline   Reply With Quote
Old 08-13-2007, 01:43 PM   #8
xxneon
Super Moderator
 
xxneon's Avatar
 
Join Date: Dec 2006
Location: Amish Country, PA
Posts: 8,570
Send a message via ICQ to xxneon Send a message via AIM to xxneon Send a message via MSN to xxneon Send a message via Skype™ to xxneon
Default

the mc you are rolling over ?? does it just have text in it ??
xxneon is offline   Reply With Quote
Old 08-13-2007, 01:52 PM   #9
vikasumit
Member
 
Join Date: Sep 2005
Location: India
Posts: 52
Default

yes it has three dynamic text field with two white movie that I load images on it.
__________________
Vikasumit

http://www.vikasumit.com | http://www.sumitgupta.net | http://www.online3d.info
--------------------------------------------------
Computer Language is not a constrain for some one who understand the logics well.
vikasumit is offline   Reply With Quote
Old 08-13-2007, 02:46 PM   #10
xxneon
Super Moderator
 
xxneon's Avatar
 
Join Date: Dec 2006
Location: Amish Country, PA
Posts: 8,570
Send a message via ICQ to xxneon Send a message via AIM to xxneon Send a message via MSN to xxneon Send a message via Skype™ to xxneon
Default

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..
xxneon is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find out the Movieclip Instance name when added dynamically prabhatpanda ActionScript 1.0 (and below) 7 07-20-2009 02:44 PM
attaching movieclip to mouse Ritika_S ActionScript 2.0 5 07-11-2007 04:52 AM
TextField not selectable inside MovieClip with mouse events replaysMike ActionScript 2.0 5 04-05-2007 09:59 AM
Dynamically center text field in a movieclip ironchefmoto Other Flash General Questions 14 02-22-2006 09:14 PM
Referencing dynamically created Movieclip lkelly ActionScript 2.0 3 12-07-2005 07:52 PM


All times are GMT. The time now is 10:32 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.