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
1 Correct answer
replace
this.Object(root)
with
exportRoot
Copy link to clipboard
Copied
replace
this.Object(root)
with
exportRoot
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
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
Copy link to clipboard
Copied
you're welcome.

