AS2 External Interface

1 3 20th 2010 § 1 comment

I have another post for AS3 External Interface [ here ]… but AS2 is the hot shit right now so…
I have a blank “tracking button” on the stage (no I’m not building this out) and on roll over it vanishes. Turning of visibility was enough, but… just in case I knock it down 1000 pixels , well off the stage area.

import flash.external.ExternalInterface;

tracking_btn.onRollOver = function ():Void
{
 trace( "!" );

 tracking_btn._visible = false;
 tracking_btn._y = 1000;

 var clickTag:String = "A";
 var result:Object = ExternalInterface.call ("sendInfo", clickTag );
 trace( result );

};

So this code calls “sendInfo( var )” and replaces “var” with the clickTag. In this case “A”.

// set up functions for each tracking event
sendInfo = function( var )
{
	alert( "TEST: " + var );	

	switch( var )
	{
		// -- TRACKING
		case( 'A' ): // Box A
			www = 'LINK TO TRACKING SITE (A) GOES HERE';
			break;
	}

	//send data
	window.open = ( "http://" + www );
	alert( " " + www );
}

Tagged ,

§ One Response to AS2 External Interface

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

What's this?

You are currently reading AS2 External Interface at DrPunchBlog.

meta

  •  

    January 2010
    M T W T F S S
    « Dec   Feb »
     123
    45678910
    11121314151617
    18192021222324
    25262728293031
  • Archives

  • The Uber-Mannerist ...
    By Van Arno
  • RSS mtr.me

  • Translator