# Variables outside a package?

**URL:** <https://forum.kirupa.com/t/variables-outside-a-package/246971>\
**Category:** Uncategorized\
**Created:** [December 17, 2007, 10:58am UTC](https://forum.kirupa.com/t/variables-outside-a-package/246971 "2007-12-17T10:58:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![453\_0](https://avatars.discourse-cdn.com/v4/letter/4/dec6dc/32.png) [@453\_0](https://forum.kirupa.com/u/453_0)\
**Post date:** [December 17, 2007, 10:58am UTC](https://forum.kirupa.com/t/variables-outside-a-package/246971/1 "2007-12-17T10:58:39Z")

</div>

Ok, I’m not sure what’s the deal with this one but it’s quite funny… I was a bit bored and played around in flash, I defined a var outside the package, and funnily it sees it… it works… could someone explain, why ? And what’s the whole purpose of it ? Because I can’t really understand why they let variables work outside packages, and since you can’t control them by an access modifier, it’s even funnier…

```auto
package { import flash.display.Sprite; public class Test extends Sprite { public function Test():void { trace(crap); } } } var crap:String = "hello";

```

Thanks.
