A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] Reference button from within the function it calls?

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Posts
    16

    [F8] Reference button from within the function it calls?

    I'm making a function to be called by different buttons, and I want the function also alter the appearance of the button itself. But I don't know how to refer to the button from within the generic function.

    Code:
    function set_style() {
    	trace('this: '+this);
    	trace('_parent: '+_parent);
    	trace('_root: '+_root);
    	trace('_level0: '+_level0);
    //none of these produce the name of the button
    }
    bt1.onRelease = function() {
    	set_style();
    	trace('[from button] this: '+this);
    //this produces the name of the button
    };

  2. #2
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160
    do you mean to say the function is never getting triggered when you click on the button?? If so make sure you have the function in the same place where you have the button.

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