Problem with the getCharIndexAtPoint() method.

Just try to set up a basic script to detect the text when the user clicks on it. The following code:

trace (caesar_txt.getCharIndexAtPoint (300,300));

GetCharacter();

function getcharacter()

{

trace (caesar_txt.getCharIndexAtPoint (300,300));

}

Produced these results:

42

TypeError: Error #1009: cannot access a property or method of a null object reference.

to fl.text::TLFTextField/getCharBoundaries()

to fl.text::TLFTextField/getCharIndexAtPoint()

at Untitled_fla::MainTimeline/getcharacter()

at Untitled_fla::MainTimeline/frame1()

If the first command the trace, the character index in this point (42) is returned, but as soon as the trace command is called in a function he faces a null object reference, apparently in the getCharBoundaries method. The field of text in question exist on the stage, it is not created in the code, but I doubt it would be a problem. Appreciate any help you could give me.

I think you found a bug. I can reproduce it. The reason I think this is a bug is disable Word wrapping (select textfield, go to pass container and flow, defined behavior "Multiline no film"). The bug seems to only happen with active wordWrap.

I produced the TLFTextField with code and also placed on stage to hand, the two error if the word wrapping is enabled.

Disable word wrapping made your mistake disappear?

Tags: Adobe Animate

Similar Questions

  • Problem with the substring method

    I cannot using the substring method results in an "if" statement  To isolate the problem, I run the following code on the 9550 Simulator:

        String buff = "abcdef";
        String B = "";
        B = buff.substring(2, 3);
        Dialog.alert("B = " + B + ",  size = " + B.length());
        if (B == "c") Dialog.alert("Test passed");
        if (B != "c") Dialog.alert("Test failed");
        if (buff == "abcdef") Dialog.alert("xyz passed");
    

    When running I get the message "B = c, size = 1" message tracking "Test failed". and "xyz happened."  This last post seems to indicate that the "if" test is not having problem with channels.

    I tried to copy B on another channel and use it and adding spaces to the front and back and then cut, but none of those who have helped.  I even tried to change the test to B == buff.substring (2.3), but that no longer works.  When I change line 3 to B = 'c', I get the message "Test."

    Can someone tell me what is happening here?

    This seems to be the result wanted for me. The substring is only the letter c, because you start to position 2 (the third character because it is zero-based) and go down to 3 (which is impossible), but you check with the equality operator (==) and not the .equals of the String class that actually controls the characters method, then the test is a failure.

  • Problem with the Paint method

    Hello guys,.

    I develop a map-like application,

    the screen contains key components of towing,

    -on the upper part is an ObjectChoiceField where the user can select a card

    - and below which is on the plan that the user has selected

    The problem is that I use the paint method to allow the user at the image of pain, what causes my ObjectChoiceField to disappear. Any help? Please be easy on me, I'm totally new

    Example Code:

    private static final int HORZ_SCROLL_FACTOR   = 10;
        private static final int VERT_SCROLL_FACTOR = 10;
        int left = 0;
        int top = 0;
        int maxLeft = 0;
        int maxTop = 0;
    
        final String choices[] = {"3", "4", "5", "6", "23"};
        private ObjectChoiceField choiceField;
    
        private BitmapField imageOutputField;
        Bitmap bitmap;
    
        public NetworkingMainScreen() {
    
            setTitle("AUC Maps");
            imageOutputField = new BitmapField();
            choiceField = new ObjectChoiceField("Pick a Map:", choices)
            {
                protected void fieldChangeNotify(int context)
                {
                    getURL();
                }
            };
    
            add(choiceField); // doesn't appear
            add(new SeparatorField()); // doesn't appear
    
            add(new LabelField("Map retrieved:")); //doesn't appear
            add(imageOutputField);
    
        }
    
        protected void paint(Graphics graphics) {
            if (bitmap != null) {
                graphics.drawBitmap(0, 110, imageOutputField.getBitmapWidth(), imageOutputField.getBitmapHeight(),
                        bitmap, left, top);
            }
        }
    

    You try to create a screen where you can move an image larger than the screen?

    Try this:

    http://supportforums.BlackBerry.com/T5/Java-development/create-a-scrollable-image-field/TA-p/444955

    Have the user choose the card before arriving at the screen or use more menu items.

    The moving image field must focus to work properly. This scrolling while being able to focus on the ObjectChoiceField image will be delicate.

  • Display problem with the lineTo method

    Hello

    There is a code to draw a horizontal line below. My problem is that the quality of the screen is bad. How to run the code in order to have a better view of the line?

    var monDessin:Shape = new Shape();

    addChild (monDessin);

    monDessin.graphics.lineStyle (1, 0 x 990000, 1);

    stage.addEventListener (MouseEvent.MOUSE_DOWN, clicSouris);

    stage.addEventListener (MouseEvent.MOUSE_UP, relacheSouris);

    stage.frameRate = 2;

    var temp: Number;

    function clicSouris(pEvt:MouseEvent):void

    {

    var positionX:Number = pEvt.stageX;

    var positionY:Number = pEvt.stageY;

    temp = positionY;

    monDessin.graphics.moveTo (positionX, positionY);

    pEvt.currentTarget.addEventListener (MouseEvent.MOUSE_MOVE, bougeSouris);

    }

    function bougeSouris(pEvt:MouseEvent):void

    {

    var positionX:Number = pEvt.stageX;

    var positionY: number = temp;

    monDessin.graphics.lineTo (positionX, positionY);

    pEvt.updateAfterEvent ();

    }

    function relacheSouris(pEvt:MouseEvent):void

    {

    pEvt.currentTarget.removeEventListener (MouseEvent.MOUSE_MOVE, bougeSouris);

    }

    Change the line that defines your lineStyle use pixel reference:

    monDessin.graphics.lineStyle (1, 0 x 990000, 1, true);

  • java.sql.SQLException: problems with the native/lack of loading methods library

    Hi all

    Please let me know how to fix the exception "java.sql.SQLException: problems with the native/lack of loading methods library: no ttJdbc in java.library.path".

    Thank you
    Prabhu

    Published by: Nina Prabhu on November 20, 2012 02:12

    Hi Prabhu,

    Probably, you must specify the LD_LIBRARY_PATH variable. Like the following:

    export LD_LIBRARY_PATH=$TIMESTEN_HOME/ttoracle_home/instantclient_11_1
    

    Best regards
    Gennady

  • Problems with the library missing/native methods: No. ttJdbcCS in loading java.li

    IAM facing a problem when you plug the timesten customer on the server The SQL Exception that Iam is pasted below: -.

    Problems with the native/lack of loading methods library: no ttJdbcCS in java.library.path

    I work with MAC OS X 10.7.2 and my version of timesten customer is 11.2.1.0

    I also changed the preferences of 64-bit to 32-bit Java, but still whenever I tried to connect with the SQL Developer it gives me the error above.

    As far as I see it, the problem here is that, when a native Mac application is launched, it does not inherit together of the usewr that launches it seems to start with some default environments so the parameters such as LD_LIBRARY_PATH, DYLD_LIBRARY_PATH (equivalent on OS X) does not always seem proagate imto the app too, because it has only a TT 32-bit for OS X client to present :-(it is essential that everything runs in 32-bit mode. -d32 must run the JAVA virtual machine in 32 bit mode, but it can be necessary also other things.

    I'm not an expert on Eclipse, but it is very likely that there are too many settings for things like 'path of the native library' and so on...

    Chris

  • Problem with the method. load()

    Hello

    I have a problem with the. jquery load().

    In my composition, in compositionReady, I use. load() to load a file external html in a regular element of edge - no problem here.

    The loaded HTML code contains a div id = 'spot' - I would like to clik top and pull a comand edge, such as 'play symbol' or 'move this item '...

    the problem is: How can I contact this div?

    I tried variuos solutions:

    $("spot")

    sym.getComposition () .getStage (). $("spot")

    ... and mix a lot...

    I originally thought to write something like

    {$("spot").click (function ()}

    Alert ('clicked spot.');

    })


    Thank you for helping me!


    This will not work because the loaded html file is completely external to the project dashboard animate. Elements in this external file, example #spot, is not 'really' connected to the edge project lead.

    Hope this makes some sense.

    Darrell

  • Problem with the HP G62 recovery disks

    Hello

    I'm having a problem with the restoration of the operating system on your laptop HP G-62. When I first bought the laptop, I was unable to make the recovery discs, so I ordered recently a few new HP. Because I have installed Ubuntu on the laptop, I wiped it from the disk hard drive used Wipedrive to remove the old Ubuntu operating system I had installed.

    Laptop computer reads the first disc ok and installs the component of windows, but when the screen lights up asking the two disc number it freezes and never installs anything when you try to move anything that used to screen it doesn't matter what and he used to install the second disk. He repeats just 'Please wait '.

    Thank you, Robert

    Hi, Robert:

    I can't help you get the recovery disks to work, but if you can read all 25 characters of the product key 7 windows on the bottom of your PC, you can do your own installation disc 7 windows to reinstall the operating system.

    Here's how:

    If you can read the Microsoft windows 7 25-character product key, you can download simple Windows 7 ISO files to burn on a DVD for the version of windows that is installed on your PC, and which is listed on the Microsoft COA sticker on your PC case.

    Burn the ISO with the option to burn the ISO on your DVD burning program and burn it at the slowest possible speed that will allow your program. This will create a bootable DVD.

    Or use the installation of Windows 7 USB/DVD tool to compile the ISO file that you download from Digital River. Link and instructions below. You need a 4 GB flash drive to use the USB compilation method.

    http://www.microsoftstore.com/store/msstore/HTML/pbPage.Help_Win7_usbdvd_dwnTool

    Use 25 characters on the PC product key to activate the installation.

    The key will activate a 32 or 64 bit installation.

    Then go to the support of the PC and driver page to install the drivers you need.

    Link to downloads ISO of W7 is below.

    http://www.mydigitallife.info/official-Windows-7-SP1-ISO-from-Digital-River/

    Paul

  • Problem with the numbers in the rows of cut and paste

    Hey,.

    I'm new to MAC and now have problems with the help of figures, I brought my windows Excel worksheets. On windows, I could cut a line and paste anywhere on this page and by practice that Excel would fill the void rank where I cut the content. but here on MAC it does not work, why?

    anyway I tried to live with it by cutting a line and for the collage, I used Insert > copied lines for paste swath and add a line for her. but last night I updated the numbers and now by the practice precedes the Windrow is stuck this time with a resized form, the line is resized to a big line.

    Why is this happening? If it can't be fixed, I can go back to a previous version of a number? This update of hate.

    Numbers is excellent NO then you should consider to guide your expectations.

    Cut number refers only to the content NOT the line, or cells.  Select when a row, and then use the cut command that you cut the contents of the cells.

    If you try to move a line from one place to another, you should try this method (which can work for you)...

    Select the line, then click and hold on the header line (up to the line "lift" on the table), the operation slide the line to the destination.

    Now drag the line:

    Now drop the line where you want to:

  • Problem with the Lenovo Z510 battery indicator

    I have an old Ideapad of one year z510. Last week, the battery indicator began to stuck on 100%. So not connected, he stops suddenly without notifying me with 10% and 7% remaining notification. I tried to uninstall the Microsoft ACPI control method battery compatible from the Device Manager but no change... Anyone has an idea what should I do otherwise.

    Thank you
    Ahmed

    In response to customer relationships of unexpected problems with the performance of the batteries portable Z500 and Z510, Lenovo made an update of the firmware of battery available via download on the Lenovo Forums.

    This battery firmware is intended to solve unexpected load following symptoms when a Z500 and Z510 mobile phone is turned on:

    • Battery is dead

    • Battery is not detected

    • Battery is detected and charged 100%, but when the power is removed, the laptop turns off immediately

    • When the battery is fully charged and the AC power is removed, the battery level falls considerably less than 10 minutes

    Please note a procedure step by step for the upgrade of the firmware is included in the .zip file, found in the file "ReadMe".

    The battery firmware update can be downloaded here: https://download.lenovo.com/lenovo/content/sm/z500_z510_battery_firmware_update.zip

    Thank you

  • Problems with the Power Manager 1.51 new T60 has

    I've updated Power manager version 1.51 has and I have problems with the gauge of Power Manager in the task bar. Life remaining battery is not updated once more. Is there any chance I can find an earlier version of the software that worked perfectly before? Or there is a method to solve the problem?

    Sincerely,

    Nikita Septucha


  • I have a problem with the HP Deskjet2545 do not print on the computer.

    Printer does not print. Computer says "printer error". Convenience store said that the problem is resolved. The printer is 'ready' doesnot even impression. What is the solution?

    Original title: hpDeskjet2545.

    Hi Matt,

    Thanks for posting your query in the Microsoft Community.

    Printers to print documents, photos, cards and calendars. You have a problem with the printer doesn't work is not on the computer. It can be difficult when something that is important to you does not work as expected. It's pretty simple and we're here to help you solve the problem. We work as a team and get this sorted out.

    Please answer these questions-

    (1) what is the exact error message?

    (2) have you tried the troubleshooting steps?

    (3) what is the version of Windows installed on the computer?

    (4) have you made changes on the computer before the show?

    I would like more information about the issue.

    Note: assuming that you are running Windows 7, I would like to suggest some troubleshooting steps.

    Method 1-

    I would have you look at the article-

    Why can I not print?

    http://Windows.Microsoft.com/en-us/Windows7/why-cant-I-print

    Solve printer problems

    http://Windows.Microsoft.com/en-us/Windows/printer-problems-in-Windows-help#fix-printer-problems=Windows-7&V1H=win8tab1&V2H=win7tab1&V3H=winvistatab1&v4h=winxptab1

    Method 2-

    I wish that you uninstall and reinstall the printer.

    See the article-

    Install a printer

    http://Windows.Microsoft.com/en-us/Windows7/install-a-printer

    Method 3-

    I would have you go through the troubleshooting proposed by HP guide.

    Check out the link-

    http://h10025.www1.HP.com/ewfrf/wc/documentSubCategory?tmp_task=solveCategory&LC=en&DLC=en&cc=us&product=3571292

    Let us know if you need assistance regarding the issue. We will be happy to help you. We at Microsoft, strive for excellence and provide our customers with the best support.

    Thank you.

  • Problem with the wireless on the system tray icon.

    Original title: wireless

    not found wirreless icon in the taskbar

    Hi Amourhbone,

    Thanks for posting your question in the Microsoft Community forum.

    It seems that you have a problem with the icon on the system tray wireless.

    I imagine the inconvenience that you are experiencing. We are here to help and guide you in the right direction.
    Provide us with a few details in order to better understand the issue.

    1. which version of the operating system are you using?

    2. deal with any problem with the wireless network using Internet?

    3. do you receive any error messages?

    4. did you of recent changes on the computer before this problem?

    I suggest you try the procedure described in the article and see if it helps.

    System icons do not appear in the notification area in Windows Vista or Windows 7, you must restart the computer
    http://support.Microsoft.com/kb/945011

    Important: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    http://Windows.Microsoft.com/en-us/Windows7/back-up-the-registry

    Get back to us and let us know the State of the question, I'll be happy to help you. We, at tender Microsoft to excellence.
  • Problem with the microsoft lifecam vx-5000 appication on my windows xp 32-bit

    I recently bought the lifecam vx-5000 and installed the software from the cd provided in the box. The webcam application fails and cannot open. It says that an error has occurred and must be closed. Also, the webcam is not detectable by Skype. I've download the latest version of the software (for my windows xp 32-bit) on the site but the problem still exists. What's not?

    Hello

    Looks like the camera might have a hardware problem or something running is interfering with
    the software and drivers.

    LifeCam VX-5000 - 3 year warranty
    http://www.Microsoft.com/hardware/digitalcommunication/ProductDetails.aspx?pid=014&active_tab=systemRequirements

    Microsoft Hardware warranties
    http://www.Microsoft.com/hardware/warranties.mspx

    Support for WebCam
    http://www.Microsoft.com/hardware/digitalcommunication/support/default.mspx
    and
    http://www.Microsoft.com/hardware/en-us/support

    Visit the Microsoft Solution Center and antivirus security for resources and tools to keep your PC safe and healthy. If you have problems with the installation of the update itself, visit the Microsoft Update Support for resources and tools to keep your PC updated with the latest updates.

    ===========

    Also check with Skype and Forums support for known issues with their programs.

    Skype - Support
    https://support.Skype.com/en-us/

    Skype - Forums
    http://Forum.Skype.com/

    ==============================================================

    Use the startup clean and other methods to try to determine the cause of and eliminate problems.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or
    Windows 7
    http://support.Microsoft.com/kb/929135

    How to change, add or remove startup programs in Windows 7
    http://www.SevenForums.com/tutorials/1401-startup-programs-change.html

    Autoruns - free - see what programs are configured to start automatically when you start your system
    and you log in. Autoruns also shows you the full list of registry and file locations where applications can
    Configure auto-start settings.
    http://TechNet.Microsoft.com/en-us/sysinternals/bb963902.aspx
    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • I have a problem with the simulation in Matlab 6.5 and LabVIEW for PID controllers

    I have a problem with the simulation in Matlab 6.5 and LabVIEW. I have a few methods for granting regulators PID in MATLAB to go but not of LabVIEW. Degree of international teams of two transfer but when I passed to the fourth degree is no longer working. We have changed the formula to calculate the parameters for the fourth year and gave me some good values for assignment of Matlab, but when I put on LabVIEW are not resolved. the formulas are available in PDF format and are. Please help me and me someone if possible. Thank you
    Lim.4 generation in comparison methods and the MATLAB program settings are for the service of transfer to the second degree.

    Hello Lascarica,

    I noticed that you are using the screw of PID. Gains on these screws are based on TIME instead of GAIN. You should be able to build a PID regulator and vary the gains and then compare the results.

Maybe you are looking for