Hi,
How can I write SF Server Extension in OOP with AS2.0. I don't know does Smartfox support it ?
My project is built in OOP with AS2 in client thus I want to write OOP in Server side too. but I can't '#include' or 'import' the AS class in server side.
were I wrong ? Im not familiar with Python or Java, never use it before.
and i'd like to write OOP with AS2 and it will safe my time if i can write OOP with AS2 in server side,How can i do it ?
OOP SF Server Extension with AS2.0
Heya-
Sadly you cant use AS2 (or 3 ) on the server side, just AS1.
You can however still create classes and such, just have to do it using the AS1 ways.
Ill demonstrate a bit below.
Creating object functions
Hope that helps a bit
_-Menser-_
PS: Anyone know why the forums only translate the first tag of a type used ([code] , [url], etc)? Its rather annoying.
Sadly you cant use AS2 (or 3 ) on the server side, just AS1.
You can however still create classes and such, just have to do it using the AS1 ways.
Ill demonstrate a bit below.
Creating object functions
Code: Select all
MyObject.prototype.functionname = function(param1, param2){
//function code here.
}
//Creating Variables on your object
MyObject.prototpye.MyVar = 1;
//Then when interacting later you can access them via
MyObject.functionname(arg1,arg2);
trace(MyObject.MyVar);
Hope that helps a bit
_-Menser-_
PS: Anyone know why the forums only translate the first tag of a type used ([code] , [url], etc)? Its rather annoying.
How to include my class ?
Thanks Menser,
But if i have 2 AS1 class in 2 files, How can i include it in to my server side file, it dosesn't accept "#include" or "import".
Do i have to code all classes in my server side(omg) it so diffrent to manage code ?!!!!
Other question is : if i worte 1 Java class with package name is :it.gotoandplay.extensions.examples and my class name is myHello, then I push myHello.java and myHello.class in to "..\SmartFoxServerPRO_1.5.5\Server\javaExtensions\it\gotoandplay\extensions\examples\" folder. I tried to use my myHello class in other Action script server side file(both loaded in room extension tag already) but that class still wasn't undefined in AS file. How can I use it ?
But if i have 2 AS1 class in 2 files, How can i include it in to my server side file, it dosesn't accept "#include" or "import".
Do i have to code all classes in my server side(omg) it so diffrent to manage code ?!!!!
Other question is : if i worte 1 Java class with package name is :it.gotoandplay.extensions.examples and my class name is myHello, then I push myHello.java and myHello.class in to "..\SmartFoxServerPRO_1.5.5\Server\javaExtensions\it\gotoandplay\extensions\examples\" folder. I tried to use my myHello class in other Action script server side file(both loaded in room extension tag already) but that class still wasn't undefined in AS file. How can I use it ?
Let me try it !
and other question is : if i worte 1 Java class with package name is :it.gotoandplay.extensions.examples and my class name is myHello, then I push myHello.java and myHello.class in to "..\SmartFoxServerPRO_1.5.5\Server\javaExtensions\it\gotoandplay\extensions\examples\" folder. I tried to use my myHello class in other Action script server side file(both loaded in room extension tag already) but that class still wasn't undefined in AS file. How can I use it ?
and other question is : if i worte 1 Java class with package name is :it.gotoandplay.extensions.examples and my class name is myHello, then I push myHello.java and myHello.class in to "..\SmartFoxServerPRO_1.5.5\Server\javaExtensions\it\gotoandplay\extensions\examples\" folder. I tried to use my myHello class in other Action script server side file(both loaded in room extension tag already) but that class still wasn't undefined in AS file. How can I use it ?
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 42 guests