Highlighted

mouseover javascript not working for me

New Here ,
Jul 24, 2020

Copy link to clipboard

Copied

I've successfully created a button that changes color when I hover and when I click it goes to a website.  Next, I want a mouseover of this same button to make another image come up and go away when the mouse leaves.  When I add the code for this, it doesn't work.  It worked fine in Action3.0.  I don't know what I'm doing, but how can I fix this code so it will work please? 
 
 
/* Click to Go to Web Page
Clicking on the specified symbol instance loads the URL in a new browser window.
 
Instructions:
1. Replace http://www.adobe.com with the desired URL address.
   Keep the quotation marks ("").
*/
 
this.btn_1mc.addEventListener("click", fl_ClickToGoToWebPage);
 
function fl_ClickToGoToWebPage() {
}
 
/* Show an Object
Shows the specified symbol instance.
 
Instructions:
1. Use this code to show objects that are currently hidden.
*/
 
this.mc_flyout_1.visible = false;
 
 
 
 
/* Mouse Over Event
Mousing over the symbol instance executes a function in which you can add your own custom code.
 
Instructions:
1. Add your custom code on a new line after the line that says "// Start your custom code" below.
The code will execute when the symbol instance is moused over.
frequency is the number of the times event should be triggered.
*/
var frequency = 3;
stage.enableMouseOver(frequency);
this.btn_1mc.addEventListener("mouseover", fl_MouseOverHandler_5);
 
function fl_MouseOverHandler_5()
{
// Start your custom code
// This example code displays the words "Moused over" in the Output panel.
mc_flyout_1.visible = true;
// End your custom code
}
 
/* Mouse Out Event
Mousing out of the symbol instance executes a function in which you can add your own custom code.
 
Instructions:
1. Add your custom code on a new line after the line that says "// Start your custom code" below.
The code will execute when the symbol instance is moused out of.
*/
var frequency = 3;
stage.enableMouseOver(frequency);
this.btn_1mc.addEventListener("mouseout", fl_MouseOutHandler_5);
 
function fl_MouseOutHandler_5()
{
// Start your custom code
// This example code displays the words "Moused out" in the Output panel.
mc_flyout_1.visible = true;
// End your custom code
}

 

Views

18

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

mouseover javascript not working for me

New Here ,
Jul 24, 2020

Copy link to clipboard

Copied

I've successfully created a button that changes color when I hover and when I click it goes to a website.  Next, I want a mouseover of this same button to make another image come up and go away when the mouse leaves.  When I add the code for this, it doesn't work.  It worked fine in Action3.0.  I don't know what I'm doing, but how can I fix this code so it will work please? 
 
 
/* Click to Go to Web Page
Clicking on the specified symbol instance loads the URL in a new browser window.
 
Instructions:
1. Replace http://www.adobe.com with the desired URL address.
   Keep the quotation marks ("").
*/
 
this.btn_1mc.addEventListener("click", fl_ClickToGoToWebPage);
 
function fl_ClickToGoToWebPage() {
}
 
/* Show an Object
Shows the specified symbol instance.
 
Instructions:
1. Use this code to show objects that are currently hidden.
*/
 
this.mc_flyout_1.visible = false;
 
 
 
 
/* Mouse Over Event
Mousing over the symbol instance executes a function in which you can add your own custom code.
 
Instructions:
1. Add your custom code on a new line after the line that says "// Start your custom code" below.
The code will execute when the symbol instance is moused over.
frequency is the number of the times event should be triggered.
*/
var frequency = 3;
stage.enableMouseOver(frequency);
this.btn_1mc.addEventListener("mouseover", fl_MouseOverHandler_5);
 
function fl_MouseOverHandler_5()
{
// Start your custom code
// This example code displays the words "Moused over" in the Output panel.
mc_flyout_1.visible = true;
// End your custom code
}
 
/* Mouse Out Event
Mousing out of the symbol instance executes a function in which you can add your own custom code.
 
Instructions:
1. Add your custom code on a new line after the line that says "// Start your custom code" below.
The code will execute when the symbol instance is moused out of.
*/
var frequency = 3;
stage.enableMouseOver(frequency);
this.btn_1mc.addEventListener("mouseout", fl_MouseOutHandler_5);
 
function fl_MouseOutHandler_5()
{
// Start your custom code
// This example code displays the words "Moused out" in the Output panel.
mc_flyout_1.visible = true;
// End your custom code
}

 

Views

19

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
Jul 24, 2020 0
kglad LATEST
Adobe Community Professional ,
Jul 25, 2020

Copy link to clipboard

Copied

use:

 

this.btn_1mc.addEventListener("click", fl_ClickToGoToWebPage);
 
function fl_ClickToGoToWebPage() {
}
 
var frequency = 3;
stage.enableMouseOver(frequency);
this.btn_1mc.addEventListener("mouseover", fl_MouseOverHandler_5.bind(this));
 
function fl_MouseOverHandler_5()
{
this.mc_flyout_1.visible = true;
}
 
this.btn_1mc.addEventListener("mouseout", fl_MouseOutHandler_5.bind(this));
 
function fl_MouseOutHandler_5()
{
this.mc_flyout_1.visible = false;
}

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...
Jul 25, 2020 0