Skip to main content
HSS Sursee
Known Participant
January 3, 2023
Answered

Textbox trigger interactive event

  • January 3, 2023
  • 2 replies
  • 668 views

I am having problems in making the whole text-box interactive. I want that a picture and a new text-box appear by clicking on another text-box. I only manage to do it by clicking precisely on the letters of my text-box. What I need is, that I can click on something like an outline for the interactivity to trigger, so the click doesn't need to be precise on the letters.

 

Thank you in advance.

    This topic has been closed for replies.
    Correct answer kglad

    create a movieclip

    add your textfield

    draw a transparent or stage colored rectangle behind your textfield

     

    add your movieclip to the main timeline

    2 replies

    JoãoCésar17023019
    Community Expert
    Community Expert
    January 3, 2023

    Hi.

     

    @kglad's approach works but you cannot use a full transparent shape to detect mouse events.

     

    So an alternative would be to turn the text field into a button and move the rectangle to the Hit frame.

     

    Regards,

    JC

     

    EDIT: if you're on as AS3 document, @kglad's approach is going to work. Sorry for not having asked for the document type first.

    kglad
    Community Expert
    Community Expert
    January 3, 2023

    you can with as3.  oops, i see your edit.

     

    with html5, use an alpha of 1% and/or stage colored.

    JoãoCésar17023019
    Community Expert
    Community Expert
    January 3, 2023

    Yeah, generally 1% is fine, but I have already faced situations in which even this low value didn't work. And using an alpha bigger than 0 feels like an workaround for me anyway.

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    January 3, 2023

    create a movieclip

    add your textfield

    draw a transparent or stage colored rectangle behind your textfield

     

    add your movieclip to the main timeline

    HSS Sursee
    Known Participant
    January 3, 2023

    Thank you very much for your response.

    I just tested it and it workes exactly like I wanted it to.

     

    Thank you very much and have a good day.

    kglad
    Community Expert
    Community Expert
    January 3, 2023

    you're welcome. (and happy new year!)