How to string movieclip to mousepointer?

I want to do a clip of a (Yes, the insect) fly (named "smoke" in Norwegian) follow my mousepointer around the stage, or at the top of the image, by following (which I imagine is advanced enough) or under mousepointer hover and would prefer is not necessary, hold down the mouse button, as this could be uncomfortable for a while.

I tried:

flue.addEventListener (MouseEvent.CLICK, movingFly);

function movingFly (evt:MouseEvent) {}
Flue.x = flow + 225 .mouseX;
Flue.y = flue .mouseY + 220;
}

I don't know what to do, if I even use the right earphone or attributes... when I click on it, it disappears outside the given step and in the upper left of the screen, and when I click on it again, it moves in the direction, I clicked on him... weird Center...

I have a file where chart follows the mouse, but it does not seem to work in the same way as with graphics. I want it to be identical with the graphics... Any help is appreciated

Try from the following:

stage.addEventListener (MouseEvent.MOUSE_MOVE, moveFly);

function moveFly(evt:MouseEvent):void {}
Flue.x = mouseX;
Flue.y = mouseY;
}

The way you have, when you click it, it moves 200 pixels.

Tags: Adobe Animate

Similar Questions

  • How convert string to number

    How convert string to number


    my character


    Select form double to_number ('1,6,9,4'); my putting here 1,6,9,4

    get the character of number conversion error.

    concerning

    Published by: vr on March 31, 2011 23:59

    Published by: vr on March 31, 2011 23:59

    VR says:
    Getting error while the conversion of character to the number in instring is possible to get the position of the channels at one time

    I have the following table, called pack

    Acct_No pack2 pack3 pack1
    1000 10101011 111111101 01010101111

    Select * Pack
    where instr (pack2, ' 1') and * (to_number (replace('1,6,9,4',','))); * - getting values of function as string '1,6,9,4'

    If you want to retrieve lines where the position of the first "1" in the pack2 chain is one of the positions in your list number e.g. position 1, 6, 9, or 4?

    Something with regexp_like can help...

    SQL> ed
    Wrote file afiedt.buf
    
      1  with pack as (select '1000' as acct_no, '10101011' as pack1, '111111101' as pack2, '01010101111' as pack3 from dual union all
      2                select '1001', '10101011', '000011111', '10101010110' from dual union all
      3                select '1001', '10101011', '000000001', '10101010110' from dual)
      4  --
      5  -- end of test data
      6  --
      7  select pack.*, case when regexp_like('1,6,9,4','(^|,)'||to_char(instr(pack2,'1'),'fm9999')||'(,|$)') then 'Yes' else 'No' end as x
      8* from pack
    SQL> /
    
    ACCT PACK1    PACK2     PACK3       X
    ---- -------- --------- ----------- ---
    1000 10101011 111111101 01010101111 Yes
    1001 10101011 000011111 10101010110 No
    1001 10101011 000000001 10101010110 Yes
    
  • How a String get phone number?

    Hi all

    How a phone to get the string numbers. In this "Emp_Details" column, we have

    Phone number, address and Date. How we can get the only phone number.

    Example:

    Select Emp_Details from Table_name.

    Values of Emp_Details:

    8183917972

    13/01/2015

    AAA

    6617144613



    I need to get only the phone numbers. As

    Emp_Details:

    8183917972

    6617144613


    Please help me as soon as possible.

    Hello

    To find the rows where emp_details contains exactly 10 digits (and nothing else), you can use

    SELECT *- or what

    Table_name FROM

    WHERE the TRANSLATION (emp_details

    '123456789 '.

    ', ' 000000000 '.

    ) = "0000000000"

    ;

    I hope that answers your question.

    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.

    Point where the above query is to produce erroneous results, and explain, using specific examples, how you get the right results from data provided in these places.

    If you change the query at all, post your modified version.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    Check out the Forum FAQ: Re: 2. How can I ask a question on the forums?

  • How the string output to a common indicator?

    Hello

    I have a sequence of battery with 10 picture sets, there is a wait to delay of 2 seconds between each image. I have a common indicator of channel set and I want to output a string to this indicator in the first framework before the codes between frame 2 frame 9 execution... and I would like another string to the same indicator on the latest image to indicate all the completed exit code. But I find that there is no way to share the flag by two constant string of different chassis. Any idea? Thank you.

    Use the variable value or local property of the node of this common indicator in all sequences

  • How segregrate strings concantenates chain

    Hello

    I'm trying to write and read data from the port of succession using the VISA.vi with Labview. I can concatenate multiple strings for writing. I am able to read and write data using the serial port.

    I also want to read the value of the card and need to put an indication that data is written and which was read by the serial port are the same.

    Please give me a suggestion.

    I am able to read and write data using the serial port.
    If you need the staus.find compare the value of witten with the value read and must update the VI attached.

  • HTML5 canvas how to use movieClips created onstage goToAndPlay()

    I created a simple slide show and a series of small navigation buttons on the platform of html5 canvas. The goToAndPlay() function works OK on the main timeline, but not on timeline timeline navigation buttons. I don't know enough createJS to find a workaround. Journal of said browser gotoAndStop is not a function. I just want to do a mouseover and mouseout/mouseouthandler() managers, the button can play the role of his chronology.

    Any ideas?

    You must reference the movieclip.

    for example, if you try to control the movieclip as well as one that contains the code, use:

    this.gotoAndPlay ();

    not

    gotoAndPlay();

  • How is my MovieClip doesn't work?

    What I'm trying to do is create a series of clips in my flash (through actionscript) project to create a scrolling background. But I'vev ran into a strange question.

    For some reason even if I think that I add the movieclips correctly to the scene, all the variables are set to zero.

    Here is the code in my main script that I use to create clips (GrassTile)

    [code]

    var grassHolder:Sprite = new Sprite();

    addChild (grassHolder)

    for (var i: int = 0; i < 5; i ++)

    {

    grassHolder.addChildAt (new GrassTile (i), i);

    }

    [/ code] (and if you know a BBCode to display of the labour code, it would be also useful )

    And here is my GrassTile class: I cut out the unimportant stuff. I can add in more later if necessary there.

    [code]

    package {}

    Import 12345678910111213import;

    import flash.display.MovieClip;

    import flash.events.Event;

    SerializableAttribute public class GrassTile extends MovieClip

    {

    private var _root:MovieClip

    private var grass: Bitmap;

    public var id: int;

    public void GrassTile(id:int)

    {

    This.x = 100

    This.ID = id;

    addEventListener (Event.ADDED_TO_STAGE, onEnterStage);

    }

    public function updateGrassTiles (): void //called on the main timeline

    {

    This.x = (this.width 0%) + (this.width * (id));

    This.y = stage.stageHeight - this.height;

    trace (this.) Width);

    trace (this.x); These traces back only '0' unless it was the last created

    }

    private void onEnterStage(e:Event):void

    {

    removeEventListener (Event.ADDED_TO_STAGE, onEnterStage);

    _root = MovieClip (root);

    grass = _root._resource. GrassImage;

    addChild (grass);

    }

    }

    }

    [/ code]

    As I said in the comments in the code, when the GrassTiles are added, everyone except the last one added returns 0 for the x and width and does not add the Bitmap image.

    Thanks in advance!

    Try this - it clones (should clone - I didn't test it) bitmap

    package
    {
        import flash.display.Bitmap;
        import flash.display.BitmapData;
        import flash.display.MovieClip;
        import flash.events.Event;
    
        public class GrassTile extends MovieClip
        {
            private var _root:MovieClip
            private var grass:Bitmap;
            public var id:int;
    
            public function GrassTile(id:int)
            {
                this.x = 100
                this.id = id;
                addEventListener(Event.ADDED_TO_STAGE, onEnterStage);
    
            }
    
            public function updateGrassTiles():void //called from the main timeline
            {
                this.x = (0 % this.width) + (this.width * (id));
                this.y = stage.stageHeight - this.height;
                trace(this.width);
                trace(this.x); //These traces return only "0" unless it was the last one created
            }
    
            private function onEnterStage(e:Event):void
            {
                removeEventListener(Event.ADDED_TO_STAGE, onEnterStage);
                _root = MovieClip(root);
                grass = cloneBitmap(_root._resource.GrassImage);
                addChild(grass);
            }
    
            private function cloneBitmap(bitmap:Bitmap):Bitmap
            {
                return new Bitmap(bitmap.bitmapData.clone());
            }
        }
    }
    
  • How to string conversion in the Nodelist XML in java

    Hai

    I need to convert the string to a nodelist in java

    Element parentcustom = (element) wink;

    String resultNodeValue = replaceAngleBracketsChildType (parentcustom.toString ());

    NodeList parentcustomList = resultNodeValue (NodeList);

    I did high way, but I don't get the right answer

    I need this resultNodeValue to be converted to nodelist.

    can someone help me

    Thanks in advance...

    Your requirement is to get the "parentcustomdetails" inside the node 'parentruledetails '.

    The following code will do that.

    NodeList children = doc.getDocumentElement().getChildNodes();
    for (int i = 0; i < children.getLength(); i++) {
         Node parentRule = children.item(i);
         if (parentRule.getNodeName().equals("Parentrule")) {
              NodeList nlParentRule = parentRule.getChildNodes();
    
              for (int j = 0; j < nlParentRule.getLength(); j++) {
                   Node parentRuleDetails = nlParentRule.item(j);
                   if (parentRuleDetails.getNodeName().equals(
                             "parentruledetails")) {
                        NodeList nlParentRuleDetails = parentRuleDetails
                                  .getChildNodes();
    
                        for (int k = 0; k < nlParentRuleDetails.getLength(); k++) {
                             Node parentCustomDetails = nlParentRuleDetails
                                       .item(k);
                             if (parentCustomDetails.getNodeName().equals(
                                       "parentcustomdetails")) {
                                  NamedNodeMap attributes = parentCustomDetails
                                            .getAttributes();
    
                                  System.out.println(parentCustomDetails
                                            .getNodeName());
                                  for (int l = 0; l < attributes.getLength(); l++) {
                                       Node attr = attributes.item(l);
                                       System.out.println("\t"
                                                 + attr.getNodeName() + " -- "
                                                 + attr.getNodeValue());
                                  }
                             }
                        }
                   }
              }
         }
    }
    

    The output of this code is,

    parentcustomdetails
         CHILD_TYPE -- Console
         CMD_CODE -- 37135
         CMD_NAME -- login authentication [string]
         CMD_OPTION -- login authentication
         COLUMN_INDEX -- 0
         CONDN_OPER -- exists
         CONDN_VALUE -- True
         PARENT_RULE_CODE -- PR630
         RULE_TYPE_FLAG -- Customrule
    parentcustomdetails
         CHILD_TYPE -- Console
         CMD_CODE -- 37135
         CMD_NAME -- login authentication [string]
         CMD_OPTION -- string
         COLUMN_INDEX -- 1
         CONDN_OPER -- equalsto
         CONDN_VALUE -- AAAAAAAAA
         PARENT_RULE_CODE -- PR630
         RULE_TYPE_FLAG -- Customrule
    
  • How covert string to date

    I wanted to convert a string to a date like
    Convert from '20090405132103' to the 05/04/2009 13:21:06 what function help me please help
    to_char(to_date('20090405132103', 'YYYYMMDDHH24MISS'), 'MM/DD/YYYY HH:MI:SS AM')
    

    See you soon
    Sarma.

  • How to string U2414H two screens without connector DIsplay Port

    I have a U244H screen and want to buy another to increase my overall display area.

    Currently, I connect to the U2414H using the HDMI output on my laptop. My laptop has 1 x HDMI and 1 x VGA outputs. Is it possible to set up daisy chaining with this configuration?

    I used the following Setup successfully. U2414H connected to HDMI and VGA monitor connected to the VGA output of my laptop and working well. However, I prefer two monitors of U2414H due to the smaller borders.

    The P2414H the same resolution (1920 x 1080) and the VGA port.

    The S2415H NOTE from the ADMIN: broken link has been removed from this post by Dell > the same resolution (1920 x 1080) and the VGA port.

  • How to string concatination in pl/sql

    I'm working on
       
     IF LENGTH(v_final_string) < 3800 THEN
            SELECT nvl2(v_final_string,v_final_string
              ||',' ,v_final_string)
              || temp.temp_string
            INTO v_final_string
            FROM DUAL;
            DBMS_OUTPUT.put_line ('v_final_string=' || v_final_string );
          ELSE
            EXIT;
          END IF;
    inside a loop. But it is not concatenate. I'm alwas empties v_final_string

    Hello

    Always show a complete script that people can run to recreate the problem and test their ideas.

    Beginning of v_final_string is null?
    If so, the condition

    IF LENGTH(v_final_string) < 3800
    

    won't be TRUE.

    I think you want something like:

    ...
    IF  v_final_string  IS NULL
    THEN
        v_final_string := temp.temp_string;
    ELSIF  LENGTH (v_final_string) < 3800
    THEN
        v_final_string := v_final_string
                     || ','
                 || temp.temp_string;
    ELSIF
        EXIT;
    END IF;
    

    or

    ...
    v_final_string := v_final_string
                || ','
                || temp.temp_string;
    
    IF  LENGTH (v_final_string) >= 3800
    THEN
        v_final_string := LTRIM (v_final_string, ',');
        EXIT;
    END IF;
    

    I prefer the second way. Since then he has not test if v_final_string is NULL each time through the loop, it will probably be a little faster.

    It is rarely needed the double table in PL/SQL.

  • How a string in ascending order of sort

    Hello

    the samble of my sring as below,
    10; 2; 3; 4; 5; 8; 9; 1
    10; 2; 3; 4; 5; 8; 9
    and I need to sort in order to be as below, growing

    1; 2; 3; 4; 5; 8; 9; 10
    2; 3; 4; 5; 8; 9; 10
    any help please,.
    SQL> select * from sample_data
      2  /
    
    STR
    -----------------
    ;10;2;3;4;5;8;9;1
    ;10;2;3;4;5;8;9
    
    2 rows selected.
    
    select  ';' || rtrim(xmlagg(xmlelement(e,regexp_substr(str,'[^;]+',1,column_value),';').extract('//text()') order by to_number(regexp_substr(str,'[^;]+',1,column_value))),';')
      from  sample_data,
            table(
                  cast(
                       multiset(
                                select  level
                                  from  dual
                                  connect by level <= length(regexp_replace(str,'[^;]'))
                               )
                       as sys.OdciNumberList
                      )
                 )
      group by rowid
    /
    
    ';'||RTRIM(XMLAGG(XMLELEMENT(E,REGEXP_SUBSTR(STR,'[^;]+',1,COLUMN_VALUE),';').EX
    --------------------------------------------------------------------------------
    ;1;2;3;4;5;8;9;10
    ;2;3;4;5;8;9;10
    
    2 rows selected.
    
    SQL> 
    

    SY.

  • How to reference a dynamically created MovieClip from an another MovieClip?

    Hello

    I would be grateful for the pointers to the following problem:

    I can't reference dynamically created MovieClips (links in a panel side on a Flash site, created from a XML file) from the current MovieClip (the selected link).

    I want to freeze the MovieClip/link to the mouseOver State, once it has been clicked - this part works. When a new MovieClip/link is clicked on, I would like to release the previously clicked on the link to the mouseOver State, which is what I have so far been unable to do.

    My problem seems to refer to the previous link/MoveClip. I used the statement (MovieClip (this) .name) route trace to determine that the clips are named item0, item1, item2 and so on. However, I was unable so far to reference the previous item so far. I tried to follow the route to the MovieClip on the stage and also essaye.item0.gotoandstop MovieClip (parent) and a lot of other different permutations, but nothing helped. It's the fact that they seem to be in a container called "panel", which is defeat me.

    Here's a live version that I downloaded, what could explain the problem better. Click on "UBER EACH" in the menu bar to access the page in question. It is the links on the left side (history, team Unser, etc.) who are the problem. You will see that once they were clicked, they stay in their mouseOver State.

    This is the code in question on the fla file, which is a file that I did not create myself. The parts in black work very well; It's the Red pieces there the rub:

    ***********************************

    import flash.display.MovieClip;

    panel.buttonMode = true;

    var: lang: uint = 1;

    var url_Link:String = MovieClip (root).program.websiteXML .language [lang] [MovieClip (root).program.linkPage].pages.titlePage.texts.pageList.txt [XT].@link numT;

    var urlPage:Number = number (MovieClip (root).program.webs iteXML.language [lang].pages.titlePage [MovieClip (root).program.linkPage].texts.pageList.tx t[numTXT].@linkPage);

    var request: URLRequest;

    var linkIndex:uint;

    var lastClickedLink:MovieClip; //This is supposed to store the last link that has been clicked - it does not work  

    panel.addEventListener (MouseEvent.CLICK, clicLink);

    panel.addEventListener (MouseEvent.ROLL_OVER, mouseOverLink);

    panel.addEventListener (MouseEvent.ROLL_OUT, mouseOutLink);

    function mouseOverLink(event:MouseEvent):void {}

    MovieClip (this) .gotoAndPlay ('s1');

    }

    function mouseOutLink(event:MouseEvent):void {}

    if(numTXT!== (linkIndex-1)/5) { State mouseOver of //freezes so this is the link for the current page

    MovieClip (this) .gotoAndPlay ('s2');

    }

    }

    function clicLink(event:MouseEvent):void {}

    var linkpage:uint =. MovieClip program.linkPage (root);

    If {(url_Link)

    request = new URLRequest (url_Link);

    navigateToURL (request);

    } else {}

    linkIndex = numTXT * 5 + 1;

    if(linkpage == 1) {}

    MovieClip (root).chPages.cont.page_about_mc.page3Tu rner_mc.gotoAndStop ([linkIndex]);

    } ElseIf (linkpage == 2) {}

    MovieClip (root).chPages.cont.page3_mc.page3Turner_ mc.gotoAndStop ([linkIndex]);

    }

    lastClickedLink.gotoAndPlay('s2'); / / This is supposed to release the clicked the link previous it is State mouseOver - does not work 

    lastClickedLink = MovieClip (this) .name; //this is supposed to set the new link as the last link clicked after that was released of her is State mouseOver - does not work   

    }

    }

    ***********************************

    If anyone can help, that would be great.

    What you might be after for this line is to use:

    lastClickedLink = MovieClip (event.currentTarget);

    For what you show, the name property of an object is a string, so I expect get you an error regarding trying to get a string to act as a MovieClip when you try to say to gotoAndPlay ('s2').

  • How to detect the number of channels on an oscilloscope?

    I have various models sitting around the laboratory, some two-channel, a few four-channel oscilloscope.  I would like for my program to be able to detect the number of channels is available.

    I can just tell my program how much string is available based on the model number, but is there a VISA command to request scope directly what channels he has?  I would also be able to ask what, if any, ability to function math there.

    "all drivers of the oscilloscope must return the instrumentID after initialization, and that should be enough to know the number of channels.

    What Albert was referring to is that all compatible drivers IVI in their base class interface have an attribute/property that indicates how many channels has the scope.

    If you don't want to use the driver of the IVI for the scope then maybe download some of the drivers and check the source code to see how they calculate this dynamic repeated capablity.

  • How to handle certain levels in flash games?

    I was wondering what is the best practice to do something like below, I thought on global variables with if conditional, but the code is going to be messy. Unfortunately I can't find a tutorial on the internet, I've spent hours Googling it but everything I found there was nothing to do with this. It's so frustrating because it's really hard to get without these references "special."

    For example,.

    After completing a level:

    http://i.imgur.com/44iMa.png

    Select the screen of levels:

    http://i.imgur.com/bKCYc.png

    Game: Rubble Trouble Tokyo

    Thanks in advance.

    If you have your buttons placed on the stage, you can use their name to retrieve the ID from level. To scroll the buttons during initialization, you must put them in a medium (MovieClip) and give it a name, let's say "levelButtonsHolder".

    Name your buttons like this: btn_ % LEVEL-ID

    for eaxample: btn_level0, btn_level1,..., btn_levelN, where "levelX" is ID for a level whereby you can instantiate and reference level.

    Then, your code should look like:

    import flash.events.MouseEvent;
    
    for(var i:int = 0; i < levelButtonsHolder.numChildren; i++) {
         var button:MovieClip = levelButtonsHolder.getChildAt(i) as MovieClip;
         if(button.name.indexOf("btn_") == -1) continue;
         button.addEventListener(MouseEvent.CLICK, levelButton_clickHandler);
    }
    
    function levelButton_clickHandler(event:MouseEvent):void {
         var levelID:String = MovieClip(event.currentTarget).name.substr(4);
         trace("LOAD LEVEL. Level ID: " + levelID);
    }
    

Maybe you are looking for