A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: draw instance name from function

  1. #1
    Tai'shar Manetheren! skierbit's Avatar
    Join Date
    Dec 2000
    Location
    Provo, Utah
    Posts
    407
    I am attempting to use a function with a component (specifically the check box) and when the function is called, so on click, I want it to get the instance name of the component that was clicked. I have pondered a while over this to no avail. Is there a way to do this? Once again, any help would be more than welcome.

  2. #2
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    If you have this function as your change handler, the component parameter will be the instance name of the checkbox

    Code:
    function checkBoxChange(component) {
      trace("the checkBox " + component + " has been clicked");
    }

  3. #3
    Tai'shar Manetheren! skierbit's Avatar
    Join Date
    Dec 2000
    Location
    Provo, Utah
    Posts
    407
    How is the component parameter grab the name instance name? Is that a built in command?

  4. #4
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    Yes, when a changeChandler is called, the component that called it is passed as a parameter. very useful

  5. #5
    Tai'shar Manetheren! skierbit's Avatar
    Join Date
    Dec 2000
    Location
    Provo, Utah
    Posts
    407
    Originally posted by chi-styler
    Yes, when a changeChandler is called, the component that called it is passed as a parameter. very useful
    Thats fantastic! Wish I could have figured that out earlier, would have saved me a lot of hair....

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