Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
cómo acceder al clip de película de destino actual desde un clic de botón

Necesito ayuda con JavaScript en Adobe AnimateCC:

Tengo dos clips de película diferentes y un botón. Me gustaría poder hacer clic en un clip de película (convirtiéndolo en el objetivo actual) y luego hacer clic en un botón que llama al objetivo actual (el clip de película en el que se acaba de hacer clic) y hace que haga algo: mover 500 px a lo largo de x por ejemplo. Aquí está mi código hasta ahora. Cualquier ayuda será apreciada.

 this.grayPentagon_1_mc.addEventListener("click", clickSomePentagon.bind(this)); this.grayPentagon_2_mc.addEventListener("click", clickSomePentagon.bind(this)); function clickSomePentagon(e) { alert(e.currentTarget); var myPentagon = e.currentTarget; } this.red_btn_1.addEventListener("click", makeSomePentagonMove.bind(this)); function makeSomePentagonMove() { alert("move my pentagon"); myPentagon.x = 500; }

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Mala mía, pido disculpas. Debería haber declarado la variable var myPentagon fuera de la función clickSomePentagon, luego hacer referencia a la variable declarada en la función, así, que funciona.

 var myPentagon; this.grayPentagon_1_mc.addEventListener("click", clickSomePentagon); this.grayPentagon_2_mc.addEventListener("click", clickSomePentagon); function clickSomePentagon(e) { //alert(e.currentTarget); myPentagon = e.currentTarget; } this.red_btn_1.addEventListener("click", makeSomePentagonMove.bind(this)); function makeSomePentagonMove() { //alert("move my pentagon"); myPentagon.x = 500; }

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!