Highlighted

Show text on mouse click, hide on click

New Here ,
May 10, 2019

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!

TOPICS
Discussions

Views

394

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Show text on mouse click, hide on click

New Here ,
May 10, 2019

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!

TOPICS
Discussions

Views

395

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 10, 2019 0
Adobe Community Professional ,
May 10, 2019

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 10, 2019 1
New Here ,
May 10, 2019

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 10, 2019 0
Adobe Community Professional ,
May 10, 2019

Copy link to clipboard

Copied

you need to convert your text to an object so it can be referenced with code.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 10, 2019 0
New Here ,
May 10, 2019

Copy link to clipboard

Copied

I see convert to symbol or bitmap. I guess symbol?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 10, 2019 0
New Here ,
May 10, 2019

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 10, 2019 0
Adobe Community Professional ,
May 10, 2019

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;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 10, 2019 1
Adobe Community Professional ,
May 10, 2019

Copy link to clipboard

Copied

Here is a possible way to do it.

on off text.zip - Box

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

    }

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 10, 2019 0
Adobe Community Professional ,
May 10, 2019

Copy link to clipboard

Copied

read message 1.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 10, 2019 0
Explorer ,
Jun 06, 2019

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:-)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 06, 2019 0
Adobe Community Professional ,
Jun 06, 2019

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)

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 06, 2019 0
ClayUUID LATEST
Adobe Community Professional ,
Jun 06, 2019

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;

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 06, 2019 1
Adobe Community Professional ,
Jun 06, 2019

Copy link to clipboard

Copied

Always make sure you refer to your code snippets. Screen Shot 2019-06-06 at 3.55.41 PM.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 06, 2019 0