Skip navigation
Currently Being Moderated

TypeError: Error #2007: Parameter text must be non-null.

Dec 6, 2010 4:57 PM

I'm getting the following error:

 

TypeError: Error #2007: Parameter text must be non-null.

at flash.text::TextField/set text()

at Function/<anonymous>()

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at flash.net::URLLoader/onComplete()

 

 

This is my code:

 

myButton.addEventListener(MouseEvent.CLICK, onClickNewFB);

 

function onClickNewFB(e:MouseEvent):String{

var req:URLRequest=new URLRequest(e.target.name+".txt");

var infoLoader:URLLoader=new URLLoader();

var myInfoLoader:String;

infoLoader.load(req);

myInfoLoader=infoLoader.data;

 

infoLoader.addEventListener(Event.COMPLETE, loadFeedbackText);

//OSD_feedbackText.text=e.target.name;

return myInfoLoader;

function loadFeedbackText(e:Event):void{

//OSD_feedbackText.text=infoLoader.data;

OSD_feedbackText.text=myInfoLoader;

}

trace(myInfoLoader);

}

 

How do I fix this?  I'm sure I have an incorrect order of operations and I probably shouldn't declare a function within a function but I don't know how else to approach the solution.  Any help is much appreciated.

 

-markerline

 
Replies
  • kglad
    72,261 posts
    Jul 21, 2002
    Currently Being Moderated
    Dec 6, 2010 5:11 PM   in reply to markerline

    that means whatever you're trying to load, isn't being found by flash.  use the trace() function to see what you're trying to load


     
    |
    Mark as:
  • kglad
    72,261 posts
    Jul 21, 2002
    Currently Being Moderated
    Dec 7, 2010 12:05 AM   in reply to markerline

    you shouldn't be using an absolute path to your file.  use a relative path so everything works without security issues and without changing when you upload to a server.

     
    |
    Mark as:
  • kglad
    72,261 posts
    Jul 21, 2002
    Currently Being Moderated
    Dec 7, 2010 8:32 AM   in reply to markerline

    you're doing everything correctly except when constructing your urlrequest.  your argument is incorrect in the urlrequest constructor is problematic.

     

    use the trace() function to see what that is and debug.

     
    |
    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