Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 16th, 2008, 03:56 PM
mlekolak mlekolak is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 2 mlekolak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 30 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old July 16th, 2008, 04:15 PM
derelict's Avatar
derelict derelict is offline
career cantankerous cuckoo cur
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2006
Location: currently conniving curious clandestine capitulations
Posts: 755 derelict User rank is First Lieutenant (10000 - 20000 Reputation Level)derelict User rank is First Lieutenant (10000 - 20000 Reputation Level)derelict User rank is First Lieutenant (10000 - 20000 Reputation Level)derelict User rank is First Lieutenant (10000 - 20000 Reputation Level)derelict User rank is First Lieutenant (10000 - 20000 Reputation Level)derelict User rank is First Lieutenant (10000 - 20000 Reputation Level)derelict User rank is First Lieutenant (10000 - 20000 Reputation Level)derelict User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 20 h 11 m 27 sec
Reputation Power: 194
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!

Reply With Quote
  #3  
Old July 18th, 2008, 08:06 AM
mlekolak mlekolak is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 2 mlekolak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 30 sec
Reputation Power: 0
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:
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.



Thanks man!

Reply With Quote
  #4  
Old July 18th, 2008, 08:11 AM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Jul 2003
Location: I used to live at home, now I stay at the house
Posts: 9,909 ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 3 Months 2 Weeks 5 Days 21 h 20 m 52 sec
Reputation Power: 853
Facebook
--Moved.
__________________
Support requests via PM will be ignored!
Sites: Route of Queue | Sinthetic - Alternative UK Hiphop
Read These: The General Rules Thread | The General FAQ Thread | NEW USERS - How to post a question

Sign up with Matched.co.uk and earn up to £15 per website every month!


Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Pleas help with this script (menu)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT