# Newbie Question

**URL:** <https://forum.kirupa.com/t/newbie-question/33445>\
**Category:** Uncategorized\
**Created:** [October 19, 2003, 4:42pm UTC](https://forum.kirupa.com/t/newbie-question/33445 "2003-10-19T16:42:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xEnOn](https://avatars.discourse-cdn.com/v4/letter/x/85e7bf/32.png) [@xEnOn](https://forum.kirupa.com/u/xEnOn)\
**Post date:** [October 19, 2003, 4:42pm UTC](https://forum.kirupa.com/t/newbie-question/33445/1 "2003-10-19T16:42:47Z")

</div>

Okay, I know my question might sound a little ‘n00b’ to most people here but well, I hope people here will be able to help this little n00bie here. :nerd:  
I have discover a few things about ActionScript which I don’t understand is this…  
When we want to declare a temporary variable, we use…  
var varname;  
but sometimes, when we wants to have a variable that will remains thru out the life of the movie, we just use it like…  
varname = “stringvalue”;  
and now this one is the one that i dun understand…  
varname = object();  
varname.onKeyDown = function() {  
trace(“test”);  
}

Why does varname has to be equals to an object? And when do I use this one? And What is this actually? How come it is usually followed by an event and then a function in such a way? I thought a function could be something like…  
function funcname($arguement) {  
trace(“test”);  
}  
Are there any differences in these two functions? And what does the first function mean actually?

Thanks a lot… 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 20, 2003, 3:40am UTC](https://forum.kirupa.com/t/newbie-question/33445/2 "2003-10-20T03:40:02Z")

</div>

when you set varname equal to an object ( ‘new’ object anyway ), you are creating a new object, and naming it varname. Then you can make functions for that object, as you said.
