Swipe event to sroll text in TextField

what the code does looks like?

Add the textfield within the movieclip and raise the event on movieclip as like below:
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
import flash.events.TransformGestureEvent;
Multitouch.inputMode=MultitouchInputMode.GESTURE;
mc.addEventListener(TransformGestureEvent.GESTURE_SWIPE,onSwipe);
function onSwipe(e:TransformGestureEvent):void{
    if (e.offsetX==1){
        //User swiped towards right
        mc.x+=100;
    if (e.offsetX==-1){
        //User swiped towards left
        mc.x-=100;
    if (e.offsetY==1){
        //User swiped towards bottom
        mc.y+=100;
    if (e.offsetY==-1){
        //User swiped towards top
        mc.y-=100;
Change your code according to your needs.

Similar Messages

  • I can't get onAction event to work on an textField

    The behavior I want provide is, if I leave the text field I would like to run a "text field" change handler.
    First I tried to use "Seen Builder" to set an #onActionTestField, but it didn't work.
    After that I tried to set the the onAction from inside my code without success (See below)
    Is it not possible to use onAction events on a text field?
    private TextField weight;
    weight.setOnAction( new EventHandler<ActionEvent>()
    @Override
    public void handle( ActionEvent event )
    System.out.println("ActionEvent: " + event);
    });

    Here is an example (the recommended way):
    //Sample.fxml
    <?xml version="1.0" encoding="UTF-8"?>
    <?import java.lang.*?>
    <?import java.util.*?>
    <?import javafx.scene.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.*?>
    <AnchorPane id="AnchorPane" prefHeight="200" prefWidth="320" xmlns:fx="http://javafx.com/fxml" fx:controller="textffxml2.SampleController">
        <children>
            <TextField layoutX="126" layoutY="90" text="Click Me!"  onAction="#handleAction"  fx:id="textField" />
         </children>
    </AnchorPane>
    import java.net.URL;
    import java.util.ResourceBundle;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.fxml.FXML;
    import javafx.fxml.Initializable;
    import javafx.scene.control.Label;
    import javafx.scene.control.TextField;
    public class SampleController implements Initializable {
        @FXML
        private void handleAction(ActionEvent event) {
            System.out.println("You clicked me!" + event);
        @Override
        public void initialize(URL url, ResourceBundle rb) {
    }Here is another way:
    //Sample.fxml
    <?xml version="1.0" encoding="UTF-8"?>
    <?import java.lang.*?>
    <?import java.util.*?>
    <?import javafx.scene.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.*?>
    <AnchorPane id="AnchorPane" prefHeight="200" prefWidth="320" xmlns:fx="http://javafx.com/fxml" fx:controller="textffxml2.SampleController">
        <children>
            <TextField layoutX="126" layoutY="90" text="Click Me!"   fx:id="textField" />
         </children>
    </AnchorPane>
      public class SampleController implements Initializable {
        @FXML
        TextField textField;
        @Override
        public void initialize(URL url, ResourceBundle rb) {
            textField.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent event) {
                    System.out.println("Click ..." + event );
    }

  • Which event dispatched after text selection done on spark text area in Apple iPad using Adobe Flex 4

    I need to know which event triggered after text selection done in Apple iPad. This way i have done in desktop air app code (mouse events)
    protected function txtEditor_mouseUpHandler(event:MouseEvent):void
                if(txtEditor.selectionAnchorPosition != txtEditor.selectionActivePosition){
                    showNoteToolBar(event);
                    txtEditor.focusEnabled = true;
                    txtEditor.setFocus();
    But in Apple iPad how to achieve through "Touch Event" ? And also i need how to hide all context menu on Spaek TextArea?. Why Touch.End event is not fired after place cursor on text area ?
    Please help me !

    Ok, so I finally got it working but this is not ideal at all. Adobe really needs to give us some direction on how to properly deal with font embedding and TLF now that the release build breaks all functionality with loading runtime fonts and TLF.
    Problem:
    I am embedding collections of fonts (faces) into single family classes. Each individual face is registered with Font.registerFont(). I need to do this because I have to have mixed fonts within text flows - at least according to Alex H's recent blog post.
    Fonts do not display in TLF without doing the following:
    1. GlobalSettings.resolveFontLookupFunction = null;
    2. editor.textFlow.flowComposer.swfContext = ISWFContext(this.getFontContext("AnyFamilyNameFromAnyFontEmbedded", false, false, FontLookup.EMBEDDED_CFF));
    3. Instead of #2, use editor.textFlow.invalidateAllFormats();
    Either #2 or #3 need to be performed. If I have a spark richEditableText control in MXML with defined familes from the loaded fonts. I even tried placing the control into a separate state so it wasn't created until after the fonts were loaded... I still needed to invalidate the formats or set the context.
    The "AnyFamilyNameFromAnyFontEmbedded" does not need to be all of the embedded family names. It only needs to be one of them. Once one is used, all embedded fonts work. Also, I have to use the internal namespace to even get access to getFontContext, another oddity that, in my humble opinion, should never be necessary to create mixed style TLF content.
    My questions are then:
    1. Why am I required to use ISWFContext if I am using Font.registerFont()?
    2. Why is GlobalSettings.resolveFontLookupFunction = null; also required for this to work?
    3. What is the recommended workflow to embed fonts from multiple SWF files into the release build and have it work without having to jump through all these hoops?

  • How do i add a swipe event to stage or element?

    I like to add a swipe gestures to my animation.
    It should work on mobile.
    How do i add a swipe event? Do i need an invisible button?

    There is swipe right and swipe left events already in Edge Animate 3

  • Predictive Text in textfield

    Hi,
    I'm developing a Java Aplication Desktop, and I need have a predictive text on TextField of Jswing.
    How do this??
    Thanks... and excuse me , i talk less English

    Your requirement is generally known as "Auto-Completion". Google should turn up several excellent examples.
    1 ) Create a dictionary. A String[] will do
    2) Create an auto-completion document model that takes the dictionary.
    3) Use the JTextField.setDocument(myAutoCompleteDoc);

  • Can Touch Events and Swipe Events exist in the same frame and/or movie?

    After having fully tested a file with touch events I decided to add both a touch event and swipe event to a frame.
    I started by importing the following statements:
    Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
    Multitouch.inputMode = MultitouchInputMode.GESTURE;
    I then added th appropriate code but only touch events worked. I fiddled so more and only the gesture events worked. So before I move any further, I'm wondering if I'm wasting my time trying to get them to work together.
    So my questions are:
    Can Touch Events and Swipe Events exist together in the same frame?
    Can Touch Events and Swipe Events exist scene?
    A reference to more information about this would be helpful, if you know of any.

    I am aware of the latest releases of the components along with the plug-ins.
    This note is applicable to your scenario but you might face some issues related to organization rule wizard, custom user group creation and EAM DB log collection, as mentioned at the bottom of the note. No matter on what SP level you are with GRCFND_A at 10.1, you would face these issues.
    And so far, i don't think there is any more update from SAP on co-existence of plugins of 5.3 and 10.1
    Ameet

  • Browser's javascript engine causing high CPU load and lost swipe events

    I'm having performance issues on some websites. I think that my the javascript engine in the Playbook's javascript engine is causing high CPU usage, which means the device misses swipe gestures.
    Visit: http://www.bbc.co.uk/news/world-middle-east-15814035
    Once the page is loaded swipe to scroll up and down. On my device (and my friend's) it is incredibly slow. Sometimes it refuses to register any swipe events.
    Now turn off javascript and reload the page. Swipe to scroll up and down. Smooth as silk!
    My device is a new 16Gb with version 1.0.7.3312. Thanks

    I'm having the same problem on a number of websites with my 32gb Playbook. On the same sites that I notice slow, sometimes barely responsive swipes for scrolling my wife's iPad 2 handles them with ease. Disabling javascript fixes the problem however a lot of websites including gmail requires javascript to be enabled on your browser to load. I notice the problem quite a bit when using webmail to check my gmail account which is rather frustrating because it is my only option until PB gets a native email client. My PB is running software 1.0.8.4295, but the problem was also occurring when it was running 1.0.7.

  • How to print text from Textfield onto JList?

    Hi!I've typed a sentence on the textfield,and wat can i do to print out this sentence onto the JList i've created,after clicking on my JButton"Post".And on the JList,there must be numbering for each sentence.And New sentences will directly be added after the previous sentence.Hope to get a quick reply from any helpful people.Thanks.

    This should do it. (Typed straight in so untested).
    // create components and event listener
    JTextField textField = new JTextField();
    final DefaultListModel listModel = new DefaultListModel();
    JList list = new JList(listModel);
    JButton button = new JButton("Add");
    button.addActionListener(new ActionListener()
        public void actionPerformed(ActionEvent ev)
            String text = textField.getText();
            listModel.add(text);
    // now display them

  • Coloured Text in Textfield?

    Text in a textfield in a different colour... is this possible?
    Thanks in advance..
    Sandra

    Take a look at polish
    www.j2mepolish.org

  • My dad and my iPhones are under his apple id, i get all of his contacts, notes, calendars, events and sometimes texts. how do i stop our phones from sharing? also i have my own apple ID, how do i change apple IDs on my iPhone without losing all my stuff?

    i dont want to lose all my phones, contacts, events, apps etc. im sick of my dad getting texts from my friends and whenever i write a something in notes he can see it, and he gets all my contacts too. please help (:

    Have a look here...
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    With regard to Apple IDs...
    Anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID
    Apple ID FAQs >  http://support.apple.com/kb/HT5622
    You may also find this of use  >  How to Use Multiple iDevices with One Computer
    And... Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha

  • Space around text in textField.

    Hi,
    See attatched code.
    I made a simpel textFiled with some text and a border.
    Does anyone knows how to get rid of the extra space between
    the text and the border of the textField? I'm goning crazy with
    this.
    I made the width of the textFiled the width of the text and
    the height of the textField the height of the text. But because of
    the extra space the text will not show as I wanted to be.
    Is there a solution for this? To remove the extra space
    surrounding the text?
    Thanks.

    unfortunately no :(
    I tried that already. There is also no top margin and bottom
    margin property that I could use :(
    I have a text line, and I must position this line to the x/y
    coordinates of the righttop of the textField. But with this space
    it will not exactly position on the given x/y.
    There must be a solution to get rid of this space? Or maybe I
    use the wrong object to do this?
    Anyone?

  • I have a macbook pro,and my finger swipe to make the text larger isn't working... is there a setting i have to check to make this feature work again?

    on the mousepad of the macbook, if you take your thumb and index finger and swipe them either together,or apart,it make the text smaller or bigger... this used to work on firefox,but doesn't seem to work anymore,and i was wondering if there is a setting that i can change to get this working again....

    Some gestures have been removed in Firefox 4 and later.
    You can restore the zoom feature by changing the values of the related prefs on the <b>about:config</b> page.
    browser.gesture.pinch.in -> <b>cmd_fullZoomReduce</b>
    browser.gesture.pinch.in.shift -> <b>cmd_fullZoomReset</b>
    browser.gesture.pinch.out -> <b>cmd_fullZoomEnlarge</b>
    browser.gesture.pinch.out.shift -> <b>cmd_fullZoomReset</b>
    browser.gesture.pinch.latched -> <b>false</b>
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />
    *Use the Filter bar at to top of the about:config page to locate a preference more easily.
    *Preferences that have been modified show as bold(user set).
    *Preferences can be reset to the default or changed via the right-click context menu.

  • Center Text in TextField Dynamically

    How on earth do you center text within a text field
    dynamically....e.g. textField.align = "center" or
    textField.autoSize = "center" ....nothing works?
    BTW...is it just me or is the adobe site just plain slow and
    almost unusable to everyone else too. It has to be one of the
    slowest loading sites I visit and the menu at top takes forever to
    load completely also, Has there been discussion on that?

    You are using the align property incorrectly. You do not
    apply it directly to the textfield but to the textformat property.
    var format:TextFormat = new TextFormat();
    format.align = "center";
    textField.setTextFormat(format);

  • How do you justify text in Textfield?

    I have a PDF I created from a scan with textfield boxes on it. I've tried selecting the textfield and clicking the layout tab, but it won't let me change the justification of the text in the textfields from middle left to top left. How do I do this?
    Thanks

    On the right side of the LiveCycle Desinger window, there are three bars labeled "How To", "Paragraph & Text", and "Ojects". Try the "Paragraph & Text".

  • Problem in appending text in textfield

    When i am appending the text in Jtextfield component, It is appended in textField I can see these text on screen untill screen is filled. But when all rows is filled and any text is appended in textfield, i can not see these text. If i want to see these appended text, each time i need to scroll the screen. Can i see any appended text on screen without scrolling.

    Hi,
    Istead of JTextField , use JTextArea then it will give u this type of facility.
    rds
    Mohan Kumar
    i2 Technologies,
    Bangalore

Maybe you are looking for

  • Adobe flash player can install in mobile phone?

    where can find the adobe flash player that can install in mobile phone???

  • Adding objects to list

    Hi, I am new java. I have a probelm adding objects to list. This is the following code. class Test{ List <>dataList = new ArrayList<>(); public List<A> getAList(){ dataList.add(new A()); return dataList ; public List<B> getBList(){ dataList.add(new B

  • Can i publish HTML or JavaScript on my iWeb pages?

    I don't know how to embed html or javascript - i'm adding advertising affiliates (amazon, etc.) but i cannot post their code. i've had to past the gif logo and then create a link.

  • Remote windows 7 computer has lost trust with domain

    I have a remote windows 7 box on a domain that has lost its domain trust.   I would like to just unjoin/rejoin the machine to reset the trust but i cant log onto it with a domain account (even one that previously was logged onto the machine) and ther

  • I'm a new Oracle Developer, need a Documentation

    Hi all, Can you send me a link with a documentation about Oracle Database (Basics concepts, Stored Procedure and Triggers). I'm a dba Sql Server but a want to migrate. Tks, Mura