• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

convert AS3 in HTML5 Object(root)

Community Beginner ,
Feb 22, 2021 Feb 22, 2021

Copy link to clipboard

Copied

Good evening,

 

I try to convert some animate I made in AS3 to HTML5 . I don't know how to transform the following lines :

this.stop ();



this.O2_btn.addEventListener("click", dioxygene.bind(this));

function dioxygene()
{
	this.Object(root).dioxygene_clp.play();
}

this.glucose_btn.addEventListener("click", glucose.bind(this));

function glucose()
{
	Object(root).glucose_clp.play();
}

this.plus_btn.addEventListener("click", lectureCO2.bind(this));

function lectureCO2 ()
{
if (this.Object(root).glucose_clp.currentFrame==96){
	if(this.Object(root).dioxygene_clp.currentFrame==96){
		this.Object(root).CO2_clp.gotoAndPlay (2);
		this.Object(root).ampoule.gotoAndStop(2);
}
}
}

I just put some this but I think not in the right places.

 

I'll be happy if some of you can help me, please excuse my bad english.

 

Best regards

Views

372

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
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 22, 2021 Feb 22, 2021

replace

 

this.Object(root)

 

with

 

exportRoot

Votes

Translate

Translate
Community Expert ,
Feb 22, 2021 Feb 22, 2021

Copy link to clipboard

Copied

replace

 

this.Object(root)

 

with

 

exportRoot

Votes

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
community guidelines
Community Beginner ,
Feb 22, 2021 Feb 22, 2021

Copy link to clipboard

Copied

Hi,

 

thanks, it works until plus_btn which does nothing

this.stop ();



this.O2_btn.addEventListener("click", dioxygene.bind(this));

function dioxygene()
{
	exportRoot.dioxygene_clp.play();
}

this.glucose_btn.addEventListener("click", glucose.bind(this));

function glucose()
{
	exportRoot.glucose_clp.play();
}

this.plus_btn.addEventListener("click", lectureCO2.bind(this));

function lectureCO2 ()
{
if (exportRoot.glucose_clp.currentFrame==96){
	if(exportRoot.dioxygene_clp.currentFrame==96){
		exportRoot.CO2_clp.gotoAndPlay (2);
		exportRoot.ampoule.gotoAndStop(2);
}
}
}

 

so I imagine it's the conditionnal function or the current frame that need a change

 

Best regards

 

Thomas

 

 

Votes

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
community guidelines
Community Beginner ,
Feb 22, 2021 Feb 22, 2021

Copy link to clipboard

Copied

No, it's good, I've frogotten change the number of the frame to count the 0 image instead of 1

 

thanks a lot !!!

Best regards

Votes

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
community guidelines
Community Expert ,
Feb 22, 2021 Feb 22, 2021

Copy link to clipboard

Copied

LATEST

you're welcome.

Votes

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
community guidelines