Christen Lorensen
unread,Mar 13, 2012, 10:29:43 AM3/13/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to protobuf-actionscript3
Hi
I am using the project to generate protoobject, and it works fine.
But the generated classes are not correct when one class is using
another class.
part form my proto file
------------------------
package HnG_States;
message SearchPlayersResponse
{
required int32 request_id = 1;
required string response = 2; // See
SearchPlayersEventHandler.ReturnValues
repeated player_search_item items = 3;
}
------------------------
I get the file:
-----------------------
// Generated by the protocol buffer compiler. DO NOT EDIT!
package HnG_States {
import com.google.protobuf.*;
import flash.utils.*;
import com.hurlant.math.BigInteger;
import player_search_item;
public final class SearchPlayersResponse extends Message {
public function SearchPlayersResponse() {
registerField("requestId","",Descriptor.INT32,Descriptor.LABEL_REQUIRED,
1);
registerField("response","",Descriptor.STRING,Descriptor.LABEL_REQUIRED,
2);
registerField("items","player_search_item",Descriptor.MESSAGE,Descriptor.LABEL_REPEATED,
3);
}
// required int32 request_id = 1;
public var requestId:int = 0;
// required string response = 2;
public var response:String = "";
// repeated .HnG_States.player_search_item items = 3;
public var items:Array = new Array();
//fix bug 1 protobuf-actionscript3
//dummy var using HnG_States. necessary to avoid following
exception
//ReferenceError: Error #1065: Variable NetworkInfo is not
defined.
//at global/flash.utils::getDefinitionByName()
//at com.google.protobuf::Message/readFromCodedStream()
private var itemsDummy:HnG_States.player_search_item = null;
}
}
-----------------------
This will create an error: import player_search_item;
it is not using the package
What to do?