dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: array of buttons

  1. #1
    Hi,

    I have created an array of buttons.

    Does anyone know how I determine which button is pressed
    so that I can perform a different action for each.

    Regards,
    a_non_amous.

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Posts
    173
    You best bet might be to simply set a variable with each, then poll that variable later.

    Regards

  3. #3
    Senior Member kusco's Avatar
    Join Date
    Nov 2001
    Posts
    681
    Hello a_non_amous,

    From what you have said I'm making the following assumption: you have an array of cloned buttons.

    I've done this before by using an invisible paint object that follows the mouse. I then setup a javascript routine that loops through each of the buttons and checks if there is a collision. When a collision is detected then you know which button was pressed and can then perform whatever action you need.

    Each of the buttons then only needs to set a variable to say that a button press has occurred.

    I use javascript but it's easy enough to do the same thing using Action Scripts.

  4. #4
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244

    Hi

    Originally posted by a_non_amous
    Hi,

    I have created an array of buttons.

    Does anyone know how I determine which button is pressed
    so that I can perform a different action for each.

    Regards,
    a_non_amous.
    You've been afully quite around here lately where have you been? Hey your homepage is gone!!!

  5. #5
    Hi,

    Kusco -- You are correct I have created my array of buttons using the clone method.
    Could you please supply me with a small snippet of code for referencing button presses on cloned buttons.
    can be "js" or "as" thanks in advance.

    Blanius -- yes my old web site has gone -- replaced by my new web site -- thats what I have been busy doing.
    That and learning Java, xml, fop and some cool 3d progs
    Now I am back -- As I need help from the experienced to ensure that my flash file sizes are as small as possible.

    Regards,
    a_non_amous.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center