Help! with this script

Im making a strategy game and ive got this script to move my people

How could I do so I don't need a script for unit1 and unit 1 just for both script and how can I do so you can click unit1 and unit then and you can click on and thay, as both move to the location where you clicked.

Import mx.transitions.Tween;

Import mx.transitions.easing. *;

unit.onRelease = function() {}

unit.onMouseUp = function() {}

var t1:Tween = new Tween (unit, "_x", None.easeNone, unit._x, _xmouse, 5, true);

var t2:Tween = new Tween (unit, "FLF", None.easeNone, unit._y, _ymouse, 5, true ");

DY = _root._ymouse - this ._y;
DX = _root._xmouse - this ._x;
radianrotation = Math.atan2 (dy, dx);
radianrotation = radianrotation * 180/Math.PI;
This ._rotation = radianrotation;

delete unit.onMouseUp;
}
}

Unit1.onRelease = function() {}

Unit1.OnMouseUp = function() {}

var t1:Tween = new Tween (unit1, "_x", None.easeNone, unit1._x, _xmouse, 5, true);

var t2:Tween = new Tween (unit1, ' FLF", None.easeNone, unit1._y, _ymouse, 5, true");

DY = _root._ymouse - this ._y;
DX = _root._xmouse - this ._x;
radianrotation = Math.atan2 (dy, dx);
radianrotation = radianrotation * 180/Math.PI;
This ._rotation = radianrotation;

delete unit1.onMouseUp;
}
}

affect your units in the table, unitA.  that (and the interpolation settings) are the only things you need to change in the code below.

When you want to select units call startSelect

Import mx.transitions.Tween;
Import mx.transitions.easing.None;

var tl:MovieClip =;

var unitA:Array = [];
var selectedUnitA:Array;

function startSelectF (): Void {}
tl.onMouseDown = startF;
tl.onMouseUp = stopF;
}
function stopSelectF (): Void {}
delete tl.onMouseDown;
delete tl.onMouseUp;
}
function startF (): Void {}
START_X = tl._xmouse;
start_y = tl._ymouse;
}
function stopF (): Void {}
stopSelectF();
stop_x = tl._xmouse;
stop_y = tl._ymouse;
selectedF();
tl.onMouseUp = moveF;
}
function moveF() {}
delete tl.onMouseUp;
for (var i: Number = 0; i
new Tween (selectedUnitA [i], "_x", None.easeNone, selectedUnitA [i] ._x, tl._xmouse, 5, true);
new Tween (selectedUnitA [i], ' FLF", None.easeNone, selectedUnitA [i] ._y, tl._ymouse, 5, true");
}
}
function selectedF (): Void {}
var begin_x:Number = Math.min (start_x, stop_x);
var end_x:Number = Math.max (start_x, stop_x);
var begin_y:Number = Math.min (stop_y, start_y);
var end_y:Number = Math.max (start_y, stop_y);
selectedUnitA = [];
If (begin_x == end_x & begin_y == end_y) {}
for (var i: Number = 0; i
{if (unitA [i]. HitTest (begin_x, begin_y))}
selectedUnitA.push (unitA [i]);
}
}
} else {}
for (var i: Number = 0; i
If (the unitA [i] ._x > = begin_x & unitA [i] ._x<=end_x &&="" unita[i]._y="">= begin_y & the unitA [i] ._y)<=end_y)>
selectedUnitA.push (unitA [i]);
}
}
}
}

Tags: Adobe Animate

