variable of the current position?

If I have several elements that move on the screen, but the user can click on one of them at any time, how to save the current position of one of the items element in order to use these data to change the position of the element once the user clicks on?

That's what I do: I have 11 images that slide on the screen. The user can click one of them at any time. When he clicks on one that I started to scale the image so it seems that comes with impatience (z axis) and then the rest of the images are scaled down so it looks like they'll be back on the z axis. So what I try to do, is get the current position of the image when the user clicks on the image so that I can use it to estimate correctly updated the scale and move the image to make it look like, she puts across the Center and not from the upper left corner.

So if have a variable that gets the current position of the image that is clicked, I think that I can change its position using something like: x = currentposition + -45;

Thank you for any input!

It IS a property of z in Flash now - as long as you post on a 10 player.

And I answered the question you are asking. To get the value of x of any DisplayObject (MovieClip, Sprite, Loader, button), it is simply:

theObject.x

I think your real question is "How do I know that it has been clicked and get the x of this element dynamically?" or something like that?

function handleClick(e:MouseEvent) {}

var mc:MovieClip = MovieClip (e.currentTarget);

trace ("the selected object is to:" + [mc.x, mc.y]);

}

Assuming that you have assigned a MouseEvent.MOUSE_UP Manager components that work will show x and y of each element that is clicked on. (Assuming they're MovieClips or can be expressed as such.)

Tags: Adobe Animate

Similar Questions

  • Get the current Position/location of the blackberry

    Hi all

    I am developing an app that tells you so to were you are in the world... the less minimalist. any ideas how to on this subject? I have searched for the API for useful method calls, have only seen class net.rim.blackberry.api.Maps.MapView. I don't think that's all that is needed.

    In particular, I want to at least get the latitude and longitude of the current position of the phone. This is the main task for now. What are my options and how can I do to solve this.

    Thanks in advance

    Dan

    http://www.BlackBerry.com/developers/docs/5.0.0api/javax/microedition/location/LocationProvider.html

    There is also a pdf developer for this topic, check

    http://docs.BlackBerry.com/en/developers/subcategories/?usertype=21&category=development+guides

    (maybe you should read them all!)

  • How to get the current position from the point of view

    can I know how to get the current position of the view?

    Edited by: anIdiot July 27, 2011 22:01

    1 - get belvedere of the universe:

    u = new SimpleUniverse (canvas3D);
    ViewPlat = u.getViewingPlatform (); view of the universe

    definition viewplat: ViewingPlatform ViewPlat;

    2 - get look a transform of the platform in an existing Transform3D

    ViewPlat.getViewPlatformTransform () .getTransform (t3d).

    3 - Look at the trandform: t3d.get (Quater1, vector1); orientation object Get and coords

    Kind regards.
    JFP

  • How do I cut a clip at the current position without affecting the other tracks?

    I know that I can use sequence-> add amend to cut a clip at the current position, but unlike with the razor tool all tracks intersect. How can I cut just the track associated with the current position?

    Target the desired track, or securities.

    Block all other tracks.

    These are two ways to limit cuts.

    Good luck

    Hunt

  • Flex TextInput to get the current position of the cursor

    TextInput component in how to get the current position of the cursor? Because I want to record a loss of focus on the location of TextInput dynamically add text.

    Here:RichEditableText is a part of the skin of the class spark TextInput and is what is doing all the text in the editing/rendering of work. If you need to make all text advanced operations, they need to go through the property here. Because it is a part of the skin, you need to make sure that is not null before doing anything on this subject.

    Fixed typo: it is the property here is, not textInput

  • Duration of formatted by adding to the current position

    Hello

    I want to have an external button that will insert a SpanElement formatted at the current position.

    How can I insert my own items in the required position (cursor)?

    Element might look like:

    var span:SpanElement = new SpanElement();
    span.text = text;
    span.setStyle('custom',true);
    span.color = '0xFF0000';
    

    Thank you

    Find the item of the sheet using texFlow.findLeaf.  If the position to insert is in the middle of a splitAtPosition to use span to split in two.

    Calculate the index that you want to add the new span using parent.getChildIndex and now the API replaceChildren to can insert your new span.

    Hope that helps,

    Richard

  • Edge Animate, create 'Next' and 'Back' buttons as the current position

    Hey everybody,

    I'm doing something fairly simple but I could use some help to make it work and couldn't find there examples... This is all I'm doing.

    I have animations along a timeline with labels and breakpoints for 1, 2, 3, 4, 5.  I want to create a simple buttons "Back" and "Next" that will get your current label and play forward or backward to the next or previous / position of the label.  Logically, my attempt to show what it looks like in the text:

    Back to 1-2-3-4-5 next

    And that's all, I know that someone must have done this or knows how, any help would be greatly appreciated

    See you soon,.

    Jeff

    Hi, I'm new on adobe, I received Friday but I made a slideshow with front and rear buttons, I don't know if this is the best way to do if however I could make it work. what you need to do is create the div for your buttun that select and go top left stocks open {}. Select on click and enter a similar code.

    for the back button:

    var pos = sym.getPosition () / / this is a numeric variable that gets the current time in the animation of sound in milliseconds to a second it will have a value of 1000 to two seconds 2000 and so on

    If (pos<=>

    SYM. Play('5'); If the statement is checked to see which slide that contains animation on, if it is in the first slide, it will play the beginning of the last slide

    }

    ElseIf (pos<=>

    SYM. Play('1'); If it's on the second slide, it will play the beginning of the first slide

    }

    ElseIf (pos<=>

    SYM. Play('2');  If it's in the third slide, it will play the beginning of the second slide

    }

    ElseIf (pos<=>

    SYM. Play('3');  If it's the fourth slide, it will play the beginning of the third blade

    }

    else {}

    SYM. Play('1');

    }

    for the next button, it's the same concept just opposite

    I hope that's what you mean and I don't know if this is the optimal way to do, I'm brand new on adobe, but that's what I got.

    Jonathon Davis

  • Scroll to the bottom of the current position

    Hey developers!

    New dev here (in the hope to refine my skills). I am trying to add a 'scroll down' option for a webview page. My problem is that evertime I press the button it starts from the top of the page and goes back to the same place. I don't know how to pick up my current position on the page, and continue from there. In addition, while it scrolls down, it seems delete what going on. So I'm not able to scroll to the top manually more unless I refresh the page. Help, please.

    I work in QML and here is my code:

    {Page}

    ScrollView {}

    {Of container

    background: Color.create ("#000000")

    WebView {}

    ID: myWebViewFacebook

    URL: ""http://www.facebook.com " "

    animations:

    {TranslateTransition}

    ID: scrolldownanimation

    Duration: 10000

    fromY: 0.00

    Toy :-6000.0

    easingCurve: StockCurve.Linear

    onDurationChanged: {}

    scrolldownanimation.resetRepeatCount)

    }

    }

    } / / end webview

    }

    }

    {ActionItem}

    ID: appropriee16

    Title: 'Scroll to bottom.

    imageSource: "asset:///Assets/scrolldown.png."

    ActionBar.placement: ActionBarPlacement.OnBar

    onTriggered: {}

    scrolldownanimation. Play()

    }

    }

    I have not tested, but can give you the code a try:

    Page {
        ScrollView {
            id: scrollView
            Container {
                background: Color.create("#000000")
                WebView {
                    id: myWebViewFacebook
                    url: "http://www.facebook.com"
                    attachedObjects: [
                        LayoutUpdateHandler { id: webViewLayoutUpdateHandler }
                    ]
                } // end webview
            }
        }
        actions: [
            ActionItem {
                id: action16
                title: "Scroll To Bottom"
                imageSource: "asset:///Assets/scrolldown.png"
                ActionBar.placement: ActionBarPlacement.OnBar
                onTriggered: {
                    scrollView.scrollToPoint(0, webViewLayoutUpdateHandler.layoutFrame.height)
                }
            }
        ]
    }
    
  • Set the current position of the scrolling screen?

    Hello

    My current screen is dropdown - is there a way to specify what 'part' of this screen with scrolling should be visible? Therefore, my users are not automatically scroll...

    Thank you!

    You can call Field.setFocus () on a specific field, the UI must auto scroll to it.

  • Sound preview audio stream starts beginning rather than at the current position in the timeline

    I have an audio stream which I'm doing an animation. After working for a while, especially later in the video (like 2 minutes or more). audio will not play at the position, I'm in the workspace and rather play early instead. It is therefore impossible to work efficiently synchronize audio animation.

    I tried with several computers and sound cards, and I get the same behavior.

    What is going on? Is this a known bug?

    Yes, it is a known problem in Windows. I have reason to believe that it will be corrected in the next update to Flash Pro. Don't know when this will be.

  • Can I create a link from the current position of say "+ 1000' horizontally or vertically for a one page site.

    I'm experimenting with a site to a page with horizontal and vertical sections.  In a perfect world, I would like to have an image of type compass/arrows with a fixed position - always present, which connects to all areas on a big site of a page.

    Assuming that the browser knows where it is in the page, it seems clear that you have links that take you say 1000 to the right, one for up to 1000, one for the bottom etc.  I've been shooting with arrows of absolute positioning that connects all sections of the page, but each of them must be configured individually. I also have a fixed menu position that links to all the sections.  A fixed navigation compass would be very cool.

    If this isn't the case, I'm sure this is possible with the java script, but I'm looking for an easy solution, as I'm not familiar with java.  If someone could point me to something, I would be very grateful.  I've been looking for more information for days - I discovered how to soft scroll however.

    I know not java.

    Java is a programming language used most often in applications, but not much on the web more found.  JavaScript is a common web programming language.  2 totally different things.

    I'm afraid that you would need to write a JavaScript complex and customized for this.  DW is not built by a behavior for what you want.

    You could nose autour Dynamic Drive or Hotscripts to see if you can find something close to what you want, perhaps in the form of a carousel.

    Good luck

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    www.Alt-Web.com/
    www.Twitter.com/ALTWEB
    www.Alt-Web.blogspot.com

  • Move the dialog box - start with the values defined at the current position?

    My apologies in advance if this is a stupid question.

    With a selected object and the active selection tool, I press return to get the dialog box move.

    For some reason, it seems random values entered in the horizontal and vertical fields. Instead, I just want the boxes to always start at 0 so that I can decide where the action, instead of having to manually delete these fields.

    Can someone put me straight on how to get that box to behave as I want what it?

    The numbers in the boxes are not random. They are the last move used values. They are kept to be used if you use a Cmd (Ctrl) d, the shortcut to repeat last transformation.

  • Get the current location of the user.

    I want to create an application in which the current position of the user should be displayed. Can someone tell me the logic (connection only part) If cannot tell the code...

    And here are some others:

    http://supportforums.BlackBerry.com/T5/Java-development/simple-location-API/Ta-p/1145951

    http://supportforums.BlackBerry.com/T5/Java-development/location-APIs-start-to-finish/Ta-p/571949

  • How to get the current line or the entire paragraph?

    Hello.

    I am facing the following problem:

    Suppose I have the following in FrameMaker:

    It is a sentence. And (end of single line)

    There also this sentence. (end of paragraph)

    It is a sentence. And (back)

    There also this sentence. (end of paragraph)

    It is a sentence. And (end of single line)

    There also this sentence. (return)

    But there is also this sentence (end of paragraph)

    It is a sentence. And (end of single line)

    There also this sentence. (return)

    There also this sentence. (return)

    But there is also this sentence (end of paragraph)

    What I want is this:

    Download the text of the entire paragraph where the insertion point of the cursor is.

    However, when exist from the ends of the hard line I want to change their behavior.

    This is the behavior to the foregoing:

    For the first example of the paragraph if the cursor is either first or second line I want to get the whole paragraph.

    Paragraph if the cursor is in the first line, I want only the first line. And if it's in the second row, I want only the second line.

    The third paragraph if the cursor in the first or second line, I want the first and second lines must be retrieved in plain text. Also, if the cursor is in the third line I want only to the third line.

    For the fourth paragraph, it functions as the third paragraph. If the cursor is in the third row I get only this one.

    Could you please provide of the FDK in C++ to start with code?

    It's a puzzle.

    As you are in the forum script, I am related to this here. You must understand the FDK C++ code yourself.

    There's not much to tease my brain with it. You get the point where the cursor is and pick up the pieces of text more line via the GetText() method, using a bit field which includes the FTI_String and the FTI_LineEnd. Each end of the line has a modifier that tells you if it's a hard or a return. You also get the offset in the paragraph of the current position of the cursor, and then create the necessary strings from the array of items of text returned by the GetText method.

    If you want the full execution of the code, ask someone to program it for you and be prepared to pay for the work.

    Good luck

  • Script of the current paragraph style

    Can someone tell me what is the code to return the paragraph style for the current position of the cursor.

    Also I can I ask something to the current paragraph is not using paragraph styles.

    For example, what would be the code to "make the current text of paragraph Red.

    Help would be much appreciated as we see questions that I'm a complete Newbie in scripting.

    if (app.documents.length > 0 && app.selection.length === 1 && app.selection[0].hasOwnProperty("baseline")) {
         // return the paragraph style for the current cursor position
         alert("Paragraph style: " + app.selection[0].appliedParagraphStyle.name);
         // Make current paragraph text Red (the 1st paragraph in the selection)
         app.selection[0].paragraphs[0].fillColor = "C=15 M=100 Y=100 K=0";
    }
    

Maybe you are looking for