adobe-flash/crossbridge

simple app used flashcc socket throws 'terminate called after throwing an instance of 'AS3::ui::var''

oldmanlv opened this issue · 1 comments

source code comm.cpp:

include <Flash++.h>

using namespace AS3::ui;
var connectHandler(void *data, var args)
{
printf("connectHandler called \r\n");
return internal::_null;
}
int main()
{
printf("start1\r\n");

flash::net::Socket socket = flash::net::Socket::_new();
//socket->addEventListener(flash::events::Event::CONNECT, Function::_new(&connectHandler, &socket));
//socket->connect("172.16.8.134", 1935);
socket->connect("45.22.20.23", 1935);
//socket->connect("127.0.0.1", 1935);

printf("end\r\n");
AS3_GoAsync();

return 0;

}

compile command:
"$(FLASCC)/usr/bin/g++" -g $(BASE_CFLAGS) comm.cpp -emit-swf -swf-version=17 -swf-size=200x200 -lFlash++ -lAS3++ -o comm.swf

I googled, but not find much information about the flascc socket, can you tell me why occurs the above error?thks a lot。

Try removing the
AS3_GoAsync();

If that doesn't work, it might be possible that the AS3 header isn't being included (I highly doubt this due to the nature of your issue). Try adding:
#include <AS3/AS3.h>

Let me know if this doesn't work, and I'll give it a shot to see if I can reproduce.