PDA

View Full Version : Please Help me ! How to loop a movieclip



coolboy6682
03-14-2005, 04:07 AM
Please Help me !

How do i move a Movieclip from Top to down

for example :
say a movieclip called mctopbar, i want that mctopbar to move from top to bottom on (realese) { with loop command, like animated. some thing like mctopbar._y = 100+10 \\ i don't know how to put it but it should move from top to bottom by increment of 10 , and have to go back to tha same position.

Please be great full to help me with this

Thanks

I would be greatfull if you could email me the help thanks again iifraz@gmail.com


Ifraz[/code]

NTD
03-14-2005, 11:39 AM
Hi,

Maybe something like this...


onClipEvent(load){
this._x=Stage.width/2;
this._y=0;
}
onClipEvent(enterFrame){
this._y+=10;
if(this._y>=Stage.height){
this._y=0;
}
}

coolboy6682
03-18-2005, 04:08 AM
Thank you very much it works

but what i want is to happen on press or on release using a function so i can call the function and it has to move certain distance say like _y from _y 100 to _y 250 and back to _y 100 . all i am saying is from top _y 100 it has to move down to _y 200 and come back to _y 100 . thats all . if this is in a fuction then from a movieclip i can call the function on release of a button.

Plz help me

and thank you for your help thank you very much

TkC

Ifraz

iifraz@gmail.com

NTD
03-18-2005, 12:02 PM
Hi,



moveMe = function (targ) {
targ.onLoad = function() {
targ._x = Stage.width/2;
}
this.onEnterFrame = function() {
targ._y += speed;
if (targ._y>=500) {
speed = -speed;
}
if &#40;targ._y<=origY&#41; &#123;
speed = 0;
delete this.onEnterframe;
&#125;
&#125;
&#125;
myButton.onPress = function&#40;&#41; &#123;
origY = 50;
speed = 10;
moveMe&#40;mcName&#41;;
&#125;