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

    Participating Frequently
    March 5, 2009
    Lionceau,
    OK, so you are now using Alert.show in a good way, and it is a runtime error not compile error. To get some more insight, code like this:
    private function onUploadClick():void
    {
    Alert.show("onUploadClick()") ;
    try
    {
    var filterArray:Array = [new FileFilter("*.*", "*.*")];
    _filePublisher.browse(UIDUtil.createUID(), filterArray);
    }
    catch (err: Error)
    {
    Alert.show("Error message: " + err.name + ", " + err.message, "Error");
    } // catch

    Alert.show("2onUploadClick()") ;
    }

    This will catch the runtime exception and all being well should show you some details in the Error alert that pops up giving you the error name and details. You should in fact see 3 alert boxes which will layer on top of each other in what seems back to front (ie 2onUploadClick() on top), since Alert.show() is non-blocking.
    Richard
    March 5, 2009
    yesyes , i see a error , "Error message: TypeError, Error #1009"


    Then i understand , it is with this you find this error .

    Well , then i have a bad type for my object ?
    But what is "type for my object " ?

    It is a movie or sound or gif or file ? that right?


    Lionceau,
    March 5, 2009
    sorry it is useless add this *.jpg", "*.jpg, i have ever this errror
    :(

    don't run , why?
    this code : _filePublisher.browse



    Lionceau,
    March 5, 2009
    Richar try this

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

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



    Then i look onUploadClick() but not 2onUploadClick()


    then i conclude the error is here :
    var filterArray:Array = [new FileFilter("*.*", "*.*")];
    _filePublisher.browse(UIDUtil.createUID(), filterArray);

    i see here
    http://d.hatena.ne.jp/haru-komugi/searchdiary?word=share&.submit=%B8%A1%BA%F7&type=detail

    i find this
    private function onUploadClick():void
    {
    var filterArray:Array = [new FileFilter("*.jpg", "*.jpg")];
    filePublisher.browse(UIDUtil.createUID(), filterArray);
    }



    i may add this *.jpg", "*.jpg , you understand ?
    i am in a good way?


    Lionceau,
    Participating Frequently
    March 5, 2009
    lionceau,
    for Alert.show documentation, check out
    http://www.adobe.com/livedocs/flex/3/langref/mx/controls/Alert.html#show()
    It is a convenient (but non-blocking) way to pop up some textual information, so that you can see what value some variable has, or see where code execution has reached. It is quick and easy, but becuase non-blocking can be confusing.
    You say "i haven't _filePublisher.browse( , why? "
    Well...
    a) what data type is _filePublisher? You should be able to find this out from your code.
    b) What data types are the expected arguments of the browse() method of this object? You should be able to find this out from your documentation!
    Are you getting a compile-time or run-time error?
    What does the documentation say about the cause of this error?
    Have you tried the other things I talked about (try/catch etc etc)?
    Richard
    March 5, 2009
    thanks , i dn' know how do Alert.show("onUploadClick()") ;


    then i look , my bug is here because i look this : test onUploadClick()

    but i haven't _filePublisher.browse( , why?


    look this source:

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




    lionceau,
    Participating Frequently
    March 5, 2009
    Lionceau,
    I am confused now as to what error you have. Are you still getting the type mismatch error or have you solved that?
    It sounds like you are now getting run-time errors. There are several ways to trap what is going on with these:
    a) use of try/catch blocks to identify the nature of the error
    b) use of the Flex debugger to step through code
    c) generation of trace statements into a convenient location (eg a textarea in your app, or into a console)
    d) Alert.show("explanation") statements at strategic places.
    If you are not familiar with these then check the documentation...
    A few posts ago you said "i haven't more time for Check the documentation" - checking documentation is not an optional time-consuming activity but an essential investment if you are going to code things accurately and well.
    Richard
    March 4, 2009
    sorry Richar i create two topics because i believe than my topics is not here .


    Then what is the error for my topics ?


    Many thanks for your help,


    Lionceau,
    March 4, 2009
    ok we can solve this error after , ?


    I put in comment this code then there is in my source no error
    (for me comment = /* */ and <!-- et --> )

    i understand then actually i have no error but file share don't run i can't know why !!


    Look my source :
    <mx:VBox width="40%" height="10%" right="0">
    <mx:DataGrid id="_fileGrid" dataProvider="{_fileDescriptors}" width="100%" height="90%">
    <mx:columns>
    <mx:DataGridColumn dataField="name"/>
    <mx:DataGridColumn dataField="size"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:HBox>
    <mx:Button id="upload_btn" label="Upload File" click="onUploadClick()"/>
    <mx:Button id="download_btn" label="Download File" click="onDownloadClick()"/>
    <mx:Button id="delete_btn" label="Delete File" click="onDeleteClick()"/>
    </mx:HBox>
    </mx:VBox>





























    /**
    * Handle the upload button click.
    */
    private function onUploadClick():void
    {
    var filterArray:Array = [new FileFilter("*.*", "*.*")];
    _filePublisher.browse(UIDUtil.createUID(), filterArray);
    }

    /**
    * Handle the download button click.
    */
    private function onDownloadClick():void
    {
    if(_fileGrid.selectedItem) {
    try{
    _fileSubscriber.download(_fileGrid.selectedItem as FileDescriptor);
    }catch(e:Error) {
    trace("Error download: " + e.message);
    }
    }

    }

    /**
    * Handle the delete button click.
    */
    private function onDeleteClick():void
    {
    if(_fileGrid.selectedItem) {
    _filePublisher.remove(_fileGrid.selectedItem as FileDescriptor);
    }
    }




    March 4, 2009
    yes Richard i understand , then i haven't more time for Check the documentation .

    Because i have other bug more important : with the file share !!

    I put in comment my error and i would like you see my share error
    I don't download a file,why?

    look tthis :
    Where is a error ? or not? ? because i can't download a file but don't have error for compile


    Thanks

    lionceau,
    /**
    * This application shows how to upload, download, delete, and display files
    * via AFCS's FileManager API, FilePublisher, and FileSubscriber components.
    */


    /**
    * Completes initialization and adds session listeners to catch session connected events.
    */

    private function init():void
    {
    // we are interested in both SYNCHRONIZATION_CHANGE (connection success) and Error events
    sessionManager.addEventListener(SessionEvent.SYNCHRONIZATION_CHANGE, onSessionEventNotification);
    sessionManager.addEventListener(SessionEvent.ERROR, onSessionEventNotification);

    // small status indicator
    notificationMessage.text = "Login to the AFC Service...";
    }

    /**
    * Handles sessionEvents such as synchronization, errors, and so on.
    * @see SessionEvent
    */
    private function onSessionEventNotification(p_evt:SessionEvent):void
    {
    //The type of event emitted when the session gains or loses synchronization with its source.
    if (p_evt.type == SessionEvent.SYNCHRONIZATION_CHANGE) {

    //if we are successfully connected
    if (sessionManager.isSynchronized) {

    notificationMessage.text = "Connected";

    // Get the file manager from our connectSession.
    if (!_fileManager) {
    _fileManager = sessionManager.fileManager;
    }

    // Get the user manager from connectSession for later use.
    if (!_userManager) {
    _userManager = sessionManager.userManager;
    }

    // create new file publisher to upload/delete files
    if(!_filePublisher){
    _filePublisher = new FilePublisher();
    _filePublisher.initialize();

    //Only a room owner can create the new file group (a group is like folder).
    if(!_fileManager.isGroupDefined(_groupid) && _fileManager.getUserRole(_userManager.myUserID,_groupid) == UserRoles.OWNER) {
    //Create a new node with a new groupid.
    var nodeConfig:NodeConfiguration = new NodeConfiguration;
    nodeConfig.sessionDependentItems = false; //Specifies whether files in the pod should be deleted as the session ends.
    _filePublisher.createAndUseGroup(_groupid, nodeConfig);
    }else {
    //otherwise, use assigned groupid
    _filePublisher.groupName = _groupid;
    }
    }

    // Create a file subscriber to download file.
    if(!_fileSubscriber){
    _fileSubscriber = new FileSubscriber();
    _fileSubscriber.initialize();
    }

    // Bind to the file manager's file descriptors array collection to display the datagrid user interface.
    _fileDescriptors = _fileManager.getFileDescriptors(_groupid);
    }
    }
    else if (p_evt.type == SessionEvent.ERROR) {
    // we get an error from connect session
    notificationMessage.text = "Error: " + p_evt.error;
    }
    }

    /**
    * Handle the upload button click.
    */
    private function onUploadClick():void
    {
    var filterArray:Array = [new FileFilter("*.*", "*.*")];
    _filePublisher.browse(UIDUtil.createUID(), filterArray);
    }

    /**
    * Handle the download button click.
    */
    private function onDownloadClick():void
    {
    if(_fileGrid.selectedItem) {
    try{
    _fileSubscriber.download(_fileGrid.selectedItem as FileDescriptor);
    }catch(e:Error) {
    trace("Error download: " + e.message);
    }
    }

    }

    /**
    * Handle the delete button click.
    */
    private function onDeleteClick():void
    {
    if(_fileGrid.selectedItem) {
    _filePublisher.remove(_fileGrid.selectedItem as FileDescriptor);
    }
    }




    Participating Frequently
    March 4, 2009
    Lionceau,
    OK, I see it now. So webCamPub is a WebcamPublisher object, but I suspect (you should check this) that WebcamSubscriber may be expecting an array - your original error was "Contrainte implicite d'une valeur du type Array vers un type sans rapport com.adobe.rtc.collaboration:WebcamPublisher"
    Check the documentation, but you might try declaring an array
    var pubArray: Array
    then populate it with
    pubArray.push(webCamPub)
    and finally fill the WebcamSubscriber property with the array pubArray instead of the single object.
    I repeat, this is something of a guess without the documentation which you should have, but the error message seems to point this way.
    Richard