# Protected functions and vars

**URL:** https://forum.kirupa.com/t/protected-functions-and-vars/297959
**Category:** Uncategorized
**Created:** [October 11, 2009, 8:52am UTC](https://forum.kirupa.com/t/protected-functions-and-vars/297959 "2009-10-11T08:52:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![grozavpaul](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@grozavpaul](https://forum.kirupa.com/u/grozavpaul)
#### Post date: [October 11, 2009, 8:52am UTC](https://forum.kirupa.com/t/protected-functions-and-vars/297959/1 "2009-10-11T08:52:14Z")

</div>

since i started using Flash Builder (Flex 4) i could see that it can auto-generate some handlers for example if i have a \<s:Button\> and i add a click="" i get a hint of “Generate Click Handler” and when i click Enter he writes this code:

```auto
**protected** function button1_clickHandler(event:MouseEvent):void
{
        // TODO Auto-generated method stub
 }

```

Now i knew about public and private things(functions/vars) and if a function was public i could execute it form outside of the class and inside. But if it was private i could only execute it from inside of the class and i couldn’t execute it from outside of the class.

So anyway, what does “ **protected** ” mean? what does it do?

I was thinking that if i load a SWF in my app I can go inside of that SWF and execute functions, read values from variables, or anything like that … and that seems like a **[SIZE=3]security problem[/SIZE]** … So i was wondering if the “protected” keyword could help me with this security problem. And if not, I would like to know what is it good for 🙂

[RIGHT]Thanks !  
[/RIGHT]
