Is Flex supposed the 'installed'?

Monkey Targets Forums/Flash/Is Flex supposed the 'installed'?

Farflame(Posted 2012) [#1]
Trying to get Flash working with Monkey. The Java SDK was straightforward but I don't know what I'm supposed to do with this Flex download (4.6). When I unzip the file, there's no installer or anything else that's executable, just a bunch of folders and files (nothing in there either). Am I supposed to just put these in a folder somewhere and point Trans to that location or should there be an installer?


skid(Posted 2012) [#2]
I keep mine in C:/flex_sdk

Don't forget to tweak your monkey config before restarting Monk.


Farflame(Posted 2012) [#3]
So I don't install it as such, just put everything from the zip file into c:/flex_sdk and then point the config file there? Cheers.

Hehe, glad I asked because I wouldn't have called it that, but the config file is already pointing at c:/flex_sdk, so that's handy. Guess that's why you did it. My game worked fine first time, thanks :)


Farflame(Posted 2012) [#4]
Is there an easy way of opening the .as file, or do I need to install something to edit it? I won't be needing to learn Actionscript or anything for all of this will I? :p


skid(Posted 2012) [#5]
Monkey builds the .as file into a .swf automatically so you don't need to get your hands dirty until you need to extend things with native modules etc.


Beaker(Posted 2012) [#6]
If you want to edit the .as then you can use FlashDevelop on PC? For Mac use TextMate.


Amon(Posted 2012) [#7]
I use NotePad++ to edit .as files.


Farflame(Posted 2012) [#8]
Worked out how to edit the .as files, but still can't work out how to add the Mochi ad's. Not sure where the line of code is supposed to go, any idea?


Gerry Quinn(Posted 2012) [#9]
If you just want the pre-game ad and live updates, all you need is something like this:

public class MonkeyGame extends Sprite{

public var _mochiads_game_id:String = "4bd567453434577";

... replacing the code with the code Mochi give you when you add a game.


Farflame(Posted 2012) [#10]
Thanks, got it :)

Hmmm, still not showing the ads though. I'm pretty sure I've done everything right. Copied the Mochi folder into the same place as the .as file, and copied the code from my Mochi panel into the .as file as you suggested like so..

public class MonkeyGame extends Sprite{
	
mochi.as2.MochiAd.showPreGameAd({id:"7bc366ad5126433", res:"640x480"});


I don't think there are any other steps? No changes to the game code or maybe it's something with my browser?


Farflame(Posted 2012) [#11]
Still not managed to work this out. Could somebody who's successfully worked out the MochiAds let me know where I'm going wrong? I wonder if something has changed lately because the advice above doesn't work, and I'm fairly positive I followed it exactly, so maybe they've changed their software and it's done differently now.

As I said above, I've copied the Mochi folder into the same location as the .as file, I've tried the code above, or the code Gerry gave (with my game code instead of his), but neither works. When I run my game, nothing happens - it just starts the game exactly as it did before.

I've also tried deleting the build folder, clearing the browser cache. Maybe I've missed something?


Gerry Quinn(Posted 2012) [#12]
I think I know what the problem is. You have to add the line of code I gave above, but after that you must upload the SWF file to Mochi. They will then add their wrapper and give you a new SWF file to download. Running that on a non-blocked site will show the ads.


Farflame(Posted 2012) [#13]
Nope, not working :(

I know you have to wait for them to approve your game, so maybe it's that, but when I do the above, I see no ads and also the dashboard still says it's received no ping from my game.


Farflame(Posted 2012) [#14]
Reading other post on the flash forum, is that the problem? Do I have to add a pre-loader before I can use Mochiads?