Similar Questions

  • Please help with this script, AS3 to AS2 (preloader)

    Hello. Ive done a flash banner to my client. It has two scenes, preloader (with percentage and animation (in 100)) and the main stage. Preloader using AS3. I need this conversion in AS2. How to do this? Code:

    to import flash.events.ProgressEvent;
    function update(e:ProgressEvent):void
    {
    var p: Number = Math.floor ((e.bytesLoaded*100)/e.bytesTotal);
    If (preloaderMC is MovieClip) {}
    preloaderMC.gotoAndStop (percent);
    preload_txt. Text = String (percent) + "%";
    }
    if(percent == 100) {}
    Play();
    }
    }
    loaderInfo.addEventListener (ProgressEvent.PROGRESS, update);
    Additional test for IE
    var p: Number = Math.floor ((this.loaderInfo.bytesLoaded*100)/this.loaderInfo.bytesTotal);
    if(percent == 100) {}
    nextFrame();
    }
    Stop();

    The full FLA: http://www.agroinvent.eu/briklis.fla, if someone can repair (make), pls send me the fla file corrected.

    A BIG THANK YOU. Best regards. Zolee

    use:

    var tl:MovieClip =;

    update of the function (): Void
    {
    var p: Number = Math.floor ((tl.getBytesLoaded()*100)/tl.getBytesTotal ());

    preloaderMC.gotoAndStop (percent);
    preload_txt. Text = String (percent) + "%";

    if(percent == 100) {}

    clearInterval (preloadI);
    TL. Play();
    }
    }

    clearInterval (preloadI);
    preloadI = setInterval(update,100);
    Stop();

  • Need help with a script customized for processing in Photoshop CS4 of images in batches. Really grateful for the help thereby.

    Hi people.

    So I have a boatload of pictures that I have to deal with as I'm moving off Ebay and open my own online store and the images that I have on Ebay, although excellent quality are not square, and unfortunately, the model that I use in Wordpress requires square photos.

    Basically, what I need is a script that I can use in batch mode, which will focus on the size of the image and change the canvas size to be square corresponding to the current long image side. Resize the image to 1600 square pixels and finally save for web in JPEG quality 60.

    Normally I would muddle my way through this trying to teach myself but I already do so much with this new project that I can't afford to pay developers for help that I would really appreciate if someone could help me with this script. I use Photoshop CS4 if it made a difference.

    Thanks much for any help you can offer.

    See you soon,.

    J

    A simple gesture can do that. What you need to do is that the action of lot.   With the help of Photoshop Image Processor script.  The Action is a two-step

    N ° 1). File menu > automate > fit Image.  In the dialog box Image Fit you assign Width and Height 1600 pixels.

    Step 2.) Menu Image > canvas size.  In the canvas size dialog box, you assign Width and Height 1600 Pixels.

    Record the action in some action with a name like 1600PxSquare

    Then use the file menu to Photoshop > Scripts > image processor. In the dialog to the Image Processor script. Select your image source folder. Set where you want your jpeg images. Set it to save jpeg files quality 6.  Set it to include your 1600PxSquare action.

    Step adjustment image resize your image to fit in a 1600 x 1600 pixels are while keeping image proportions of images. Portrait image will be high 1600px and landscape image will be 1600px wide.  The step size canvas will add the canvas to make the place of the image.  Portraits will have a border on the left and right images of landscape will be confined to the op and downs.

  • Need help with a script (o - o8) *, see the Virgin if there is no

    Hi all what I need help with a script I can't find an example.

    I'm trying to subtract 2 numbers and then multiply this product. (o o8) * one but I just want to do the calculations if all fields have the numbers IE field o, o8 of field and field one.

    Thank you in advance. I was stuck on this days searching the Internet.

    Assuming you want to affect the outcome of this calculation in another text field, use this code as a custom field calculation script:

    var o = this.getField("o").valueAsString;
    var o8 = this.getField("o8").valueAsString;
    var a = this.getField("a").valueAsString;
    if (o!="" && o8!="" && a!="") event.value = (Number(o)-Number(o8))*Number(a);
    else event.value = "";
    
  • Help with this

    Help with this

    Help with what?

  • [Error number: 0x8024400A] Need help with this error... I reinstalled XP SP1 and I can't get an auto update that's simple to install, just get this error every time

    [Error number: 0x8024400A] Need help with this error... I reinstalled XP SP1 and I can't get an automatic update that's simple to install, just get this error at each time HHHHEEEELLLPPPPP! Thank you

    I had the same problem.  But finally found a solution.  If your listing is similar to mine, then keep.  XP Media Center Edition 2005 (sp2).  AMD Athlon 64 x 2 Dual-Core, HP a1630n desktop computer.

    Go to the HP website, search for sp37394-XP sp3 Upgrade utility Microsoft for systems equipped with AMD processors.

    I had the same 0 x 80240036, 0x8024400a error, but realize my problem was really get manually downloaded sp3 and installed without continue loop crashing and not error messages.

  • Where can I get help with this message? «Adobe Acrobat Reader DC could not open (my file.xls) because it is not a type of supported file or because the file has been damaged (for example, it was sent as an attachment to e-mail and has not been correctly d

    Where Iget can help with this message? «Adobe Acrobat Reader DC could not open (my file.xls) because it is not a type of supported file or because the file has been damaged (for example, it was sent as an attachment to e-mail and has not been correctly decoded).» I don't know where to go or how to solve this problem. It started to happen after I went to the office 356 and uses Windows 10.

    Hi brionp43071032,

    Please see the troubleshooting provided in this KB doc steps: fix damaged document error when opening PDF files

    Let us know if you still experience the problem.

    Kind regards

    Meenakshi

  • Installation update for creative cloud can never exceed 2%, which means that I cannot have access to Premiere Pro. Can anyone help with this?

    Installation update for creative cloud can never exceed 2%, which means that I cannot have access to Premiere Pro. Can anyone help with this? I need urgent access to Premiere Pro, so I can return videos to my clients.

    Check your (win) Task Manager or activity (mac) for a suspended adobe monitor helps the process that you can complete.

  • Dialog box that says ' Creative Cloud Installer wants to make changes. Type your password for this purpose"- I type my password for Adobe ID (creative cloud), but it will not accept it. who should I go for help with this query?

    Dialog box that says ' Creative Cloud Installer wants to make changes. Type your password for this purpose"- I type my password for Adobe ID (creative cloud), but it will not accept it. who should I go for help with this query?

    It does not ask the cloud your computer admin password password!

  • Illustrator draw android app says that it requires 4.3. I have a viking RCA pro 10.1 which is 5.0, but it says that my device is not compatible. Can anyone help with this?

    Illustrator draw android app says that it requires 4.3. I have a viking RCA pro 10.1 which is 5.0, but it says that my device is not compatible. Can anyone help with this?

    HI JBlessed,

    What is a Tablet? Because the draw is not yet supported on Android tablets.

    Sue.

  • help with this thread using oracle 7.3

    Dear expert;

    On this thread, I am using

    Help with this

    but I'll need help more with additional information in this regard. see examples of data below

    Hello experts.

    I use oracle 7.3. Therefore, I have the sample data below

    create the table table_one

    (

    req_week varchar (1000).

    Username varchar (1000).

    sale number (30),

    place varchar (1000).

    break_sales number (30)

    );

    insert into table_one values ("week 1", 'John', 100, "NY", 2 ").

    insert into table_one values (' week 1', 'Chris', 20, "TX", 3 ')

    insert into table_one values ("week 1", "Melissa", 80, 'GOES', 4 ')

    insert into table_one values (' week 2', 'Katy', 40 'SC', 1 ")

    insert into table_one values (' week 2', 'Angle', 10, 'NC', 2 ')

    insert into table_one values (' week 2', "Vick", 30, 'CA', 3 ')

    insert into table_one values (' week 3', 'Zack', 60 'CA', 1 ")

    insert into table_one values (' week 3', 'Deb', 60 'NM', 2 ')

    insert into table_one values (' week 3', 'Antoine,"60,"TX", 3 ')

    necessary results

    I need the top 2 sales in a place a week

    expected results

    req_week username place sales

    Week1 John 100 NY

    Week1 Melissa 80'S

    Semaine2 Katy 40 SC

    Semaine2 Vick 30 CA

    Semaine3 Zack 60 TX

    Semaine3 Deb 60 NM

    Note, in this particular case, if there is equality in sales, then use the break_sales column as a case. The break_sales was never a tie... it is so far the query and it does not work as expected

    SELECT    d.req_week, d.username, d.sales, d.place
    FROM      nikeus_report.dbo.table_one  d
    ,        nikeus_report.dbo.table_one  o
    WHERE    d.req_week  = o.req_week
    AND      d.sales    <=  o.sales   
    GROUP BY  d.req_week, d.username, d.sales, d.place
    HAVING    COUNT (*)  <= 2         
    ;
    
    

    Any help is appreciated. Thank you

    Hello

    It seems that your existing query is very good, he's going; Just add the conditions for breaking in the WHERE clause:

    SELECT d.req_week

    d.username

    d.sales

    d.place

    FROM table_one d

    table_one o

    WHERE d.req_week = o.req_week

    AND (d.sales< >

    OR (d.sales = o.sales

    AND d.break_sales > = o.break_sales

    )

    )

    GROUP BY d.req_week

    d.username

    d.sales

    d.place

    HAVING COUNT (*)<=>

    ORDER BY d.req_week

    COUNT (*)

    ;

    Thanks for posting the CREATE TABLE and INSERT statements; that really helps.

  • I was told that I have to disable my account from my PC to add to another computer... I've done it before and I lost many of my images that were on LR.  No matter WHAT HELP with this please

    I'm trying to load another computer with CC, I was told that I have to disable my PC mine.  I did once before and lost a lot of my images from LR, suggestions on this please.

    I do the LR back ups system too.

    Thank you very much

    PAM

    Hi goaliemom

    There is no way to disable CC products. When you enable a CC product on another computer, simply connect to Creative Cloud.CC will ask you if you it will activate on more than 2 computers.

    I've done it before and I lost many of my images that were on LR.  No matter WHAT HELP with this please

    On the computer on which you will see that your images are not displayed?

    Catalog check the most recently used file > open recent in Lightroom

    Try opening a recent backup made on your newly added computer

    ~ Assani

  • Get error 207 trying to download creative Cloud and someone please help with this problem, thanks in advance please.

    Get error 207 trying to download creative Cloud and someone please help with this problem, thanks in advance please.

    Please refer to

    Error 207 to "install Adobe".

  • Accidentally, I bought the Mac in December and contacted support which helped me to get the right version installed, but now the PC version is not in my account downloads and I need to add it to a new computer. I don't know how to get help with this.

    Accidentally, I bought the Mac in December and contacted support which helped me to get the right version installed, but now the PC version is not in my account downloads and I need to add it to a new computer. I don't know how to get help with this. I don't remember how I got the PC version, I think I have access to my computer remotely and she sent, but I can't find any record of it.

    Since this is an open forum, not Adobe support... you must contact Adobe personnel to help
    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)

    Creative cloud support (all creative cloud customer service problems)
    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

  • Is there a default value for the color management in PSE10? Beautiful photos from iPhoto, but blur with elements. I need help with this before as I consider that the upgrade to PSE13 and beyond.

    Is there a default value for the color management in PSE10? Beautiful photos from iPhoto, but blur with elements. I need help with this before as I consider that the upgrade to PSE13 and beyond.

    Printing which forms an angle seems ok, but one that is horizontally seems faded, incomplete.

    I was wondering if I saved a layer somewhere and set it as a default value.

    If you group the layers, you will be left with a single layer, thus spreading your concern.

    Suggest that you do the following:

    1. Make sure you have the latest drivers for your printers
    2. Reset the default preferences.

    Hold the Alt, Ctrl + Shift keys when you click the icon to open the items. When asked if you want to delete the settings file, say Yes.

    Items nearby and let regenerate the file.

  • I had to update my windows computer and you can no longer open Photoshop cs2.  trying to find help with this new system is not easy to use to put it kindly.  I downloaded the program and don't have the available key.  I tried to sign in but where.

    I had to update my windows computer and you can no longer open Photoshop cs2.  trying to find help with this new system is not easy to use to put it kindly.  I downloaded the program and don't have the available key.  I tried to sign in but where.

    For Photoshop CS2 activation has been reprocessed, so your original drive and the serial number does not work.

    As an owner of CS2, Adobe has a copy without activation and serial number, to which you are entitled.

    The serial number is to the right of the download link for Windows. You'll need this one, not your old number.

    Get them here: download Acrobat 7 and CS2 products

Maybe you are looking for

  • Bluetooth: not available

    My bluetooth appears as 'not available '. I already ransacked the com.apple.Bluetooth.plist and reset my smcand did a reset, but the problem remains. I own a macbook pro 13 "(early 2011) with el capitan installed 10.11.6 recently." Other features inc

  • VI opens when the project is opened

    Has anyone seen this problem?  A single file of several keeps opening automatically when I open the project.  Cannot find a reason why this VI is opening.  Always the same VI and happens every time. Thank you! Matt

  • HP ENVY 5530: power supply loss

    lost by moving the power cord for HP Envy 5530 printer... a plug on the back of the printer, and then in the industrial wall... can't seem to find where to buy a new... Thank you

  • Help blackBerry Smartphones for setting up email for BlackBerry Bold 9700

    I have a BB Bold 9700. The phone is wiped and I unlocked it. I want to use it in Europe with a prepaid SIM, including internet and email. When you try to configure e-mail the phone does not allow me to uncheck an e-mail account to work with a BlackBe

  • Update or uninstall/reinstall blackBerry Smartphones

    I am currently using DTM 1.0.2 Build 08 without problem and want to update to the latest version. Eventually a recommendation on the path to take: to update the existing version or uninstall existing and install the last? Barry