AS 3.0 - passing Array problem

Posted on 2009-02-21
Last Modified: 2013-11-12

I am trying to pass two arrays to a function in an external class, which will take the array data and show gifs/play audio, take user input and store in an array to pass back to main movie.  I have checked and the arrays do contain data in the main movie, but I am doing something wrong when trying to access the array data in the external function.  My comments are in the code snippet below.

I hope someone can help me!!

Thanks and cheers!
//in main FLA, where mySectionTest is an instance of my external class and playSect is the //function in my class:


//function below is the one it calls but the trace statement in onTimer shows the array length //questions.length to be 0, when it should be 4.

public function playSect(sectIn:int,gifArrayIn:Array,questionsIn:Array):Array {

		var gifArray:Array=gifArrayIn;

		var questions:Array=questionsIn;



			return myData;


		public function playMe():void {

			var timer:Timer=new Timer(questionDelay,1);





		public function onTimer(evt:TimerEvent):void {

			var d:int=arraycounter-1;

			trace("testcounter Timer:"+ questions.length);


Open in new window

Question by:1Cougar
    LVL 19

    Expert Comment

    Whats the name of the array: gifArray?

    Accepted Solution

    Hi and thanks for commenting.  I actually solved the problem.  I had to declare gifArray:* and it works.


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
    Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
    The goal of the tutorial is to teach the user how to how to record live broadcast.
    The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now