# AS3 is confusing me (function class confusion)

**URL:** <https://forum.kirupa.com/t/as3-is-confusing-me-function-class-confusion/211126>\
**Category:** flash\
**Created:** [December 27, 2006, 6:09pm UTC](https://forum.kirupa.com/t/as3-is-confusing-me-function-class-confusion/211126 "2006-12-27T18:09:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Z11](https://avatars.discourse-cdn.com/v4/letter/z/97f17d/32.png) [@Z11](https://forum.kirupa.com/u/Z11)\
**Post date:** [December 27, 2006, 6:09pm UTC](https://forum.kirupa.com/t/as3-is-confusing-me-function-class-confusion/211126/1 "2006-12-27T18:09:27Z")

</div>

In the older AS’s you could call an array…

bob = new Array();

And then inside some random function be like…

bob[0] = “soldier”;  
bob[1] = “40”;

etc… or at least

\_root.bob[0] = “soldier”;

How can you do that in the new AS3?

Also I can’t seem to include anything… I thought include just stuck whatever I had into the middle of the page…

like if i had bob.as and inside it had only one line with … trace(‘hi bob’);

And i included that inside some random function, it would trace hi bob from that function… that just breaks my compiler when I try that… Why?

Thridly… I finnaly found out that to call a function from another class which was imported, I had to first import… then do something like…

public var game\_new:game; // to make it useable

then inside the initial function i did a

game\_new = new game(); //to me that seems very redundant, but ok i see how it doesn’t have to be…

then type  
game\_new.functionname(); //just to run that function

Is there an easier way?

Can the function ‘functionname()’ which was in game\_new. call a function from the original package? like… initial2() or something like that?
