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

170
Views
How to detect which Sprite got clicked on

Im trying to figure out how to know which Sprite got clicked on

   var current_dots:Array<Sprite>= [];
   for(i in 0...4){
      var page = new Sprite(); 
      current_dots.push(page);
      page.on('pointerdown', dot_click);
      this.addChild(page);
    }
   function dot_click(){
      trace("CLICKED");
    }

since each sprite was declared in the for-loop im not sure how to identify which one is getting clicked

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

0

I figured a way to do it was like this

  function dot_click(e:InteractionEvent){
    for( i in 0...current_dots.length){
      if(current_dots[i] == e.currentTarget) {
         trace("Clicked")
      }
      
    }
  }

had to pass the interactive parameter

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!