Home Tutorials Forums Articles Blogs Movies Library Employment Press

 Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

 03-27-2008, 03:09 PM #1 Bifurd Registered User   Join Date: Mar 2008 Posts: 2 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
 03-28-2008, 10:53 AM #2 jorawar Senior Member   Join Date: Feb 2007 Posts: 173 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.
03-28-2008, 10:56 AM   #3
jorawar
Senior Member

Join Date: Feb 2007
Posts: 173

Hi find the attach file . .. .
Attached Files
 Desktop.zip (5.7 KB, 122 views)

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home ActionScript Forums Group     ActionScript 3.0     ActionScript 2.0     ActionScript 1.0 (and below)     Simple Stuff (Newbies) Flash General Questions     Flash 10 General Questions     Flash 9 General Questions     Flash 8 General Questions     Other Flash General Questions Flex     Flex 2, 3 & 4     Flex 1 Extensions and Plugins     Components     JSFL - Extending Flash Desktop, Mobile and non-browser Environments     AIR (Apollo)     FlashLite / Portable Devices Development     Projectors and CDs Supporting Technologies     HTML and JavaScript     haXe     Server-Side Scripting     Flash Remoting     Flash Media Server General     Best Practices     Gaming and Game Development     Animation and Effects     Flashants Support Forum Community Boards     General Chat     Just for Kicks Challenges     Detention Flash In Action     Site Check     Cool Sites     Widgets Decommissioned     Projects and Positions CMS Forums     Announcements Board     Content Postings / Updates     Product Review Requests     CMS Technical Questions     Process Questions     Collaboration & Suggested Articles

 Similar Threads Thread Thread Starter Forum Replies Last Post djechelon ActionScript 2.0 5 03-10-2010 04:37 AM felony ActionScript 2.0 4 01-28-2007 12:54 AM KyleA ActionScript 1.0 (and below) 13 09-21-2005 12:13 PM 2.0 freak ActionScript 2.0 1 05-30-2005 03:40 PM Fishinghat ActionScript 2.0 7 08-24-2004 07:01 AM

All times are GMT. The time now is 09:14 AM.

///