Based on its color - pixel position attach a movieclip on a path

Hello.

How could I find, a pixel´s position, based on its color?

Let´s says:

We have a red way pulled on stage, we make a movieclip, we do a bitmapdata of this movieclip.

Then, I want to find the position (x and y coordenate) a red pixel in the bitmapdata.

I have a movieclip called "stepladder";

I have a movieclip red Road, called "path".

How can I join the movieclip "stepladder", a certain number of times, in a meantime, along this movieclip "path"?

And also, to calculate the rotation "stepladder", based on the direction of the route.

Thank you.

you have a black bitmapdata, so there should not be any match.  Looks like you missed a draw() method that you can use:

marcelozepgames wrote:

I ve tried this:

[code]

package

{

import flash.display.BitmapData;

import 12345678910111213import

import flash.geom.Point

import flash.geom.Rectangle

import flash.display.MovieClip;

import flash.events. *.

SerializableAttribute public class Test2 extends MovieClip

{

var red_bmpd:BitmapData

var red_bmp:Bitmap

public void Test2()

{

red_bmpd = new BitmapData (red_mc.width, red_mc.height, false, 0);

red_bmpd. Draw (red_mc);

red_bmp = new Bitmap (red_bmpd)

var targetColor:uint = 0xff0000

var coords:Point = null;

var color = null

for (var i: int = red_bmpd.rect.x; i)< red_bmpd.rect.width;="">

{

for (var j: int = red_bmpd.rect.y; j)< red_bmpd.rect.height;="">

{

If (red_bmpd.getPixel (i, j) == CouleurDestination) {}

trace ("OK")

color = red_bmpd.getPixel (i, j)

Coords = new Point (i, j)

trace (coords, color)

breaking

}

}

}

}

}

}

[/ code]

Tags: Adobe Animate

