Skip navigation
Currently Being Moderated

Movie clip not visible

Aug 27, 2013 4:06 PM

I the code below I want to add the following array of movie clips: activeLevelofTilesArray

 

After I added the code below the swf plays with the following error:

 

ReferenceError: Error #1069: Property [object S],[object T],...etc.

not found on builtin.as$0.MethodClosure and there is no default value.

    at WordArray/startTileTimer()

    at WordArray/activeLevelofTiles()

    at WordArray/tileGenerator()

    at WordArray/levelGenerator()

    at WordArray()

    at wordText/initWordText()

    at flash.display::DisplayObjectContainer/addChild()

    at BugGoopFSGame/startTimer()

 

I can also not see the movie clips.

 

To try to trouble shoot this I ran a trace statement successfully and I turned off any graphics that might be in front of it. Why can't I see my movieclips and how do I fix error 1069?

 

package

 

{

    import flash.display.*;

    import flash.text.TextField;

    import flash.events.Event;   

    import flash.utils.Timer;

    import flash.events.*;

    import flash.events.MouseEvent;

    import flash.media.Sound;

    import flash.media.SoundChannel;

 

    public  dynamic class WordArray extends MovieClip

        {

                public var wordtext:wordText =  new wordText;

                var activeWordArray:Array;

                var activeLevelofTenWordsArray:Array;

               var activeLevelofTilesArray:Array;

                public var letterArray:LetterArray;

                var tileTimer = new Timer(500,384);

 

        //Movie clips of letter tiles to be used

        public var a:A = new A();

        public var f:F = new F();

        public var g:G = new G(); //etc. for all mc's

 

        private var wordArray:WordArray;

 

        private var letterTiles:Array = [a,f,g..etc];

                              private var  lettersL01:Array = [a,a,f,f,f,g,g,h,h,i,i,n,n,n,o,o,o,o,s,s,t,t,t];

                              private var  lettersL02:Array = [th,th,  //etc for all levels..

 

                            public var letterLevels:Array = [lettersL01,lettersL02,lettersL03,lettersL04,lettersL05,lettersL06,le ttersL07,lettersL08,lettersL09,lettersL10,

                                                                              lettersL11,lettersL12,lettersL13,lettersL14,lettersL15,lettersL16,let tersL17,lettersL18,lettersL19,lettersL20,

                                                                              lettersL21,lettersL22,lettersL23,lettersL24,lettersL25,lettersL26,let tersL27,lettersL28,lettersL29,lettersL30];

 

public var  wordsL1W1:Array = ["a"];  //etc for all words

 

public var  wordsL01:Array = [wordsL1W1,...etc for all levels];

 

public var wordLevels:Array = [wordsL01,wordsL02,...etc. for entire word array]

 

                private var tf:TextField;

 

                // ***constructor code

                public function WordArray(_tf:TextField)

                {   

                    tf = _tf;

                    levelGenerator();

 

                }

 

                function levelGenerator():void

                {

                    //**To get next level of 10 words

                    if(wordLevels.length>0)

                    {

                        activeLevelofTenWords();

                        tileGenerator();

                    }

                    else

                    {

                    //Game is complete

                    }

                }

 

                function activeLevelofTenWords():void

                {

                    // na

                }

 

                function tileGenerator():void

                {

                    if(letterLevels.length>0)

                        {

                            activeLevelofTiles();

                        }

                    else

                        {

                            //Game is complete

                        }

 

                    }

 

                    function activeLevelofTiles():void

                    {

                        activeLevelofTilesArray = letterLevels.shift();

                        shuffleTiles(activeLevelofTilesArray);

 

                        startTileTimer();

                    }

 

                    function shuffleTiles(a:Array)

                    {

                        //works perfectly

                                    }

                        }

 

                    function startTileTimer():void

                        {

                            tileTimer.start();

                           trace(activeLevelofTilesArray);  // show in output pannel without errors

                            activeLevelofTilesArray.x = 399;

                            activeLevelofTilesArray.y= 30;

 

                            addChild[activeLevelofTilesArray];    //can not see these in swf ***these show in output pannel with an error code ReferenceError: Error #1069: Property [object F],[object O],[object F],...etc

 

                            trace("Letters should run"); //this shows in output pannel

                        }

 

 

//rest not applicable..

 
Replies
  • Currently Being Moderated
    Aug 27, 2013 4:16 PM   in reply to Charine -FB buggoop

    addChild[activeLevelofTilesArray];

     

    The addChild function uses parentheses, not brackets

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 27, 2013 4:45 PM   in reply to Charine -FB buggoop

    Yes, I suspected the next error you'd encounter would involve you trying to treat an array like an object.  But if you don't experience the error you are more likely to repeat it for lack of realizing you made it.

     

    Each of these three lines is trying to treat an array like it is an object on the stage.  It might contain references to such objects but is by itself just an array,

     

           activeLevelofTilesArray.x = 399; 

           activeLevelofTilesArray.y= 30;

     

           addChild(activeLevelofTilesArray);

     

     

    I don't know what the intention is, but you probably need to target individual elements of the array rather than the array.... as in... 

     

           activeLevelofTilesArray[some_index].x = 399;

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 27, 2013 5:51 PM   in reply to Charine -FB buggoop

    Do not nest that shuffle function within the activeLevelofTiles function.  Move it out on its own.

     

    Use the trace command to see what the tile_index value is as the loop(s) processes.  See if it makes sense to you or not.  I don't know why you are trying to assign it a value in a loop.  It can only exit that loop with a single value.   You should be declaring the tile)index variable outside of that loop.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2013 1:21 PM   in reply to Charine -FB buggoop

    You are repeating your error from the other day, declaring a variable inside a function... it cannot be seen outside of that function.

     

    I do not see what purpose that tileIndex function serves at all.  If you are shuffling the array, there is probably no need to be randomly picking index values.

     

    Instead of worrying about getting 3 lots working, get one lot working first.  Once you accomplish that it should hopefully be easier for you to reason out how to repeat it (any number of times, not just 3).

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2013 5:11 PM   in reply to Charine -FB buggoop

    As I already mentioned, that loop is not going to do anything for you except end with one value of tile_index.  I also said you should not be declaring that variable in the loop. 

     

    See if the following does something more along the lines of what you are after...

     

    function initLetterTiles():void {

          

         for(var j:int=0; j<3; j++){

     

               shuffle(activeLevelofTilesArray);

     

               for (var i:int=0; i < activeLevelofTilesArray.length; i++)

               {

                      trace (activeLevelofTilesArray[i]);

                      activeLevelofTilesArray[i].x = 399;

                      activeLevelofTilesArray[i].y= 30;

                      addChild(activeLevelofTilesArray[i]);

               }

         }

    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points