Copy link to clipboard
Copied
I'd like to show a block of text on a mouse click, but the add with wizard function for this doesn't seem to work. I'm guessing that's because I need to specify that it's hidden first, then comes the reveal on mouse click, then the hide on mouse click. I'm sure this is ultra simple. I'm brand new (clearly). Thanks!
Copy link to clipboard
Copied
right click your text and click convert to symbol > movieclip and assign it an instance name.
what's the instance name of that text containing movieclip?
what do you want to click to show that t?
as3 or js?
Copy link to clipboard
Copied
There's no movie involved. I just want to click on something or press a button or symbol next to it, and show text. Javascript is preferable, in the HTML file. I need to use this on Squarespace, so I only get an add code box. Thanks.
Copy link to clipboard
Copied
you need to convert your text to an object so it can be referenced with code.
Copy link to clipboard
Copied
I see convert to symbol or bitmap. I guess symbol?
Copy link to clipboard
Copied
I'm able to make it do other things, like move. I can have it hidden to begin, but the on mouse over or click doesn't do anything.
Copy link to clipboard
Copied
Here is a possible way to do it.
var root = this;
var change = true;
this.changeStatus.addEventListener("click", hideshow.bind(this));
function hideshow() {
if (change) {
root.myTxt.visible = false;
change = false;
} else {
root.myTxt.visible = true;
change = true
}
}
Copy link to clipboard
Copied
Using your script, how can I incorporate createjs to make text fade-in when it becomes visible and fade-out when text goes to hide?
Thanks in advance:-)
Copy link to clipboard
Copied
this.text_movieclip.addEventListener("click", hideshowF);
function hideshowF(e) {
if (e.currentTarget.alpha>.5) {
createjs.Tween.get(e.currentTarget).to({alpha:.01}, 1000)
} else {
createjs.Tween.get(e.currentTarget).to({alpha:1}, 1000)
}
}
Copy link to clipboard
Copied
resdesign wrote
Here is a possible way to do it.
var root = this;
var change = true;
this.changeStatus.addEventListener("click", hideshow.bind(this));
function hideshow() {
if (change) {
root.myTxt.visible = false;
change = false;
}
else {
root.myTxt.visible = true;
change = true
}
}
Isn't your hideshow() functionally equivalent to this?
function hideshow() {
root.myTxt.visible = !root.myTxt.visible;
}
Copy link to clipboard
Copied
read message 1.
Copy link to clipboard
Copied
Your text needs to have an instance name then you can use the instance to hide it.
instance name: myTxt
var root = this;
// hide
root.myTxt.visible = false;
// show
root.myTxt.visible = true;
Copy link to clipboard
Copied
Always make sure you refer to your code snippets.