# Function (Stuff)

**URL:** <https://forum.kirupa.com/t/function-stuff/157722>\
**Category:** flash\
**Created:** [August 3, 2005, 9:23pm UTC](https://forum.kirupa.com/t/function-stuff/157722 "2005-08-03T21:23:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [August 3, 2005, 9:23pm UTC](https://forum.kirupa.com/t/function-stuff/157722/1 "2005-08-03T21:23:23Z")

</div>

I have a question regarding something about functions I’ve seen in numerous scripts, but have never understood. For example, in the XML and Flash Photogallery tutorial, there’s some AS like the following:

```auto
function loadXML(loaded) {
if (loaded) {
//Some AS
}
} else {
//more AS
}
}
xmlData.onLoad = loadXML;

```

The question I have is about the loadXML(loaded) part of the function, and the if(loaded) part. What is “loaded”? I know xml.onLoad will return a success true/false, but what is going on in that if statement? Usually there’s a if loaded = true, or something like that inside the ()'s, but here there’s just one word, so I’m assuming it’s checking if loaded != 0, but what’s controlling what loaded is? Can someone explain what’s going on?

I think if it was xmlData.onLoad = loadXML(loaded), it would make more sense, or if there’s only one thing in the ()'s of a function, does Flash default to that when you try to make something equal to it?
