hyperPad hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Can I "Get" an object for Actions?

    Scheduled Pinned Locked Moved Help and Support
    2 Posts 2 Posters 322 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      Deeeds
      last edited by Deeeds

      The Question: How do I write code once for different objects with different properties?

      Example:

      Depending on a state, I want to grab one of four objects and do:

      1. Fade to 50% opacity
      2. Move up
      3. Rotate
      4. Fade to full opacity.

      Can I create those four actions and then "GET" one of those four objects and apply the actions to it, on the basis of the state?

      or

      Do I have to repeat that tree of actions underneath each object and a branching if statement of some sort?

      Jack de WildeJ 1 Reply Last reply Reply Quote 0
      • Jack de WildeJ Offline
        Jack de Wilde @Deeeds
        last edited by

        @Deeeds you'd have to put the behaviours in each object with some ifs. That's what my suggestion the other day was partly about; a way to reference objects by name in behaviours.

        1 Reply Last reply Reply Quote 1

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post