AS2 - Taking squares which are adjacent

Hi, I am currently working on a college project and need some help with my flash, I am very new to Flash so please bare with me
What I am trying to acheive is some sort of interactive interface, what I have so far is a 3x3 grid and 2 drag objects, what I have done so far is when you drag one of the drag objects of a square into the grid, depending on the colour of the drag object it will change to that colour, here is the code that I have used for that (it can probably be simplified but I don't know how ).
Drag object code.
on (press) {
    this.startDrag();
//Target one
on (release) {
    stopDrag();
    this._x = 45.00
    this._y = 48.00
    if (eval(this._droptarget) == _root.target1) {
        _root.target1.gotoAndStop(2);
//Target two
on (release) {
    stopDrag();
    if (eval(this._droptarget) == _root.target2) {
        _root.target2.gotoAndStop(2);
//Target three
on (release) {
    stopDrag();
    if (eval(this._droptarget) == _root.target3) {
        _root.target3.gotoAndStop(2);
(This repeats another six times, each time the instance name is changed)
Each one of the grid pieces is an individual MC with three frames in it, each frame is a different coloured square. What I want to acheive is for you to only be able to make a square the same colour if it is adjacent to a square which is coloured the same.
Example
Start          True          False
1 0 0     1 1 0     1 0 1
0 0 0     1 0 0     0 1 0
0 0 0     0 0 0     0 0 0
0 = not coloured
1 = colour 1
I thought about using an if(eval() statment but I couldn't figure it out, I then thought about make a True and False statment but I couldn't figure that out either.
Any help will be VERY appreciated, thanks for your time.
Daranian and the Gang!

Its pretty hard to see what you are trying to achieve here...
But from what I understand you need to create variables for each color inside your targets...
Then check to see if one target's color is blue for instance then change the color of another target...
Inside each one of your target movieclips create variables for your colors:
So if your target1 is originally blue in color do this inside the target1
var blue = true;      // target1 on first frame is color blue
var green = false;    // target1 on second frame is color green
var red = false;       // target1 on third frame is color red
Then to check a target's color, use this:
If (target1.blue == true)
         target2.gotoAndStop(1);        // frame1 of target2 is a blue square
         target2.blue = true;
Hope this helps

Similar Messages

  • How to reduce the open time of Ms proejct 2010 plans which are taking 6 minutes to open.

    In our company there is many plans which are uploaded in Project server 2010.
    all linking to each other and in master plan all also link with master project.
    when we open any project plan in Ms Project 2010 then it is taking 5 to 7 minutes time.
    I dont know why . it's too much time.

    Is this issue specific to one master project? Do you have MS recommended db maintenance plan in place. Try updating database statics  by executing  SP_updatestats on all 4 project databases
    Hrishi Deshpande Senior Consultant

  • TS1368 I want to delete a lot of things childrens stories, albums which are not used which that are on my ipad. However when I go through Itunes it wont show me most of the stuff in my library. it takes ages to delete one at a time.

    I want to delete a lot of things childrens stories, albums which are not used which that are on my ipad. However when I go through Itunes it wont show me most of the stuff in my library. it takes ages to delete one at a time.
    Can you help please?

    Thanks King_Penguin for taking time to read and reply. 
    I just purchased this movie on Thursday, May 15, so just a few days ago.  I have never had any trouble whatsoever since I have been in Vietnam.  I have downloaded several movies and even music and they have all synced to my respected Apple products except for this purchase. 
    Sorry, I don't quite understand what you mean by studios and different versions.  Could you please explain? 
    I checked my purchased list in my purchase history under my account and there are no hidden items. 

  • I'm trying to open files which are telling me to instal Adobe Reader.  Which I did but the agreement which needs to be ticked off so this reader can open doesn't come up.  Please could you be of some assistance.

    I'm trying to open files which are telling me to instal Adobe Reader.  Which I did but the agreement which needs to be ticked off so this reader can open doesn't come up.  Please could you be of some assistance.

    Select one of the files, Choose GetInfo from the Finder's File menu, look for the field named "Open With", and choose Preview from the adjacent menu. Accept that ALL such files will Open with Preview, and your major problems should be solved.
    Occasionally, a particularly complex .pdf file or one that needs to be modified and re-written will not work quite right with Preview, but such issues are rare.

  • What are those apps which are promoted on " why you 'll love your ipad " page

    What are those apps which are promoted on " why you 'll love your ipad " page. I mean there r some pictures of ipads , and i'm really curious about that apps which are in the screen, cause i 'd like to try them.

    Edgy44 wrote:
    I mean, why shouldn't those apps show up when I look for them,
    Most likely because they are not apps. They are background processes the OS is runnning.
    I would expect as the owner to have  some sort of explanation of who the 3rd party is, why there apps are apprearing on your ipad without permission, and maybe the ramifications of taking off or at least turning them off.  Its not rocket science, people.  It really about our rights as pople, right???
    I suggest you sell your iPad and not worry about it any longer.

  • I want to install an old airport express, the ones which are directly plugged into the socket - but it does not work with Maverick or Snow Leopard - can I configure it with a windows pc?

    I want to install an old airport express, the ones which are directly plugged into the socket - but it does not work with Maverick or Snow Leopard - can I configure it with a windows pc?

    The Mac running Snow Leopard should be able to configure virtually any version of the AirPort Express.
    Tell us what steps that you are taking to configure the Express and what happens after each step.

  • Find System which are automatically updating by internet

    Hi team,
    can any one help me on this , In my environment I have around 1000 servers , we are using wuss for windows update 
    but some server are missing they are updating by internet means automatic update.
    can I find the server name  which are taking update from internet ,I don't want check manually all the servers.
    Regards, Triyambak

    Hi Triyambak,
    I’m writing to just check in to see if the suggestions were helpful. If
    you need further help, please feel free to reply this post directly so we will be notified to follow it up.
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna
    TechNet Community Support

  • Selecting records which are greater than or of current week

    Hi I have a table having table structure
    CREATE TABLE OMPPRODUCTION
    LOCATIONID VARCHAR2(200 BYTE) NOT NULL ,
    IPC VARCHAR2(200 BYTE) NOT NULL ,
    PRODUCTIONWEEK VARCHAR2(200 BYTE) NOT NULL ,
    QUANTITY VARCHAR2(2000 BYTE) ,
    PRODUCTIONCODE VARCHAR2(2000 BYTE) ,
    MOULDQUANTITY VARCHAR2(2000 BYTE) ,
    SOURCE VARCHAR2(2000 BYTE) ,
    APPLICATION VARCHAR2(2000 BYTE) ,
    COMMENTS VARCHAR2(2000 BYTE) ,
    TLM DATE ,
    ADSTAT CHAR(1 BYTE) ,
    SID NUMBER(10, 0) ,
    SECURITYLEVEL VARCHAR2(100 BYTE) ,
    CONSTRAINT OMPPRODUCTION_PK PRIMARY KEY ( LOCATIONID , IPC , PRODUCTIONWEEK ) ENABLE
    It has field PRODUCTIONWEEK which is having data as YYYYMMDD.
    I want to select records which are starting from current week(Monday as starting Day).
    eg Current Day is 20120210 so i would select rows having date more than or equal to 20120206.
    Can anyone guide me how it can be achieved ?
    Edited by: MaheshGx on Feb 6, 2012 4:16 PM

    Hi,
    Boneist wrote:
    ... Wow, why so complicated? ...
    So, taking account of the fact your column isn't DATE datatype, this would be more efficient for you;
    select *
    from   ompproduction
    where  trunc(to_date(productionweek,'yyyymmdd'), 'iw') >= trunc(sysdate, 'iw');
    This will be even less complicated and more efficient:
    select *
    from   ompproduction
    where  to_date(productionweek,'yyyymmdd') >= trunc(sysdate, 'iw');However, given that OP is stuck with a VARCHAR2 column, I would suggest:
    SELECT *
    FROM   ompproduction
    WHERE  productionweek     >= TO_CHAR ( TRUNC (SYSDATE, 'IW')
                                     , 'yyyymmdd'
    ;Instead of calling TO_DATE for every row in the table, this calls TO_CHAR only once.
    Also, when there is invalid data (which is very likely when using a VARCHAR2 column to store dates), this will not raise an error.
    OP: Note that this only works because the sort order of your VARCHAR2 column corresponds to the sort order you want. If February 6, 2012 were stored as '02/06/2012' or '06-FEB-2012', then you'd have to use TO_DATE on every row.
    Boneist's main point is right.
    Dates belong in DATE columns. If you're getting the data from a file, convert the strings to DATEs when the table is populated.

  • Every time i sync ipad2 itunes reinstalls the apps which are already on it

    Whenever I plug my ipad2 into my computer, it starts to sync and then tries to reinstall all of the apps which are already installed on the ipad2. This is ridiculus since if I have updated an app on the ipad, it deletes it off the ipad and installs the older version onto the ipad since the update hasnt transferred over to my computer yet! This is getting really frustrating because it then means every sync is taking ages. once Itunes finishes the sync it then reports that it could not install several of the apps onto the ipad because an error occurred - 0xE800002E, but when I check the ipad the apps which is says are not installed are there still.
    Any help would be much appreciated because this is driving me crazy!
    Thanks

    connect your device and right-click or control-click your iPod in the iTunes Source list, then choose transfer purchases from the shortcut menu that appears.

  • Deleting Multiple Maintence plan which are inactive

    Hi Guys
    Daily morning we are running IP30 for different sort field ie WS01,WS02,WS03 etc., we enter the following in the transaction
    1. Maintplant sort field      ws02 under interval for call objects 40 DAY tick Resheduling Incl box , log control -> application log ,
    BDC session -> call transaction and call mode = N .
    After running this transaction it will create maintenance plan for the following Sort field . The problem which i am facing is
    1. It is taking around 1hr 25 min to finished the Maintenance plan for some sort field ie ws02,ws04 .
    I think the system is checking the system status all the maintenance plan  which are DLFL, DLFL INAC, INSTEAD of CRTD status.
    So Is there anyway to tune IP30 so that when we run the transaction it should ignore inactive maint Plans.
    or is there any way to delete or archive maintenance plan which are Inactive .
    Please comment
    Regards
    Piroz

    CLOSE

  • How to create a report for open sales orde documents which are not invoiced

    Hi Experts this is urgent,
    +pls give the Logic for document flow+
    My requirement is create a report for sales orders which are not invoiced  using the following table.
    VBAK : sales order header
    VBAP : sales order item
    VBFA : sales document flow
    VBUK for processing status
    KOMV for duties value and sales order value
    LIKP : delivery not header
    LIPS :delivery note item
    For information : In the header level the processing Status is indicated in the table VBUK field LFSTK for one sales order number. A,B , C are the possible entries.
    Case A : When a sales order is invoiced we can display information on the header status :
    Overall status : Completed  and display a invoice number in the document flow. When the items of the sales orders are invoiced the process status is the following :  Overall status       Completed            
    Delivery status      Fully delivered      
    Case B : An open sales order not delivered and not invoiced will have overall status : Open on the header and item level and will not have subsequent documents.
    Case C :
    When the items for the sales order are delivered but not invoiced the status will be u201Cfully deliveredu201D
    And the subsequent documents will be delivery notes and good issue if the delivery note is issued.
    With regards
    ravi
    Edited by: ravik ravik on Jun 25, 2008 3:29 PM

    Hello Ravi,
    U neednot develop any report..
    there is std report with txn V.02
    or copy this and make necessary changes.
    Reward, if helpful.
    Rgds,
    Raghu.

  • I would like to combine multiple profiles into a new computer. Which are the most important folder or files to migrate?

    The user profile in my old computer somehow became corrupted and I can no longer access it to log on. Unfortunately I was not aware of the Firefox sync feature at the time. I used a new profile and had to start from scratch to save new bookmarks and extensions/plugins. I did set up Firefox sync for this new profile. Now I have a brand new computer and desire to migrate the bookmarks to this new computer, including the original bookmarks in the old computer, as well as the bookmarks in the second profile. While I have located the profiles folder for each profile in my old computer (as well as extensions and plugin folders), the content of this folder is daunting. I would like to know which are the minimal folders I should select to migrate and would it be safe to simply copy and paste over the entire folder? Please note that I have also added new bookmarks into my new computer which I would not like erased. I hope these details are not convoluted.

    Firefox has two methods of bringing in bookmarks from another Firefox profile:
    * Restore a backup (JSON files in the bookmarkbackups folder): this completely replaces what you have, so is not the first step
    * Import from an HTML file: this is additive and will create an Imported Bookmarks folder or add them under Unsorted Bookmarks
    Restore is best if you tag your bookmarks because the JSON format preserves tags. If tags are not important, then it's easier.
    What I suggest is:
    (1) Export your current bookmarks to the HTML format; you can reimport these later. See: [[Export Firefox bookmarks to an HTML file to back up or transfer bookmarks]]. Open the file in Firefox (it's a web page) to make sure it looks complete before proceed.
    Next, get the bookmarkbackups folders from each of your old profiles that you want to restore, and look for the most-complete-looking JSON files (they will have the most recent dates and largest number of bookmarks indicated in the file name). Proceed from the smallest set to the largest, or oldest to newest; basically, restore the most important one last.
    (2) Restore a backup, then export to HTML. This article has the steps for a restore: [[Restore bookmarks from backup or move them to another computer]]. Then export to HTML and check for completeness.
    (3) Repeat #2 until you get to the last/most important restore. You don't need to export that one.
    (4) Import the HTML files you've made throughout the process.
    (5) In the Library dialog, reorganize. Firefox doesn't have a deduplicator, but you might find one or more extensions to do the job on the Add-ons site if you find a lot of overlap.
    Make sense?

  • List of Invoices which are paid without a Goods receipt

    Hello,
    Does anyone know a report which shows invoices which are paid without goods receipt being done on them. The reason for this is the process that we follow:
    We dont do GR based IV  because there are invoices which are received without the Goods receipt being done. So the process is that all invoices which dont have a Goods received are automatically R-blocked by the system and hence no payment can be released unless they are Goods receipted. We run transaction MRBR in background everyday and it releases invoices which have a corresponding GR. At month end, we do a GRIR clearing account transaction which cleared all invoices which didnt have a GR (this is the way it was done historically) and we are looking to improve this process. What this means is that an invoice which didnt have a goods receipt also got cleared off and the R block was removed and hence it appeared in the automatic payment program and was paid.
    Business wants to find out any report which would show them all invoices paid without a GR. Its the only way to know what payments have been made to vendors which actually shouldnt have been made.
    Any insights would be really helpful.
    Thanks
    Keyur

    dear sir
    in MB5S- list of GR/IR balances.
    this report will show the GR/IR pending.
    regards
    jrp

  • I have reinstalled my OS without time machine (using the disc). I want to restore some pictures in the iPhotos which are already in the time machine i was using previously. How can I restore iPhoto from previous time machine?

    My mac book was incredibly slow. When I went to Mac store, they asked me to reinstall the OS with CD and not with the time machine. I reinstalled the operating system. But when I opened the applications, all those started as fresh applications as usual. I have the backup of all other data in another hard disc. But unfortunately, I forgot to copy the photos before reinstallation. I have those photos in my time machine back up. But when I opened time machine, it started like a fresh (very new) time machine and it started backing up my present OS (the reinstalled one). I cannot open the previous time machine, which is in the same hard drive. I wish to open the previous time machine to get the photos which are backed up previuosly. When opened the time machine disc (manually by clicking the icon), i can see all the thigs which I had previously in my macbook. But unfortunately, i cannot access those through time machine! Can anybody help me please?

    How to redownload purchased apps from the App Store

  • TS3899 Cannot send email from iPhone. Outgoing settings are correct. Checked against iPad setting which are OK and can send mail OK.

    Cannot send email from iPhone. Outgoing settings are correct. Checked them against iPad settings which are OK and can send mail. What can I do?

    For IOS7.02
    The user name and password are in two places. Make  sure they are correct in both locations.
    Settings>>Mail, Contacts, Calendars>>your email>>
    First spot is here under INCOMING MAIL SERVER
    Below this is OUTGOING MAIL SERVER
    Select: SMTP smtp.comcast.net>> PRIMARY SERVER :smtp.comcast.net>>second location of user name and password
    Here is the second place that the user name and password must be checked.
    I had changed my password in the first spot, but not the second spot. I had been receiving the same error message. This fixed my problem.

Maybe you are looking for

  • Why are inbox mesgs being deleted when I close my e-mail program ?

    Hello. Thanks for your help. Every time I finish reading my inbox e-mails, then close the program, all the inbox messages are automatically deleted. When I open the inbox the next time, all messages that were in the inbox are gone forever. Thank you.

  • I had facetime on my iphone 4s. Now it is gone! How do I get it back?

    I had facetime on my iphone 4s. Now it is gone! How do I get it back?

  • Accounting document through MR21

    Dear Experts, My user just performed price changed through MR21. My question is, why no Accounting document created after executed. There was only 'price change document appears after checked through CKMPCD. Please advice. Thank you in advance.

  • Need help with colors in iOS 7

    The whites of the OS are simply overpowering.  If I don't turn the brightness down to less than 15%, I get headaches from the whites.  But if I turn it down that low then I have to strain to make out everything else on the screen, which give me a dif

  • No-win scenario

    Okay, so last Tuesday, the website deviantart.com stopped working for me. The javascript refused to load. It's not the add-ons, I have it set to accept javascript. The site's own help desk was the worst kind of ineffectual. So I created a new User Pr