|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Pleas help with this script (menu)
Hi,
I have a problem with a script. In it I load to scene a logo and some squares (lined up in 1 line) in a loop treated as mc with instance name: "main" (0<number < squareAmount)"+_mc" and some onRollover efect. What I was trying to do is: when I press on one of those squares all of them collect in one place (the pressed mc)AND after that all accept the pressed one are killed when It moves to another place. I have something like that: Code:
for (var g=0; g<=squareAmount ; ++g){
_root["main"+g+"_mc"].onRelease = function(){
gotoAndStop(2);
finalX = this._x;
finalY = this._y;
positionX = Stage.width/2;
positionY = Stage.height -70;
this.swapDepths(this._parent.getNextHighestDepth ());
};
_root["main"+g+"_mc"].onEnterFrame = function() {
this._x += ((finalX - this._x)/ speed);
};
};
main0_mc.onEnterFrame = function() {
if( _root["main"+(squareAmount)+"_mc"]._x == main0_mc._x){
t=1;
for (var j=1; j<=squareAmount-1; ++j){
_root["main"+j+"_mc"].removeMovieClip();
};
};
if(t==1){
logo._alpha += (0-logo._alpha)/(speed*2);
this._x += ((positionX - this._x)/ speed);
this._y += ((positionY - this._y)/ speed);
};
if(main0_mc._y == Stage.height -70){gotoAndStop(2);};
but It doesn't do the job. PLEAS HELP |
|
#2
|
||
|
Oops! moderator; please move this to the Flash Help forum?
@mlekolak - hopefully this isn't double posted -- looks like you're asking about actionscript. if/when you get this over to the flash forum, try giving more info about what the individual clips' code is and what symptoms you see in the movie; from here it looks like the code to move the movie clips relies on t==1, but t doesn't get set to 1 until they're already on top of each other (which I'm guessing won't happen until they start moving). also you might want to test if they're within a pixel or two of each other rather than exactly the same position, as this may not resolve as quickly as you expect. good luck! |
|
#3
|
|||
|
|||
|
Yes sorry.. it's about action-script.
I must have picked the wrong page in the browser but thanks @derelict it did help what you wrote .Quote:
Thanks man! |
|
#4
|
||||
|
||||
|
--Moved.
__________________
Support requests via PM will be ignored! |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Pleas help with this script (menu) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|