Skip to main content
March 3, 2009
Question

error : Severity and Description Path Resource Location Creation Time Id

  • March 3, 2009
  • 66 replies
  • 11254 views

i have this error :
Severity and Description Path Resource Location Creation Time Id
invalid character or markup found in script block. Try surrounding your code with a CDATA block. essai/src essai.mxml Unknown 1236103965593 182


my source is attach code


Many thanks for your help , 


Lionceau,

    This topic has been closed for replies.

    66 replies

    March 5, 2009
    it is so bad because i have this error , look :


    Severity and Description Path Resource Location Creation Time Id
    1067: Contrainte implicite d'une valeur du type Array vers un type sans rapport String. essai/src essai.mxml line 258 1236249799562 429



    Lionceau,
    March 5, 2009
    yes then i do this , ye s ? good way?

    private function onUploadClick():void
    {
    Alert.show("onUploadClick()") ;

    var filterArray:Array = [new FileFilter("*.*", "*.*")];
    _filePublisher.browse(UIDUtil.createUID());
    _filePublisher.browse( filterArray);
    Alert.show("2onUploadClick()") ;
    }


    that right ?


    Lionceau,
    Participating Frequently
    March 5, 2009
    Lionceau,
    your original call had two arguments. The documentation says you need just one, and that that must be an array of desired filters. So your call needs to have one argument, being an array. You have just created such an array in the line var filterArray:Array = [new FileFilter("*.*", "*.*")];
    Think about what you are doing instead of just guessing! If you have just made an array, and your next method call requires an array... what do you think should be the argument? Hint: it's probably not a UID number...
    Richard
    March 5, 2009
    yes browse () is a method

    Returns Boolean — Returns true if the parameters are valid and the file-browsing dialog box opens. The browse method returns false if the dialog box does not open, if another browse session is already in progress, or if you use the typelist parameter but fail to provide a description or extension string in any element in the array.

    but don't understand "Take "UIDUtil.createUID(), " out of your call and see what happens.."What?

    you want me to do this :
    private function onUploadClick():void
    {
    Alert.show("onUploadClick()") ;
    try
    {
    var filterArray:Array = [new FileFilter("*.*", "*.*")];
    _filePublisher.browse(UIDUtil.createUID());
    }
    catch (err: Error)
    {
    Alert.show("Error message: " + err.name + ", " + err.message, "Error");
    } // catch

    Alert.show("2onUploadClick()") ;
    }
    Participating Frequently
    March 5, 2009
    Lionceau,
    Great! Now we can see that the signature of browse is
    browse(typeFilter:Array = null):Boolean
    But your call was
    _filePublisher.browse(UIDUtil.createUID(), filterArray);
    So you were giving two arguments, and the type mismatch was arising because the first was not an array.
    Take "UIDUtil.createUID(), " out of your call and see what happens...
    Richard
    March 5, 2009
    March 5, 2009
    yes but where i find this ?

    Thanks ,



    Lionceau,
    Participating Frequently
    March 5, 2009
    Lionceau,
    so far so good, but that is a general description of the intent of the call. Somewhere in the documentation there will be a description of the signature of the arguments, ie a list of how many arguments are required/optional, their data types etc. That is what you need to track down at this stage.
    Richard
    March 5, 2009
    yes , look this :

    The method FileReference.browse () allows you to allow the user to browse the files to select one to upload. You can also use FileReference.browse () to allow the user to select multiple files at once.

    it is right. ?i am in a good way ?


    Lionceau,
    Participating Frequently
    March 5, 2009
    Lionceau,
    good! The type referred to in the error message is not the type of file you are accessing, but the programmatic type of the objects in the browse() call... so... what does your documentation say about the data types that the browse() call expects?
    Richard