Copy link to clipboard
Copied
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.
create a movieclip
add your textfield
draw a transparent or stage colored rectangle behind your textfield
add your movieclip to the main timeline
Copy link to clipboard
Copied
create a movieclip
add your textfield
draw a transparent or stage colored rectangle behind your textfield
add your movieclip to the main timeline
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
you're welcome. (and happy new year!)
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
you can with as3. oops, i see your edit.
with html5, use an alpha of 1% and/or stage colored.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Hi
Thank you for the Response. Since I use HTML5 and have a colored stage this shouldn't be a problem.
But I realized, now i have a new problem. Before I was able to change the color by clicking on the text field. Now my code in the action panel doesn't work for it. I suppose, it's because it's not a text-field anymore but a movieclip. Do you know if it's possible to be able and change the color again?
Before I just changed it with this code:
var _this = this;
_this.Text_1.on('click', function(){
_this.Text_1.color = 'black';
_this.Text_2.visible = true;
});
Thanks in advance.
Copy link to clipboard
Copied
double click that movieclip and you'll be on its timeline where you can edit the textfield, or if you want to use code, assign the textfield an instance name on the movieclip timeline (eg, tf) and use:
this.Text_1.tf
to reference the textfield (assuming the parent movieclip is the Text_1 instance).
var _this = this;
_this.Text_1.on('click', function(){
_this.Text_1.tf.color = 'black';
_this.Text_2.tf.visible = true;
});
Copy link to clipboard
Copied
Thank you very much for your help. I tried it and it works perfectly fine.
Wish u a great day.
Greetings HSS
Copy link to clipboard
Copied
you're welcome.