AS3 - Intergrating CPMStar Ads

21 posts (showing 1-20)
granitba

Market Level 0Community Level 0
0 posts

Does anybody have some code to display CPMStar ads?

posted 2016-04-09T21:26:30-07:00
DelaniStudio

Market Level 2Community Level 5
370 posts

private var preloaderMC:PreloaderMC;

private var ad:DisplayObject;

if (onUrl(["flashgamelicence.com"], root))
{
}
else
{
var CPMStarContentSpotID:String = "insert your code here";
ad = new AdLoader(CPMStarContentSpotID);
preloaderMC.adBox.addChild(ad);
}

You can download whole template from Their site

posted 2016-04-09T21:42:01-07:00
granitba

Market Level 0Community Level 0
0 posts

On Apr 09, 2016, DelaniStudio said:

private var preloaderMC:PreloaderMC;

private var ad:DisplayObject;

if (onUrl(["flashgamelicence.com"], root))
{
}
else
{
var CPMStarContentSpotID:String = "insert your code here";
ad = new AdLoader(CPMStarContentSpotID);
preloaderMC.adBox.addChild(ad);
}

You can download whole template from Their site

I've already downloaded the template.

But where in my preloader should I put that code.

In the Constructor? In the startup?

posted 2016-04-10T09:30:23-07:00
DelaniStudio

Market Level 2Community Level 5
370 posts

well at the start...and you need to stop preloader at starting your game, but to be there "Play" button, so player can see ad, and start game whanever he wants

posted 2016-04-10T15:35:12-07:00
granitba

Market Level 0Community Level 0
0 posts

Start of Class or startup? 

I've made it so that the game won't start even if it finished loading for now. And I'll add the play button soon.

Also what's PreloaderMC, if it is my preloader , why would I create a variable of type Preloader and then not assign it to something.

If it's something concerning Flash CS , know that I use FlashDevelop.

Sorry for the many questions, but I'm very confused.

posted 2016-04-10T16:31:51-07:00
DelaniStudio

Market Level 2Community Level 5
370 posts

Whats the difference? its same, after loading starts you add this, PreloaderMC is preloader movie clip that is movie clip from Adobe Flash that you've created - added graphic-splash art(in most cases that is splash screen from sponsor with their loading). And in Flash Develop you have your own class called "Preloader".... Here you pasted code of whole class.

http://pastebin.com/2djZ7z4h

posted 2016-04-10T17:33:42-07:00
granitba

Market Level 0Community Level 0
0 posts

Still getting this after removing everything that has to do with Google Analytics and Trackers:

C:\Users\CCKS\Desktop\New folder (2)\Flash\Flash\Projects\Test2\src\Preloader.as(31): col: 27 Error: Type was not found or was not a compile-time constant: PreloaderMC.
private var preloaderMC:PreloaderMC;
^
C:\Users\CCKS\Desktop\New folder (2)\Flash\Flash\Projects\Test2\src\Preloader.as(99): col: 22 Error: Call to a possibly undefined method PreloaderMC.
preloaderMC = new PreloaderMC();
^

posted 2016-04-10T19:09:27-07:00
DelaniStudio

Market Level 2Community Level 5
370 posts

You dont have movie clip in your swc file, that you create via Adobe Flash, you need to have that movie clip, and in that movie clip you need to create 1 more movie clip called "adBox" and it will work

posted 2016-04-10T20:33:13-07:00
granitba

Market Level 0Community Level 0
0 posts

But how am I gonna add that movie clip in my swf?

posted 2016-04-10T21:52:51-07:00
DelaniStudio

Market Level 2Community Level 5
370 posts

Export .swc from Adobe Flash, add that .swc file into your project, right click on it in FlashDevelop, add to library, and then this line private var preloaderMC:PreloaderMC; . 

preloaderMC:PreloaderMC is Movie Clip from your Adobe Flash that you have created.

posted 2016-04-11T13:33:35-07:00
granitba

Market Level 0Community Level 0
0 posts

But I don't have Adobe Flash to export the swc.

Can I download it from somewhere.

posted 2016-04-11T18:25:57-07:00
DelaniStudio

Market Level 2Community Level 5
370 posts

Adobes site Adobe Flash == Adobe Animate - You can't create graphics in FlashDevelop without Adobe Flash, FlashDevelop is only code oriented, not like Flash(both)

posted 2016-04-12T07:41:56-07:00
granitba

Market Level 0Community Level 0
0 posts

I know that FlashDevelop is only code oriented , but I don't have where to get Adobe Animate from.

Does that mean that I won't be able to get the ads to work?w

posted 2016-04-12T12:08:01-07:00
DelaniStudio

Market Level 2Community Level 5
370 posts

No, you can add  movie clip via code, and add it that way(havent tried this way).

posted 2016-04-12T13:20:28-07:00 | edited 2016-04-12T13:23:39-07:00
Vega

Market Level 0Community Level 2
106 posts

import CPMStar.AdLoader;

...

_adUnit = new AdLoader( _cpmstar_game_ad_id );
_adUnit.x = posX;
_adUnit.y = posY;
addChild(_adUnit);

posted 2016-04-12T17:06:11-07:00
granitba

Market Level 0Community Level 0
0 posts

Where's the definition of _adUnit, _cpmstar_game_ad_id, posX and posY?

I feel like I'm getting nowhere with this , so see my code and look if there's something wrong.

http://pastebin.com/YUxcBMQY

This is the preloader.

posted 2016-04-13T12:24:52-07:00 | edited 2016-04-13T12:54:30-07:00
DelaniStudio

Market Level 2Community Level 5
370 posts

If you have implemented ads good...wait few hours for them to "load" or 2-3 days.... When you implement them you can't see them immediately you need to wait few days - or hours - it depends from i don't know what.

posted 2016-04-13T14:30:16-07:00
granitba

Market Level 0Community Level 0
0 posts

Ok , I'll wait a few days and see what happens.

posted 2016-04-13T17:16:08-07:00
granitba

Market Level 0Community Level 0
0 posts

I waited 3 days , and still getting nothing. Should I wait more or?

EDIT: Six days , not three.

posted 2016-04-19T15:53:45-07:00 | edited 2016-04-19T19:55:34-07:00
Lord_Garland

Market Level 4Community Level 9
1873 posts

I still haven't heard anything back from CPMstar. Its been over a week. 

What is going on?

posted 2016-04-21T21:31:58-07:00