How do I use fewer events?

  • Usually I'm able to find the solution to a problem by looking through the manual or browsing the forums but I haven't been able to find the right answer this time. Or maybe I've been looking in the wrong places. Or just not understood!

    I use a button,an array, text object, and browser URL action. You click a button and it chooses a random array value. The text object displays whatever text is stored with each array value on x. So 0:'a' 1:'b' etc. Which is then linked to a URL action which, if you tap on the text, opens a different URL depending on the text. So if the text is 'a' it opens 'google', if the text is 'b' it opens 'yahoo' etc. I use a separate event for each 'compare text, open URL', is there a better way to do it? Otherwise I'm eventually going to end up with 1000's, maybe even 10,000+ events.

    Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You could make your array a 2 dimension array and store the web address you want to link to in the second dimension like the following:

    _____X

    ___| a | google.com |

    Y__| b | yahoo.com |

    ___| c | newegg.com|

    etc...

    This way you only have to reference the array to get both the text to display and the link to use.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)