Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-09-2003, 07:33 PM   #1
joaoVieira
learning the way...
 
joaoVieira's Avatar
 
Join Date: Apr 2003
Location: Lisbon, Portugal
Posts: 35
Send a message via ICQ to joaoVieira
Default Stop movieClip OnEnterFrame

I'm trying to stop a movieClip, when the mouse roles over it but keep the others moving.

I've got 3 movieClip's with the following instance names:
animal1_mc
animal2_mc
animal3_mc

_root.vazio_mc.onEnterFrame = function(){
for (i=1; i<4; i++){
_root["animal"+i+"_mc"].onRollOver = function (){
_root.instanceName = this._name;
_root.instanceNumber = _root.instanceName.substr (6,1);
_root.number = Number (_root.instanceNumber);
}
_root["animal"+i+"_mc"]._x = _root["animal"+i+"_mc"]._x + 1;
}
}

I can identifie wich one the mouse is over but i canīt stop it, without stoping all the others too.

Could someone give me an ideia of how to do this.

Thank's in advance
Attached Files
File Type: zip stopmovieclip.zip (2.5 KB, 106 views)
joaoVieira is offline   Reply With Quote
Old 06-09-2003, 08:13 PM   #2
Fugee
Grubbychops
 
Join Date: Apr 2003
Location: a very small room
Posts: 250
Default

add the parts in Bold to the script in your frame:
ActionScript Code:
_root.vazio_mc.onEnterFrame = function(){     for (i=1; i<4; i++){         _root["animal"+i+"_mc"].onRollOver = function (){             _root.instanceName = this._name;             _root.instanceNumber = _root.instanceName.substr (6,1);             _root.number = Number (_root.instanceNumber);         }         [B]if (i == number) {         _root["animal"+i+"_mc"]._x = _root["animal"+i+"_mc"]._x;         } else {[/B]         _root["animal"+i+"_mc"]._x = _root["animal"+i+"_mc"]._x+1;              [B]}[/B]     } }

Hope it helps


P.S. Ah, use the [AS] [/ AS] tags for code
__________________
Need to learn
Fugee is offline   Reply With Quote
Old 06-09-2003, 08:15 PM   #3
Fugee
Grubbychops
 
Join Date: Apr 2003
Location: a very small room
Posts: 250
Default

ah, if you need the movement to restart on rollOut you'll need to set a rollOut function!


Something like this:
ActionScript Code:
_root.vazio_mc.onEnterFrame = function(){     for (i=1; i<4; i++){         _root["animal"+i+"_mc"].onRollOver = function (){             _root.instanceName = this._name;             _root.instanceNumber = _root.instanceName.substr (6,1);             _root.number = Number (_root.instanceNumber);         }         if (i == number) {             _root["animal"+i+"_mc"]._x = _root["animal"+i+"_mc"]._x;         } else {             _root["animal"+i+"_mc"]._x = _root["animal"+i+"_mc"]._x+1;              }     [B]_root["animal"+i+"_mc"].onRollOut = function (){         _root.number = 0;     }[/B]     } }
__________________
Need to learn

Last edited by Fugee; 06-09-2003 at 08:20 PM.
Fugee is offline   Reply With Quote
Old 06-10-2003, 01:16 AM   #4
joaoVieira
learning the way...
 
joaoVieira's Avatar
 
Join Date: Apr 2003
Location: Lisbon, Portugal
Posts: 35
Send a message via ICQ to joaoVieira
Default

Thanks a lot Fugee!

That did the trick for this simplified version.

Wednesday I will try to apply it to the "real" thing, a major project that as a lot more variables in it

P.S: Sorry for not using actionscript formated text. I will try to remember that next time. It's in fact much easier to read the code that way.

I'll let you know how it worked on the "big one"

Once again, thanks Fugee!
joaoVieira is offline   Reply With Quote
Old 06-10-2003, 12:57 PM   #5
Fugee
Grubbychops
 
Join Date: Apr 2003
Location: a very small room
Posts: 250
Default

Hey, no problem!

Here to help (if i can )
__________________
Need to learn
Fugee 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


All times are GMT. The time now is 09:09 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.