00:00
00:00
Newgrounds Background Image Theme

N0vasu just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Smartfox avatarchat As2 help..

935 Views | 0 Replies
New Topic Respond to this Topic

Smartfox avatarchat As2 help.. 2016-03-31 19:46:16


Currently working on avatarChat when I ran into a problem because I’m extremely ignorant with all this coding stuff:

var doInterval;
function DoSomething(){

//Sending to server
var PancakeX:Number = int(myAvatar.disc._x)
var PancakeY:Number = int(myAvatar.disc._y)

smartfox.setUserVariables({PancakeX:PancakeX, PancakeY:PancakeY, init:true})
}

doInterval = setInterval(DoSomething, 24);
// I want the function to run every frame

I notice that the game will increasingly start to lag

When I look at the Output panel, it shows that the function is running every .0024 seconds as:

[Sending]: <msg t='sys'><body action='setUvars' r='7'><vars><var n=‘BobX' t='n'><![CDATA[1]]></var><var n='init' t='b'><![CDATA[1]]></var></vars></body></msg>

[Sending]: <msg t='sys'><body action='setUvars' r='7'><vars><var n=‘BobY' t='n'><![CDATA[1]]></var><var n='init' t='b'><![CDATA[1]]></var></vars></body></msg>

I assume the reason for the lag is the constant sending of the User variables to the smartfox server and was wondering if there is a way to clear the output panel in As2 or a php script I can write that’ll clear Flash’s Output Panel, if the Output panel is the problem?

:c