Forum ‹ ActionScript 3.0 ‹ Mochi breaks PlayerIO
2 posts
• Page 1 of 1
Mochi breaks PlayerIO
Hi all,
I uploaded my game at mochi, and now it seems that PlayerIO.connect is not working anymore. Any ideas?
I uploaded my game at mochi, and now it seems that PlayerIO.connect is not working anymore. Any ideas?
- GBurg
- Paid Member
- Posts: 73
- Joined: February 9th, 2011, 10:27 am
Re: Mochi breaks PlayerIO
By remote debugging I found out that the solution is to add this to your document class:
function MyGame() {
var _mochiads_game_id:String = "***";
stop();
this.addEventListener(Event.ADDED_TO_STAGE, addedToStage);
}
private function addedToStage(e:Event):void {
// now do all your playerio initialization in here
this.removeEventListener(Event.ADDED_TO_STAGE, addedToStage);
}
function MyGame() {
var _mochiads_game_id:String = "***";
stop();
this.addEventListener(Event.ADDED_TO_STAGE, addedToStage);
}
private function addedToStage(e:Event):void {
// now do all your playerio initialization in here
this.removeEventListener(Event.ADDED_TO_STAGE, addedToStage);
}
- GBurg
- Paid Member
- Posts: 73
- Joined: February 9th, 2011, 10:27 am
2 posts
• Page 1 of 1