Skip navigation
mavenni
Currently Being Moderated

In need of help with this error

Aug 20, 2013 5:30 PM

Tags: #error #flash #as3 #flex #actionscript

so i have done some coding in flash develop for a flash app im building and while testing it i get this error message at runtime and i have no idea what it is and how to solve it heres the error message i get:

ArgumentError: Error #2173: Unable to read object in stream.  The class flex.messaging.io.ArrayCollection does not implement flash.utils.IExternalizable but is aliased to an externalizable class.

 

And heres the coding i've done

 

package  
{
          import flash.display.MovieClip;
          import flash.display.Sprite;
          import flash.events.MouseEvent;
          import flash.net.NetConnection;
          import flash.net.registerClassAlias;
          import flash.net.Responder;
          import flash.text.TextField;
          //import com.demonsters.debugger.MonsterDebugger;
          //import mx.Collections.ArrayCollection;
          //registerClassAlias("flex.messaging.io.ArrayCollection", ArrayCollection);
  
          /**
           * ...
           * @author DAR
           */
          public class Main extends MovieClip
          {
                    private var conn:NetConnection;
  
                    public var name1:TextField
                    public var name2:TextField;
                    public var name3:TextField; 
                    public var name4:TextField;
  
                    public var rating1:TextField;
                    public var rating2:TextField;
                    public var rating3:TextField;
                    public var rating4:TextField;
  
                    public var comments1:TextField;
                    public var comments2:TextField;
                    public var comments3:TextField;
                    public var comments4:TextField;
  
                    public var inputName:TextField;
                    public var inputComment:TextField;
                    public var inputRating:TextField;
                    public var submitReviewBtn:Sprite;
  
                    public function Main() 
                    {
                              //MonsterDebugger.initialize(this);
                              trace ("document class running");
                              setupConnection();
                              setupInputArea();
                              getReviews();
  
                    }
  
                    private function setupInputArea()
                    {
                              submitReviewBtn.addEventListener(MouseEvent.CLICK, addNewReview);
                    }
  
                    private function addNewReview(e:MouseEvent):void 
                    {
                              //Add review to database
                              var resAddReview:Responder = new Responder(onAddReviewSuccess, onAddReviewFail);
                              conn.call("yomo_films.addReview", resAddReview,  inputName, inputRating, inputComment);
                              gotoAndPlay(5);
                    }
  
                    private function addUserReview():void
                    {
                              var resAddReview:Responder = new Responder(onAddReviewSuccess, onAddReviewFail);
                              conn.call("yomo_films.addReview", resAddReview, "Amanda", 5 , "Really good movie");
                    }
  
                    private function onAddReviewFail(o:Object):void 
                    {
  
                    }
  
                    private function onAddReviewSuccess(o:Object):void 
                    {
                              //Refresh all Reviews
                              getReviews();
                    }
  
                    private function getReviews():void
                    {
                              //Create a responder object
                              var res:Responder = new Responder(onResult, onFail);
                              //Run a call to our service
                              conn.call("yomo_films.getReviews", res);
                    }
  
                    private function onResult(o:Object):void
                    {
                              trace("Success");
                              //MonsterDebugger.trace("onResult", o);
                              //Populate our reviews table
                              for (var i:int = 0; i < 5; i++)
                              {
                                        //get our current name / rating / comments object
                                        var item:Object = [i];
                                        var nameTxt:TextField = getChildByName("name" + (i + 1)) as TextField;
                                        var ratingTxt:TextField = getChildByName("ratings" + (i + 1)) as TextField;
                                        var commentTxt:TextField = getChildByName("comments" + (i + 1)) as TextField;
                                        //test if we have a name
                                        if (item.name)
                                        {
                                                  nameTxt.text = item.name;
                                                  ratingTxt.text = item.ratings;
                                                  commentTxt.text = item.comments;
                                        }
                              }
                    }
  
                    private function onFail(o:Object):void
                    {
                              trace("Failed");
                              //MonsterDebugger.trace("onFail", o);
                    }
  
                    private function setupConnection():void
                    {
                              trace("Setting up gateway connection");
                              //Create a new net connection
                              conn = new NetConnection();
                              //Connect to the net connection
                              conn.connect("http://localhost/amfphp/gateway.php");
                    }
  
          }


}

 

from the error i guessed it had something to do with flex but i dont use flex so i dont know what to do. I have been searching the for how to fix this error for over a week now and still no luck. i need some quick and fast help and intelligence on this please help!!

 
Replies
  • Currently Being Moderated
    Aug 20, 2013 11:36 PM   in reply to mavenni

    Use the -link–report option to see how an ArrayCollection is or isn't getting linked in.

     

    -Alex

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 21, 2013 9:49 AM   in reply to mavenni

    See the documentation on -link–report

     
    |
    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