actionscript 3 - Creating an AS3 game using the Platogo engine -
i started learn as3 , decided use platogo engine, , got stuck on first part. described follows:
connect game platogo
your game must connect platogo before function of platogo api can used. following code sample shows how call
platogoapi.connect()
. need pass game id edit game page, game's root , callback function. callback invoked once connection has been established. point on can continue normal game logic.
import com.platogo.api.platogoapi; import com.platogo.api.enums.platogostatus; import com.platogo.api.vo.platogoresponse; platogoapi.connect( [your game id], [reference stage], connecthandler ); function connecthandler( response : platogoresponse ) : void { if( response.status == platogostatus.ok ) { trace("you connected platogo & api ready used."); } }
where need paste code to? new file or in game's existing actionscript code? , in section?
do still need keep square bracket after substitute id game [your game id] , [reference stage] mean?
(could teach me how work normal flash engine, too?)
this might sound rude but, think you'd better off learn basic as3 before trying hook third-party-api.
your questions then:
the part '[your game id]' entirely substituted api key presume received somewhere. parameter [reference stage] substituted reference stage object, in flash pro you're safe pass in this.stage
.
your call plagotoapi.connect might this: platogoapi.connect(12345, this.stage, connecthandler);
Comments
Post a Comment