Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7416537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:31:00+00:00 2026-05-29T07:31:00+00:00

I have an array of objects (objArray) and an array of actions (actArray). Both

  • 0

I have an array of objects (objArray) and an array of actions (actArray). Both arrays are in order, I mean, object at index 0 of objArray has to perform action 0 on actArray.

To make the explanation clear, lets imagine both arrays have 3 objects, obj0, obj1 and obj2.

obj0 has to perform action 0 on actArray
obj1 has to perform action 1 on actArray
obj2 has to perform action 2 on actArray

these 3 operations (or n, in the case of the array) have to happen simultaneously.

When all animations end, I need the method animationsFinished to be called.

How do I do that?

I am beginning in Cocos. I have googled around and have not found any practical example around. I have found CCSpan but I don’t see how this can be used with multiple objects each one with its own action. thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:31:02+00:00Added an answer on May 29, 2026 at 7:31 am

    You can just perform the actions sequentially and they will occur at the same time.

    int yourAnimationDuration; //this needs to be set to whatever your animation speed is
    for(int idx = 0; idx < 3; idx++) {
        [[objArray objectAtIndex:idx] runAction:[actArray objectAtIndex:idx]];
        [self performSelector:@selector(someMethodToBeExecutedWhenAnimationFinishes) withObject:nil afterDelay:yourAnimationDuration];
    }
    

    Or if you want the animation-is-finished method to be executed only once, just take it out of the for loop.

    Edit:

    id finalAnimation = [CCSequence actionOne:[actArray objectAtIndex:idx] two:someMethod];
    

    This (I believe) will execute your method once the first action is completed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array of objects called objarray . Each object looks like this:
I have array of objects with created images (Object.Image), i want to show images
I have an Array that contains array objects. An array of Arrays. When I
I have an array of objects named x (that is Object[] x). When I
I have an array of objects: Object = { 1 : { name :
I have an array of objects populated by a .txt file Object[] punteggiTutti =
I have an array of objects in javascript, each of which in turn has
I have an array of objects like objArray = [{color:red, width:5, price:10}, {color:green, width:4,
I have an array of objects which I need placed in a certain order,
I have an array of objects which populate a UITableView . When a user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.