A Flash Developer Resource Site

Results 1 to 15 of 15

Thread: [RESOLVED] [HELP] GameJacket, work damn it!

  1. #1
    Trainee coder Viza's Avatar
    Join Date
    Sep 2006
    Location
    Melbourne, Down under
    Posts
    513

    resolved [RESOLVED] [HELP] GameJacket, work damn it!

    Hey again,

    Basically, I'm trying out gameJacket instead of MochiAds to see which one is better, but at the moment I'm having a lot of trouble implementing the ads into my game.

    The problem: When I get the game approved (admin approved) the game loads the ads fine, but when it's supposed to gotoAndStop() to the 'menu' frame (after the ads are finished), I get a blank screen. My menu music plays (which suggests that it is moving to the menu frame, since the music only activates on this frame) but otherwise there's no on-screen activity as there should be.

    It's so hard to test this 'cause I can only properly run their code when in their testing browsers (and only after it gets approved which takes FOREVER); local testing isn't allowed. So I strip the game of all GJ code, and run it, and IT WORKS (as it should)! This suggests to me that it's a problem with the addition of the GJ ad code.

    Here's some code I'm using: On Frame #1:
    PHP Code:
    #include "GameJacketAS2.as"
    trace("at #1");
    function 
    security_ok() {
        
    _root.gotoAndStop(2);
        
    trace("security pass");
        
    }
    function 
    security_fail() {
    trace("security fail");
    }
    // Stop the playhead to prevent bumping into any other parts of the game
    stop(); 
    On frame #2:
    PHP Code:
    function gotoGame():Void {
        
    _root.gotoAndStop(3);
        
    trace("play game");
    }
    // Create a call to the GameJacketSec to display an advert

    // Firstly create an object to hold all of our options
    var adOptions:Object = new Object();

    // Add a reference to this in our options
    adOptions.adDisplayObject _root;

    // Set the preferred background colour of the advert
    // The code below randomly selects a colour
    adOptions.bgColour 0x264969;

    // Set the alpha level of the background
    // 0 = fully transparent, 100 = Solid colour
    adOptions.bgAlpha 80;

    // Pass in the name of the function to run when the advert is complete
    // An end function must be entered
    adOptions.endFunction gotoGame();

    // Call The Ad
    showAd(adOptions); 

    ...and frame#3 is the main menu

    The reason why I'm posting this here is 'cause the gameJacket support is practically non-existant, and I need some help ASAP (the game needs to be released as soon as it's ready, which should be now!). I realise most of you guys use mochiAds, but I know at least the GamingYourWay dudes use GJ so maybe you guys can tell me what's going on?

    So yeah, this is pretty damn urgent, and so any help at all would be appreciated.

    Viza.
    Last edited by Viza; 12-24-2008 at 01:04 AM.

  2. #2
    Trainee coder Viza's Avatar
    Join Date
    Sep 2006
    Location
    Melbourne, Down under
    Posts
    513
    In case I didn't stress the urgency in that last post, I'd just like to say THIS IS VERY URGENT!..

    ... even if you haven't used GameJacket before, could you take a look at teh code anyway (to see if I've overlooked a syntax error or something).

    Do you think I need to use '_lockroot = true;'???????

    Viza.

  3. #3
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Sorry, I have only used it once when their SDK was much simpler and it was AS3 version.

    Have you tried making new movie clip for the ad instead of _root like their pdf suggests?
    adOptions.adDisplayObject = _root.createEmptyMovieClip("adHolder",
    _root.getNextHighestDepth());;

  4. #4
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    I've never had to call an ad like that, are you sure that's not for inter-level ads only ( Which I've had nothing but trouble with ) ?

    As a rule I've done what you've done on frame 1, and that's it. After that I have my preloader / logo.

    How it works is that people just load the wrapper swf, ie the 10k gameJacket swf. That displays the preloader ad and pulls the actual game swf from their server.

    Unless it's been updated a hell of a lot in the last 3 weeks or so, that's all you need mate.

    Squize.

  5. #5
    Yes we can tomsamson's Avatar
    Join Date
    Sep 2001
    Location
    Team Titan Secret Lair
    Posts
    4,666
    yeah, also i wouldn´t use the inter level ads, as squize said with the setup they hav they cause lots of problems right now.

  6. #6
    Trainee coder Viza's Avatar
    Join Date
    Sep 2006
    Location
    Melbourne, Down under
    Posts
    513
    Squize, I know this would be a massive ask, but should I email you the game source code. Yes, I'm really that desperate to get this fixed!...Or, you could post up some code you used from one of teh GYW games?..

    Btw, frame 1 just contains the security code, which from my understanding isn't really necessary for the ads to pop up (?)... So the ads are loading fine, it's just teh transition from frame 2 to frame 3.

    From my understanding the code I'm using is 'interstitual', which they say can be called upon at any point in the game. There's no other format to choose from (so no specific preloader one, you just set a property of the gameJacket class to true and a preloader will appear - so you can use it at the beginning of a game, which is what I'm doing)

    Thanks for the help guys, I REALLY appreciate it, even if the problem hasn't been resolved yet.

    Viza.
    Last edited by Viza; 12-24-2008 at 07:18 AM.

  7. #7
    Yes we can tomsamson's Avatar
    Join Date
    Sep 2001
    Location
    Team Titan Secret Lair
    Posts
    4,666
    do you know in which frame it stops and also whether the function gets triggered at all?
    When you can only test it when its on the system, so not locally an easy way to test it is to just add a textfield into which you write your debug/trace messages.

  8. #8
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Here's what I've got on frame 2 of my latest game that I've put on there,

    Code:
    // Include GameJacket AS2 code at the start of your game
    // GameJacketAS2.as file must be in the same folder as your fla when publishing
    #include "GameJacketAS1.as"
    
    // You must implement the following 2 functions on the _root timline
    // In reality any movieclips etc. will not be seen on this frame for very long
    
    // If everything OK then this function is called
    function security_ok(){
    	this.gotoAndPlay(this._currentframe+1);
    }
    
    // If anything is not OK then this function is called
    function security_fail() {
    //	this.gotoAndPlay(this._currentframe+1);
    	gameJacketSecurityWarning._visible=true;
    }
    
    setVariables();
    stop();
    ( It's an as1 game, so I've had to re-write the gJ code slightly so it'll compile ).

    You'll notice the setVariables(); call there, that's normally in the GameJacket.as but I've commented it out and put it in "my" code. There was a good reason for this, can't remember what the hell it is now
    ( It works, so it's not a bad thing ).

    gameJacketSecurityWarning is a mc on the stage, saying something like "There's a problem with game jacket, soz" just so the user gets some feedback if there is a problem. That's on frames 1 and 2, and on the clip I use
    Code:
    onClipEvent(load){
        _visible=false;
    }
    Man that's old school.

    "From my understanding the code I'm using is 'interstitual', which they say can be called upon at any point in the game."

    You are, so you don't need to be calling that during the preloader mate. Rip all that out, you can drop it back in there later when it's less time critical.

    If you want to send me the source get it over in the next hour or so mate, but try what I've written above, as that's pretty much all I'll be doing to your code.

    Squize.

  9. #9
    Trainee coder Viza's Avatar
    Join Date
    Sep 2006
    Location
    Melbourne, Down under
    Posts
    513
    Yup, that would seem like a really good idea, but in the first 3 frames I put things onto the stage to see what the hell was going on and NOTHING appeared on screen after the ads. I'm not sure what to make of it...

    I suppose that defeats the purpose of using dynamic text to debug it in their system. So yeah, debugging is pretty much not possible - it's just trail and error atm :S. Thanks for the suggestion Tom!

    Viza.

    [EDIT]:Ok, thanks a lot squize. I'll be trying that out. If it fails I suppose I'll be sending you some source, but I don't expect much more than what you've done already. Cheers.

    So what you're saying is I shouldn't even need to call that ad on my frame 2. It will be called upon a security pass? And is setVaraibles a function in their class? If so, wouldn't you need to have "gameJacketAS2.setVaraibles()", not "setVariables()"??
    Last edited by Viza; 12-24-2008 at 07:37 AM.

  10. #10
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    "So what you're saying is I shouldn't even need to call that ad on my frame 2. It will be called upon a security pass?"

    Yep. The wrapper loads up, then loads your game. It gets to frame 2 where it runs that security check. If it's all good it runs that ad ( And your game continues loading in the background, 'cause you've called that stop() command on frame 2 ), if not it doesn't do anything ( And you display the "Failed, oops" message ).

    You can test a pass and a fail condition on the gJ dashboard, although it doesn't actually show an ad there.

    "And is setVaraibles a function in their class? If so, wouldn't you need to have "gameJacketAS2.setVaraibles()", not "setVariables()"??"

    Yes it's in their class, but you can just call it directly 'cause they've not really made a class, there's no instance or anything, it's just some functions in an .as file.
    ( So as soon as you include it, all the functions are available on _root ).

    Squize.

  11. #11
    Trainee coder Viza's Avatar
    Join Date
    Sep 2006
    Location
    Melbourne, Down under
    Posts
    513
    OK, thanks a ton Squize and everyone else. I've made some changes but am yet again waiting for an admin to come along and approve it. Just have to wiat for now...

    "You can test a pass and a fail condition on the gJ dashboard, although it doesn't actually show an ad there"

    Yeah, I tried those buttons and everytime I did I got a blank screen (same as when the ad is finished running). No idea what that's supposed to mean though. :/

    Oh and yeah, I see what you mean about the gameJacket.as file. It's not a class so doesn't deal with that kind of scope.

    Thanks again everyone.
    Viza.

  12. #12
    Trainee coder Viza's Avatar
    Join Date
    Sep 2006
    Location
    Melbourne, Down under
    Posts
    513
    Squize, you're my hero!

    IT WORKED! I used your code and did a few things of my own, and the latest version is working beautifally! I'm pretty sure it was the addition of the interstitual code that killed it, but i'm still not sure exactly why things were screwing up.

    The important thing is that it's fixed, and I have you guys to thank for it! Squize, I owe you a massive favour. Anything you need a hand with, anything at all (like, any ****ty/tedious tasks needed to be done), I'll do.

    Thanks again everyone,
    Viza.

    [EDIT:] quick question, when I download the 'game jacket' from my dashboard, should I be able to see the game when locally tested. 'Cause atm, all I see is a light blue blank screen...
    Last edited by Viza; 12-24-2008 at 08:49 AM.

  13. #13
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Sweet, glad you got it working mate. gJ can be painful at times, as you can't really test it locally, so you're doing it blind ( We've got a game to go on there, but like you the interstitial ads broke it, and I just can't face trying to get it to work, uploading it, finding it doesn't work, and so on ).
    Even normally it can be quirky with the security checks ( I've had to upload a lot of the gimme5games to gJ, I know this hell all too well ).

    I know they're working really hard on making it less like eating glass, but in the mean time it's still a mouth full of glass.

    Speaking of mouthfuls, let's talk about this favour you owe me.

    *unbuttons jeans*

    Merry Christmas mate, don't be shy in pimping the game when it's approved.

    Squize.

  14. #14
    Trainee coder Viza's Avatar
    Join Date
    Sep 2006
    Location
    Melbourne, Down under
    Posts
    513
    HAHAHa lmao!

    One quick thing though squize: I'm likely doing something completely worng again, but I can't seem to get the wrapper to load the game properly. Even when i test it on a site, (uploading/embedding the wrapper .swf as downloaded from the GJ site) all I get is a pale blue screen? The game is working though, as when I test it on the GJ site everything is fine...

    Viza.

    [EDIT:] Ok, seems to be working fine now... sorry about the frantic posts everyone. I've been thinking out aloud in my current stressed out state. :/ Everything's resolved for now. All there's left to do is pimp like no tomorrow (yes, even if that means staying up all night into christmas morning )
    Last edited by Viza; 12-24-2008 at 09:44 AM.

  15. #15
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Yeah, until they approve it you don't get to see anything.

    Pimp it, pimp it like there's no tomorrow

    Squize.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center