Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-27-2008, 03:09 PM   #1
Bifurd
Registered User
 
Join Date: Mar 2008
Posts: 2
Default Movie Clip _x Direction - please help

I have a movie clip (main_mc) moving from right to left, stopping on rollOver and continuing to move on rollOut like this:

onClipEvent (enterFrame)
{
_x+=(distance*speed);
if (_x > 0) _x=-641;
if (_x < -2197) _x=-688;
}

on(RollOver){
this.stopped = true
}
on(RollOut){
this.stopped = false
}
onClipEvent(enterFrame) {
if(!this.stopped){
speed = 2;
this._x -= speed;
}
}

I have 2 other separate movie clips (controlLeft_mc, and controlRight_mc) on the stage. How can I make these 2 movie clips control the x direction of the main_mc movie clip on rollOver?

Thanks
Bifurd is offline   Reply With Quote
Old 03-28-2008, 10:53 AM   #2
jorawar
Senior Member
 
Join Date: Feb 2007
Posts: 173
Default

Hi,
make three movie clips on the stage .
name them as mainMc, mc_1, mc_2
and put this code on first frame of stage.

var stopAnim:Boolean = false;
mainMc.onRollOver = function() {
stopAnim = true;
};
mainMc.onRollOut = function() {
stopAnim = false;
};
function fun() {
if (!stopAnim) {
speed = 1;
mainMc._x -= speed;
mc_1._x -= speed*2;
mc_2._x -= speed+2;
if (mainMc._x<(0-mainMc._width)) {
mainMc._x = 800;
}
if (mc_1._x<(0-mc_1._width)) {
mc_1._x = 800;
}
if (mc_2._x<(0-mc_2._width)) {
mc_2._x = 800;
}
}
updateAfterEvent();
}
var Id:Number = setInterval(fun, 10);

always use to put the code on frames, that is easy to call or handle other instances.
jorawar is offline   Reply With Quote
Old 03-28-2008, 10:56 AM   #3
jorawar
Senior Member
 
Join Date: Feb 2007
Posts: 173
Default

Hi find the attach file . .. .
Attached Files
File Type: zip Desktop.zip (5.7 KB, 122 views)
jorawar 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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Text input affect the resizing of the Movie clip that it's placed in djechelon ActionScript 2.0 5 03-10-2010 04:37 AM
help loading a random frame for a movie clip felony ActionScript 2.0 4 01-28-2007 12:54 AM
How to Drag Movie Clip on Y axis - ONE direction only KyleA ActionScript 1.0 (and below) 13 09-21-2005 12:13 PM
movie clip loader 2.0 freak ActionScript 2.0 1 05-30-2005 03:40 PM
Movement in Duplicating a movie Clip Fishinghat ActionScript 2.0 7 08-24-2004 07:01 AM


All times are GMT. The time now is 11:27 AM.

///
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.