Skip to main content
Participant
February 24, 2021
Question

Javascript

  • February 24, 2021
  • 1 reply
  • 232 views

Hi there,

 

Hope y'all are well.

Someone can give a hand.

I'm converting a code form AC to JS, most of the job is already done, the problem that I am facing is how can I close the flash.

I'm using this function that I checked in Convert your ActionScript code to HTML5 (adobe.com)

window.open("javascript:flashFinished()", "_self").

Am I right, or is there another way to do it?

This is my code

this.stop();

var frequency = 3;
var exitStr = termi

stage.enableMouseOver(frequency);

this.btFinish.addEventListener("mouseover", function fl_MouseEventFinish()
{
mcFinish.gotoAndStop();
});

this.btFinish.addEventListener("mouseover", function fl_MouseEventFinish()
{
mcFinish.gotoAndStop();
});

this.btFinish.addEventListener("click", fl_MouseEventFinish.bind(this));

function fl_MouseEventFinish()
{
window.open("flashFinished()", "_self");

//this.gotoAndStop("S1");
}

Hope you guys can help me.
Hasta luego amigos




This topic has been closed for replies.

1 reply

Legend
February 24, 2021

That code is correct... IF you're trying to navigate to a website named "javascript:flashFinished()".

 

Are you?

Participant
February 24, 2021

thank you for your help,

I just wanted to close the flash (at the meantime I have realsed wrote wrong), BTW I found a way to do it, using the line below
window.open('','_self').close()

 

 

Legend
February 25, 2021

Umm... why would you not just use window.close()?