Getting MochiAds working?

Monkey Targets Forums/Flash/Getting MochiAds working?

PoliteProgrammer(Posted 2013) [#1]
So I have a very simple game that's now pretty much finished, and I'd be interested in using Mochi to distribute it. The only problem is that I can't get Mochi with Live Updates to work. Specifically, I get the same problem that is discussed (without resolution) here:
http://www.monkeycoder.co.nz/Community/posts.php?topic=735#25242
That is, the ads are being correctly displayed, but I get the "Download the Latest Flash Player" message after I click the play button. Could anyone explain what causes this and how it can be fixed?
Thanks in advance!


Jesse(Posted 2013) [#2]
Are you on Windows or a mac?

If you are on Windows, make sure to download and install the 32bit version of the jave JDK and set the correct paths for it.

Mochi SDK is not compatible with the 64bit Version of Java, It will compile, make an fla file, will run by itself but will not execute once mochi ads is integrated.

if you are on a Mac and updated to the latest JDK. the latest JDK is 64 bit and you have to do some settings modification for it to compile for a 32 bit fla file. Let me know and I'll post some detailed explanation on how to do that.


skid(Posted 2013) [#3]
Unfortunately you may still be required to build your mochi release version using command line mxmlc command with extra arguments, from memory it was "-swf-version=13".

I think this is so mochi movie code and your app are baked from same version.


PoliteProgrammer(Posted 2013) [#4]
Thanks for the suggestions both, but I'm still getting the same problem. Let me just run through the things I've done in case something is wrong or I'm missing something:

1) I'm on windows and I've checked that config.winnt points to the x86 version of the JDK, which I think addresses Jesse's point above.
2) Is it sufficient to put -swf-version=13 inside the VMARGS variable inside flex_sdk_4.6\bin\mxmlc? If so, I have now done that... by the way, how does this affect the flash version I have to select when supplying the SWF to Mochi, as it only gives me a list from 10 to 11.5, if I recall?
3) I have placed Local _mochiads_game_id:String = "xxx" inside my Main:int() function, and placed MochiAPI_v3_9_5 inside my Main.build\flash folder, which I think is also sufficient after some research on the forums.
4) I recompile and supply the new SWF to Mochi, but then get the download the latest flash player error again when I open the SWF that Mochi returns.

Any other thoughts?


Jesse(Posted 2013) [#5]
I added it to the last line of the mxmlc like this :


java $VMARGS $D32 $SETUP_SH_VMARGS -jar "$FLEX_HOME/lib/mxmlc.jar" +flexlib="$FLEX_HOME/frameworks" "$@" -swf-version=13



without quotes.

I also read somewhere that this also works with the latest update of the JDK 64-bit.

once you added the Mochi adds, make sure to do a reload to your page so that it picks up the current fla file.


PoliteProgrammer(Posted 2013) [#6]
Oh, just realised why this might not be working; I should have emphasized that I'm on windows, and the script file is unix only, so appending -swf-version=13 does nothing for me because mxmlc.exe gets used instead. Do you happen to know what I should do to sort this out?


Jesse(Posted 2013) [#7]
on the DOS prompt type :

java -d32



if you get an error that means that you are still running the 64-bit version and you are going to need to change the Windows %path% to point to the 32-bit version.


PoliteProgrammer(Posted 2013) [#8]
Yes, you're right; I do indeed get an error.

Would it be sufficient to put e.g.
java.home=C:/Program Files (x86)/Java/jdk1.7.0_10/

inside flex_sdk_4.6/bin/jvm.config instead of editing the Windows path?

Now possibly a stupid question; where do I need to specify -swf-version=13? Appending it to java.args in the same file throws an 'unrecognized option' error.


Jesse(Posted 2013) [#9]
you won't need to do that for the windows version because there you either run the 32-bit version or the 64-bit version.


PoliteProgrammer(Posted 2013) [#10]
Okay, I'm now definitely pointing to the 32-bit version in jvm.config, but I still get the "Update Flash Player" problem when uploading to Mochi. :(
Any other thoughts?


PoliteProgrammer(Posted 2013) [#11]
I've just stumbled upon a solution to this problem that was previously noted here:
http://www.monkeycoder.co.nz/Community/posts.php?topic=2565#33912
Using what I think is an older version of Flex, e.g.
http://blogs.adobe.com/flex/files/2012/05/FlexLicense.swf?build=4.5.0.20967A&pkgtype=2
totally resolves this problem for me. I don't know why this works, but I'm noting it here in case anyone else ever experiences this issue.