Similar Questions

  • Accident stroke multicolor where color is based on the color of the pixel at the edge

    Hi and first of all sorry for the terrible title. I've been looking for a way to create something like a regular edge effect, but the color should be based on the color of the edge pixel. I need something like this because when I am doing textures for my models and put them in a game engine, I have a problem where the white lines are showing on a certain distance from my model. The solution to this problem is to add color around the islands of uv that is similar to the color of their edges. What I've done until now is put almost every island uv on a layer separate behind the main texture, so when I want to resize this layer copied it would do the trick. But this is a long process for the more than 50 models, so I thought that maybe someone has a better idea of how to approach this problem. Thank you

    Do not know if this fits your needs but you can try, after performing a selection of pixels of the layer, select > modify > border, choose a couple or a few pixels and then edit > fill > Content Aware Fill. You could also simply extend the selection with Select > modify > Expand and then do an intersection of the selection with the original selection, and then Content Aware Fill, but I don't know if the additional step will buy you anything. If that works, create an Action and it in batches on all files, could speed things up.

  • call a MC based on its position

    I would like to take a certain (x, y) coordinate and have a function return which video clip is based at this location. Such a method is possible to refer to a clip based on its position rather than the instance name?

    Thank you

    If you only need movieclips on the current timeline:

    function movieclipF(x:Number,y:Number):Array {}

    var a: Array = [];

    for (obj in this) {}

    {if (typeof (this [obj]) == "MovieClip" & this [obj] ._parent == This)}

    {if (this [obj]. HitTest(x,y))}

    a.push (this [obj]);

    }

    }

    }

    return a;

    }

  • How to change the font color or the background color of the field date. MinValue based on its value

    Hello world

    jdev Studio Edition Version 11.1.2.3.0.

    I have a date field of the entry in the table of the adf. I want to change its color (font or background) if the date is less than the current date.

    I use jdev Studio Edition Version 11.1.2.3.0.

    Thank you

    You must have a date property in a bean that allows you to get the current date. That you can use in a for EL compare to the date in the table and set the inlinestyle as accordingly

    #{lt mybean.currentdate row.datetocheck?-color: Red ":" "}

    mybean. CurrentDate is the method that returns the current date of the bean method.

    Timo

  • Why has my watch has lost its color and is visible only in the gray tone?

    Why has my iwarch loses its color and is only gray showing tone?

    Hello

    On your iPhone, in the application of the watch, go to: Watch My > general > accessibility > under the title of 'Vision', uncheck / disable the grayscale option.

  • Set up printer M451 to deplete its color ink cartridges

    My M451 color laser printer is currently set to force printing in black and white when one of its color toner cartridges falls to a very low level.  Could someone tell me how to put in place to keep just print in color?  This will allow me to decide when the color print quality gets bad enough that I want to change the cartridge.

    The other day someone here very usefully showed me how to do this with my M475, and hope for a repeat of this notice for the M451.

    Any thoughts appreciated.  Thanks in advance!

    -Gary

    Looking for the control panel submenu: System Setup-online power settings-online black cartridge-online very low setting

  • stream based on its length object

    Hello

    I have the following pdf file and I can't see the 1 page in Adobe Acrobat Reader. I can see it correctly in any other pdf reader.

    I need to create a data flow based on its length (see item 100 and 200), but I could make it work. I followed the specification pdf (page 65), but it does not work.

    on page 2, where the length is not an object of reference, everything's fine.

    Help, please.

    %PDF-1.5

    1 0 obj < < / Type/Catalog Pages 2 0 R > > endobj

    2 0 obj < < / type/pages [0 0 595 842] /MediaBox [0 0 595 842] /CropBox /Resources 3 0 R /Kids [010 011 0 R 0 R] count 2 > > endobj

    3 0 obj < < / type/resources/make < < /FH 4 0 R /FHB 5 0 R > > > > endobj

    4 0 obj < </Subtype/make/type/Type1/Name /FH /BaseFont /Helvetica /WinAnsiEncoding /Encoding > > endobj

    5 0 obj < < / type /Type1/Subtype/make/name/Helvetica-Bold/encoding /WinAnsiEncoding /BaseFont /FHB > > endobj

    6 0 obj < < AR 205 > > flow

    0.5 0.5 0.5 GR BT FHB 14 Tf 55 810 Td (xxx) Tj AND BT 55 795 Td (www.ABC.com) Tj AND BT 421 810 Td (yyy) Tj AND BT 421 795 Td(01/01/2015 12:00:04) Tj AND BT /FH 12 Tf 295 30 Td (/ 1) AND Tj 55 790 m 540 790 l S

    EndStream > > endobj

    10 0 obj < < / Type/page there 2 0 R /Contents [6 0 R 200 0 100 0 R R] > > endobj

    11 0 obj < < / Type/page there 2 0 R /Contents [6 0 R 0 R 101] > > endobj

    100 0 obj < < AR 200 0 R > > flow

    BT /FHB 14 Tf 235 750 Td (Page 1) Tj AND

    EndStream > > endobj

    200 0 obj

    37

    endobj

    101 0 obj < < / length 37 > > flow

    BT /FHB 14 Tf 235 750 Td (Page 2) Tj AND

    EndStream > > endobj

    Xref

    0 12

    0000000000 65535 f

    0000000014 00000 n

    0000000064 00000 n

    0000000198 00000 n

    0000000270 00000 n

    0000000378 00000 n

    0000000492 00000 n

    0000000753 00000 n

    0000000837 00000 n

    0000000913 00000 n

    0000001012 00000 n

    0000001035 00000 n

    trailer

    < < / size 12/root 1 0 R > >

    startxref

    1381

    %% EOF

    10, used in the summary table on page 1, is not a stream.

  • Elements will allow me to isolate an object, change its color and remove the rest?

    13 elements will allow me to isolate an object in a picture, change its color and remove everything else?

    Yes. Suggest you download the day 30, free, trial of the program and see if you like it. The trial version is the full version.

  • How to query a line based on its rownum

    Hi all
    What is the best way to interrogate a line based on its rownum? Suppose I have the following query:
    select first_name from employees where rownum<5;
    FIRST_NAME
    --------------------
    Ellen
    Sundar
    Mozhe
    David
    Ellen has rownum 1, Sundar 2 and so on. How can I do it if I just want to ask a line where Mozhe's name, which is rownum 3?

    Best regards
    Val

    You said:

    >
    According to its availability
    >

    Is not calculate it? What do you mean by 'availability' in this context?

    What you can do, is something like this:

    select empno, ename
    from (
       select empno, ename, rownum rn
       from (
         select empno, ename
         from scott.emp
         order by ename
       )
       where rownum <= 3
    )
    where rn = 3;
    

    You need something to order by.
    Then, you create an internal selection with this order by.
    Then you select the inside where select rownum<=>
    And then you select just one third.
    So select the above gets you the third order of the employee by name.

  • Create links based on the color in Flash

    I have a picture with seven distinct colors.  I would like for each color is linked to a separate html page if clicked.  Can Flash the link to a page based on the color of the selected area?  If so, how?  Otherwise, any ideas on a work around?

    Thank you!

    A button has four images. The fourth framework is the "hit". All that is in this framework will define the hotspot of the cursor to the button.

  • Can someone tell me whence these parasites, color pixels?

    firefoxOrange.png

    You see a few orange pixels behind the word, "Gallery?  I have no idea how they got there.

    Here is the page: donfaulkner.co.uk/pages/gallery-landscape-draw.php


    Martin

    Martin:

    'Stray colored pixels' you see is the anti-aliasing on the vertical letters (lowercase 'L', for example).  It is a reality, I'm afraid...

  • How to remove nodes based on its attribute?

    Sorry, I'll stop asking that much in the forum and try it myself, but I have another problem. . I would like to be able to remove a node based on its attribute 'id' to the node "ads". ?????

    Here's the xml script:

    < page id = "Page1" >
    < ads id '0' = >
    File1 < adfile > < / adfile >
    < adwidth > 1 < / adwidth >
    < adheight > 50 < / adheight >
    < adposx > 212 < / adposx >
    < adposy > 375 < / adposy >
    < / ads >
    < ads id = "1" >
    File2 < adfile > < / adfile >
    < adwidth > 1 < / adwidth >
    < adheight > 50 < / adheight >
    < adposx > 7 < / adposx >
    < adposy > 69 < / adposy >
    < / ads >
    < ads id = "2" >
    < adfile > file3 < / adfile >
    < adwidth > 1 < / adwidth >
    < adheight > 50 < / adheight >
    < adposx > 83 < / adposx >
    < adposy > 303 < / adposy >
    < / ads >
    < / print this page >
    < / pages >

    I tried that, but it did not work:

    function deleteme(evt:MouseEvent):void {}
    var who_Id:int = evt.target.parent.parent.id;    just to get the identification number
    var who:String = evt.target.parent.parent.name;
    this.removeChild (evt.target.parent.parent);
    This.evt.Target.parent.parent = null;
    Delete Pages.page.adverts. (@id == who_Id);  can change by a number of test who_Id
    trace (pages);

    }

    It could be a simple as:

    delete xml.page.adverts [who_Id];

    But once that a node is deleted names numbers would correspond more is the number of the node.

    Then maybe you're looking for this:

    var xml =

    File1

    1

    50

    212

    375

    File2

    1

    50

    7

    69

    file3

    1

    50

    83

    303

    var who_Id:int = 1;

    for (var i: Number = 0; i<  xml.page.adverts.length();="" i++)="">

    If (xml.page.adverts[i].@id==String (who_Id)) {}

    delete xml.page.adverts [i];

    }

    }

    trace (XML);

  • I have an object that follows a path and I want another object is placed in a different position, but follow the same exact path?

    I have an object that follows a path and I want another object is placed in a different position, but follow the same exact path? I NEED HELP!

    Easy: Copy and paste images keys, then select all the keyframes in the layer followed and drag them to the left.

    More complex: use expressions - Motionscript.com trails of the creation

  • CS6 #nav links change color of score based on its position in series

    First post of a DW CS 6 novice full on Win7.  Not knowing JavaScript or JQuery, I thought I would add a more simple animation for a site navigation Web based on the pass two fixed header footer design. The navigation links on the left < sidebar1″ > were increased to 24, with a background of common link in the default state.  When the cursor passes over the links they would change background color to one of five listed in the picture in the jpeg image loaded as the 1st item in the list.  Only the image itself acts as a splash of color for the five categories of links directly below and is not a hyperlink.  The idea is that someone looking for new tools should hover nav links and only worry about the yellow background, even if they appear in any random position the list down.  To give a color to each link to make < sidebar1″ > seems too colorful.

    ScreenHunter_03 Sep. 30 00.57.jpg


    I have two titles to dvd David Powers and thought using an nth - of - type ().  It does not work.  Maybe there are two sets of required settlers (a:hover:nth - of-type (4), a: active: nth-of-type (4) {background-color: #f00 ;}})   ).  There must be a way that might work, but I don't know enough of DW and CSS for the moment to understand this.

    Thank you very much.

    I do not have this menu system you are using, but you might be able to create CSS classes to use in your menu as follows:

    • a href = "some - link.html ' class 'about' = > link
    • a href = "some - link.html" class = "new" > new link
    • a href = "some - link.html" class = "new_proc" > new link procedures
      • CSS:

        Li a.about:hover {background-color: gray}

        Li one: new: hover {background-color: forestgreen}

        Li a: new_proc:hover {background-color: lawngreen}

        and so on...

        Nancy O.

  • Get the cell active in an array on a mouse click, I can change its color

    Hi guys,.

    I'm looking at a small application.

    I have a table. When a user clicks on a particular cell, I need the coordinates of the cell, so that I can change its attributes (for example color change) by clicking a button.

    Change the position property of the table gives me the current coordinates of the cell, but when I click on a button, the position of the previously clicked cell is lost. How can I solve this problem?

    Is there a way to fix this?

    Thank you

    Ravi

    Guys, I got it to work. Thanks for the comments.

Maybe you are looking for