Monday, 30 December 2013

put admob on flash

Action Script Code: STEP I: Credit: I found this on another site and would like to give credit to the author of pixelpaton.com The only change you need to make is to enter your website html url where you have placed the AD HTML FILE in the space where I have put : "*ENTER COMPLETE HTML URL HERE*". Where ever you want the AD, place the following code:
// imports
import flash.events.Event;
import flash.events.LocationChangeEvent;
import flash.geom.Rectangle;
import flash.media.StageWebView;
import flash.net.navigateToURL;
import flash.net.URLRequest;
import flash.events.MouseEvent;

// setup variables
var _stageWebView:StageWebView;
var myAdvertURL:String = "****ENTER COMPLETE HTML URL HERE****";
//


    {
    // check that _stageWebView doersn't exist
    if (! _stageWebView) {
        _stageWebView = new StageWebView () ;
        // set the size of the html 'window'
        _stageWebView.viewPort = new Rectangle(0,0, 800, 100);
        // add a listener for when the content of the StageWebView changes
        _stageWebView.addEventListener(LocationChangeEvent.LOCATION_CHANGE,onLocationChange);
        // start loading the URL;
        _stageWebView.loadURL(myAdvertURL);
    }
    // show the ad by setting it's stage property;
    _stageWebView.stage = stage;
}
function toggleAd(event:MouseEvent):void {
    trace("toggling advert",_stageWebView);
    // check that StageWebView instance exists 
    if (_stageWebView) {
        trace("_stageWebView.stage:"+_stageWebView.stage);
        if (_stageWebView.stage == null) {
            //show the ad by setting the stage parameter
            _stageWebView.stage = stage;
        } else {
            // hide the ad by nulling the stage parameter
            _stageWebView.stage = null;
        }
    } else {
        // ad StageWebView doesn't exist - show create it

    }
}

function destroyAd(event:MouseEvent):void {
    // check that the instace of StageWebView exists
    if (_stageWebView) {
        trace("removing advert");
        // destroys the ad
        _stageWebView.stage = null;
        _stageWebView = null;
    }
}

function onLocationChange(event:LocationChangeEvent):void {
    // check that it's not our ad URL loading
    if (_stageWebView.location != myAdvertURL) {
        // destroy the ad as the user has kindly clicked on my ad
        destroyAd(null);
        // Launch a normal browser window with the captured  URL;
        navigateToURL( new URLRequest( event.location ) );
    }
}
// setup button listeners

otherscript

/*admobtest*/ // create instance of StageWebView var _stageWebView:StageWebView = new StageWebView (); _stageWebView.stage = stage // set the size and location of the html 'window' // in this case x = 0, y=0, width = 480px, height = 80px _stageWebView.viewPort = new Rectangle(0,940,480,80); // url of html we want to load var myAdvertURL:String = "http://adsapplikasi.blogspot.com/"; // load the html page in to our StageWebView instance _stageWebView.loadURL(myAdvertURL);



1
2
3
4
5
6
7
8
9
10
// create instance of StageWebView
var _stageWebView:StageWebView = new StageWebView ();
_stageWebView.stage = stage
// set the size and location of the html 'window' 
// in this case x = 0, y=0, width = 480px, height = 80px
_stageWebView.viewPort = new Rectangle(0,0,480,80);
// url of html we want to load
var myAdvertURL:String = "http://terrypaton.com/ads/exampleAdvert.html";
// load the html page in to our StageWebView instance
_stageWebView.loadURL(myAdvertURL);

replaced my publisher ID with XXXXXXXXXXXXXXX – put your own there, also this is in testing mode – see line 10.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<body bgcolor="#000000">
<script type="text/javascript">
var admob_vars = {
pubid: 'XXXXXXXXXXXXXXX', // publisher id
bgcolor: '000000', // background color (hex)
text: 'FFFFFF', // font-color (hex)
ama: false, // set to true and retain comma for the AdMob Adaptive Ad Unit, a special ad type designed for PC sites accessed from the iPhone.  More info: http://developer.admob.com/wiki/IPhone#Web_Integration
test: true // test mode, set to false to receive live ads
};
</script>
<script type="text/javascript" src="http://mmv.admob.com/static/iphone/iadmob.js"></script>
</body>
http://pixelpaton.com/?p=3313 <source>

Wednesday, 25 December 2013

Flash Apps : Exit Button


Paste this code into any action in any empty frame.

var exitingEvent:Event = new Event(Event.EXITING, false, true);
NativeApplication.nativeApplication.dispatchEvent(exitingEvent);
if (!exitingEvent.isDefaultPrevented()) {
NativeApplication.nativeApplication.exit();
}

create button and direct action to the empty frame that included with the code.

Automatically apps will exit.

Sunday, 1 December 2013

div scroll menu to section jquery


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>jquery scroll to particular position/item when click on link</title>
</head>
<body>
<form id="form1" runat="server">
<div >
<p><a id="top">Menu:</a> <!-- Anchor tag placed around the word "Menu" so menu will always be visible -->
<a href="#middle" class="scroll">Middle</a> <a href="#bottom" class="scroll">Bottom</a></p>
<div style="background-color:#c00width:50%height:1500px;">Top</div>
<p><a id="middle">Menu:</a> <!-- Anchor tag placed around the word "Menu" so menu will always be visible -->
<a href="#top" class="scroll">Top</a> <a href="#bottom" class="scroll">Bottom</a></p>
<div style="background-color:#2d80e8width:50%height:1500px;">Middle</div>
<p><a id="bottom">Menu:</a> <!-- Anchor tag placed around the word "Menu" so menu will always be visible -->
<a href="#top" class="scroll">Top</a> <a href="#middle" class="scroll">Middle</a>
<div style="background-color:#21b81ewidth:50%height:1500px;">Bottom</div>
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script  type="text/javascript">
$(document).ready(function() {
$(".scroll").click(function(event) {
$('html,body').animate({ scrollTop: $(this.hash).offset().top }, 500);
});
});
</script>
</form>
</body>
</html>


jquery scroll to particular position/item when click on link

email mailto: pretext

 <a href="mailto:designoutsourced.com+info@gmail.com?subject=Maklumat%20lanjut%20pakej&body=Hai,%20saya%20berminat%20tahu%20lebi...