Cannot Resolve a Multiname Reference Unambiguously JSON In Flash Builder 4.6 with SmartFox Server

Adobe has introduced native JSON support in Flash Player 11 as well in the subsequent versions of the Flash player, this error mainly happens because package name collision in the as3corelib (action Script  core library) with JSON class in the…

5
access of undefined property JSON in smartfoxclient.as flash builder 4.6 with flash player 11

Adobe has introduced native JSON support in Flash Player 11 as well in the subsequent versions of the Flash player, this error mainly happens because package name collision in the as3corelib (action Script  core library) with JSON class in the flash player. where Cannot Resolve a Multiname Reference Unambiguously JSON clearly says the error due to two or more classes with same name.

I am using Flash builder 4.6 with Flash player 11 for the development. When I try connect SmartFox server using Action Script 3 in Flash Builder 4.6 it shows following the error.

access of undefined property JSON in smartfoxclient.as flash builder 4.6 with flash player 11
I am sugesting simple solution to avoid the above error, Find the SmartFoxClient.as file in your installed directory (it/gotoandplay/smartfoxserver/SmartFoxClient.as).

Now look for the following two lines code

1. JSON.encode(obj)

2. JSON.decode(msg)

where JSON class referred with unqualified names that leads JSON class name collision. To avoid this error refer the above JSON class with their fully qualified name, so change the above lines like one shown in the below manner.

com.adobe.serialization.json.JSON.encode(obj)

com.adobe.serialization.json.JSON.encode(obj)

 

 .

5 responses to “Cannot Resolve a Multiname Reference Unambiguously JSON In Flash Builder 4.6 with SmartFox Server”

  1. KidT

    Solved my issues!!! Thanks!!!

  2. krishsal

    Great solutions you are great. (Nuvvu manishivi kaadu mama).

    Regards
    Krishsal

  3. Zux

    Thank you, work with flowplayer with ant compile .

  4. $.validator.addMethod(‘filesize’, function(value, element, param) {
    // param = size (en bytes)
    // element = element to validate ()
    // value = value of the element (file name)
    return this.optional(element) || (element.files[0].size <= param)
    });

    $(document).ready(function() {

    var validator = $('#test').validate( {
    submitHandler : function(form) {
    $("#sub").attr("disabled", "true");
    form.submit();
    },
    rules : {
    img : {
    required : true,
    filesize: 1024*1024
    }
    },
    messages : {
    img : {
    required : 'Please select file to upload',
    filesize : 'Please select file lesser than 1 MB'
    }
    }
    });
    });

Leave a Reply