DIR : /home/kozerus/public_html/ruffle/vas/fmp_vas30.as

/home/kozerus/public_html/ruffle/vas

// =====
//
// fmp_vas21.as	0.3	20060430_1300 jk btn_urls work
// 

var appversion = "0.2_20060430_1300";

var myCfg;
var mc_images;
var image_names;
var dttm;
var appName;
var default_cfgfil;
var cfgfil;
var appSettings;
var appFlashvars;

function init ()
{
	this.mc_images = new Array();
	this.image_names = new Array();
	this.dttm = this.get_dttm();
	this.appname = this.get_appname();
	this.default_cfgfil = appname + ".xml";
	this.set_flashvars();
	this.setCfgFil();
	this.loadCfgXML();
}

function main()
{
//	trace( appname + " " + dttm + " main BEG:" );
//	trace("XML is loaded, load images based on appSettings.image1 (" + appSettings.image1 + "), etc..."); 
//	trace( "" );

	this.text.txt_header.text = appSettings.txthdr;
	this.txt_header.text = appSettings.txthdr;
//	trace( "BUGS txt_header=["+ this.txt_header.text +"] txthdr=["+ appSettings.txthdr +"]" );
	this.txt_message.text = appSettings.txtmsg;
//	this.txt_error.text = appSettings.txterr;

//	this.txt_message.text = this.txt_message.text + " this.cfgfil=[" + this.cfgfil + "]\n";
//	this.txt_message.text = this.txt_message.text + " appSettings.image1=[" + appSettings.image1 + "]\n";
//	this.txt_message.text = this.txt_message.text + " appFlashvars.image1=[" + appFlashvars.image1 + "]\n";
	load_images();
}

function loadCfgXML()
{
	this.myCfg = new XML();
	this.myCfg.ignoreWhite = true;
	this.myCfg.parent = this;
	this.myCfg.load(this.cfgfil);
	this.myCfg.onLoad = function (success:Boolean)
	{
		this.parent.processCfgXML(this);
	}
}

function processCfgXML (cfgXML)
{
	this.appSettings = new Object();
	var e = cfgXML.firstChild.childNodes[0];

	this.appSettings.bgcolor = e.attributes.bgcolor;
	this.appSettings.url_home = e.attributes.location;
	this.appSettings.url_contact = e.attributes.tag;
	this.appSettings.url_skip = e.childNodes[0].firstChild.nodeValue; 
	
	for(var i=0; i<=e.childNodes.length; i++)
	{
		this.appSettings[e.childNodes[i].attributes.id] = e.childNodes[i].firstChild.nodeValue;
	}
	
	this.main();
}

function setCfgFil()
{
	if(( this.cfgfil == undefined ) || ( this.cfgfil.length < 2 )) 
	{ 
		this.cfgfil = this.default_cfgfil; 
	}
}

function set_flashvars() {
//	trace("set_flashvars");
	this.appFlashvars = new Object();
	if(( bgcolor == undefined ) || ( bgcolor.length < 2 )) { this.appFlashvars.bgcolor = "" } 
	else { this.appFlashvars.bgcolor = trims( bgcolor ); }

	if(( url_home == undefined ) || ( url_home.length < 2 )) { this.appFlashvars.url_home = "" } 
	else { this.appFlashvars.url_home = trims( url_home ); }

	if(( url_contact == undefined ) || ( url_contact.length < 2 )) { this.appFlashvars.url_contact = "" } 
	else { this.appFlashvars.url_contact = trims( url_contact ); }

	if(( url_skip == undefined ) || ( url_skip.length < 2 )) { this.appFlashvars.url_skip = "" } 
	else { this.appFlashvars.url_skip = trims( url_skip ); }

	if(( txthdr == undefined ) || ( txthdr.length < 2 )) { this.appFlashvars.txthdr = "" } 
	else { this.appFlashvars.txthdr = trims( txthdr ); }
	if(( txtmsg == undefined ) || ( txtmsg.length < 2 )) { this.appFlashvars.txtmsg = "" } 
	else { this.appFlashvars.txtmsg = trims( txtmsg ); }
	if(( txterr == undefined ) || ( txterr.length < 2 )) { this.appFlashvars.txterr = "" } 
	else { this.appFlashvars.txterr = trims( txterr ); }

	for( j=1; j<10; j++ ) {
		fldval = eval( "image"+j );
		trims( fldval );
		if(( fldval != undefined ) && ( fldval.length > 2 )) { 
			image_names[j] = fldval;
			fldnam = "image"+j;
			this.appFlashvars.fldnam  = fldval;
			txtmsg = txtmsg + "\nBUGS_1 SET_FLASHVARS fldval=[" + j + "][" + fldval + "][" + image_names[j] + "]";
			} 
		else {
			image_names[j] = "" 
			fldnam = "image"+j;
			this.appFlashvars.fldnam = "";
//			txtmsg = txtmsg + "\nBUGS00 Set_FlashVars fldnam=[" + j + ":" + fldnam + ":" + this.image_names[j] + "]";
			}
//		txtmsg = txtmsg + "\nBUGS_2 SET_FLASHVARS fldval=[" + j + "][" + fldval + "][" + image_names[j] + "]";
		}


	for( j=1; j<10; j++ ) {
		fldval = eval( "image"+j );
//		txtmsg = txtmsg + "\nBUGS_3 SET_FLASHVARS fldval=[" + j + "][" + fldval + "][" + image_names[j] + "]";
		}

//	bugmsg( "bugs_flashvars" );
	}


// 
function load_images() 
{
	trends1._visible=false;
	trends2._visible=false;
	images_x._visible=true;
	images_y._visible=true;

//	image1.loadMovie( appSettings.image1 );
//	image7.loadMovie( appSettings.image7 );
	
//	txt_error.text = "w=[ "+image1._width+"] h=[ "+image1._height+" ]";


//	gotoAndStop(1);  
//	gotoAndStop(Math.ceil (_root._xmouse));  // Expected a field name after '.' operator.
//	this.image.duplicateMovieClip( "image1", 1 );
//	this.attachMovie( "linkagenameused", "instancenamewanted", depth);
//	images_x.onClipEvent (enterFrame) {
//		gotoAndStop(Math.ceil (_root._xmouse));  // Expected a field name after '.' operator.
//		}
//	onClipEvent.images_y(images_y.enterFrame) {
//		gotoAndStop(Math.ceil (_root._ymouse) - 50 ); // Clip events are permitted only for movie clip instances 
//		}
}




function get_appname() {
	my_str_encoded= this._url;
	my_str=findAndReplace( my_str_encoded, "%5F", "_" );
	my_args = my_str.split( "?" );
	my_str=my_args[0];
	my_args = my_str.split( "/" );
	my_swfnam = my_args[ my_args.length - 1 ];
	my_args = my_swfnam.split( "." );
	my_appname = my_args[ my_args.length - 2 ];
	return( my_appname );
	}

function get_dttm() 
{
	mydate = new Date();
	yyyy = mydate.getFullYear();
	mm = mydate.getMonth() + 1;
	dd = mydate.getDate();

	hh = mydate.getHours();
	mn = mydate.getMinutes();
	ss = mydate.getSeconds();

	if( mm < 10 ) { mm = "0" + mm; }
	if( dd < 10 ) { dd = "0" + dd; }
	if( hh < 10 ) { hh = "0" + hh; }
	if( mn < 10 ) { mn = "0" + mn; }
	if( ss < 10 ) { ss = "0" + ss; }

	yyyymmdd = yyyy + "" + mm + "" + dd;
	hhmnss = hh + "" + mn + "" + ss;

	dttm = yyyymmdd + "_" + hhmnss;
	return( dttm );
}

/* ================================================================================================== */
	
function var_status( input ) 
{
	if( input.length > 0 ) { return( "SET" ); }
	else {
		if( input == undefined ) { return( "UNDEFINED" ); }
		else { return( "BLANK" );			
		}
	}
}

/* ================================================================================================== */

function trims ( txt_str1 ) 
{
	trim( txt_str1 );
	txt_str2 = trimNewline( txt_str1 );
	return txt_str2;
}

/* ================================================================================================== */

function trim (txt_str) 
{
	while (txt_str.charAt(0) == " ") {
		txt_str = txt_str.substring(1, txt_str.length);
		}
	while (txt_str.charAt(txt_str.length-1) == " ") {
		txt_str = txt_str.substring(0, txt_str.length-1);
		}
	return txt_str;
};

function trimNewline (text_str) 
{
	var temp_array = text_str.split(chr(13)+chr(10));
	var temp1_array = [];
	for (i=0; i < temp_array.length; i++) {
		if (trim(temp_array[i]) != "") {
			temp1_array.push(trim(temp_array[i]));
			}
		}
	var new_str = temp1_array.join(" ");
	return new_str;
};

/* ================================================================================================== */

function findAndReplace (input, stringToFind, stringToInsert) 
{
	var output = "";
	var len = stringToFind.length;
	if( len  == "" ) {
//		trace( "FINDANDREPLACE NOT_EXISTS input=["+input+"][" + string(len) + "]" );
		return( output );
		}
	if( len < 1 ) {
//		trace( "FINDANDREPLACE BLANK input=["+input+"][" + string(len) + "]" );
		return( output );
		}

	while (input.indexOf(stringToFind) != -1) 
	{
		currOffset = input.indexOf(stringToFind);
		output = output+input.substring(0, currOffset);
		output = output+stringToInsert;
		input = input.substr(currOffset+len, input.length);
		}
	output = output+input;
//	trace(output);
	return (output);
};


function myClipEvent( action ) {
//	if( action == "load" ) { myClipEvent_load(); }
	if( action == "enterFrame" ) { myClipEvent_enterframe(); }
	}

function myClipEvent_load() {
//	trace( "myClipEvent_load" );
	}

function myClipEvent_enterframe() {

	txterr = _level0.dttm +"\n";
	txterr = txterr +"[ "+ _level0._xmouse +" , "+ _level0._ymouse +" ]\n";
	txterr = txterr + _level0.appSettings.txterr;
	txt_error.text = txterr;

//	for( imgnum=1; imgnum<10; imgnum++ ) {
//		anim( imgnum );
//		}
	}

function anim( imgnum ) {
//	_level0.txt_error.text = "anim imgnum=[ "+ imgnum +" ]";
//	trace( "BUGS21 anim imgnum=[ "+ imgnum +" ]" );

	if( imgnum < 7 ) {
		anim_x( imgnum );
		}
	else {
		anim_y( imgnum );
		}
	}

function anim_x( imgnum ) {
	if( imgnum == 1 ) { anim_x1( imgnum ); }
	}

function anim_y( imgnum ) {
	if( imgnum == 7 ) { anim_y7( imgnum ); }
	}

function anim_x1( imgnum ) {
//	trace( "BUGS_X1 anim_x1 imgnum=[ "+ imgnum +" ]" );
	txt_error.text = "anim_x1 imgnum=[ "+ imgnum +" ]";

	_level0.txt_message.text= "mouse=[ "+_xmouse+" , "+_ymouse+" ] wh=[ "+_level0._width+" , "+_level0._height+" ]";
	s_xmin=177; s_xmax=870; s_ymin=177; s_ymax=182;
	iwidth=175; iheight=175;

	dx = .75; dy = .5;
	idx = 10; idy = 10;
	bdx = 75; bdy = 120;
	mdx = 50; mdy = -10;

	ix = s_xmax - ( _xmouse - ( _level0.image1._height / 2 ) * dx ) - idx;
	iy = 100;
	mx = _xmouse - ( _level0.image1._height / 2 ) + 50;
	my = 200 + mdy;
	bx = ix + bdx;
	by = iy + bdy;

	_level0.image1._x = ix;
	_level0.image1._y = iy;

	_level0.border1._width = iwidth + 5;
	_level0.border1._height = iheight + 140;
	_level0.border1._x = bx;
	_level0.border1._y = by;

	_level0.mask1._x = mx; 
	_level0.mask1._y = my;
	_level0.mask1._width = iwidth;
	_level0.mask1._height = iheight;

	_level0.image1.setMask( _level0.mask1 );

	_level0.txt_error.text = "iw=[ "+_level0.image1._width + " ] ih=[ " + _level0.image1._height +" ]";
	}


function anim_y7( imgnum ) {
//	trace( "BUGS_X1 anim_x1 imgnum=[ "+ imgnum +" ]" );
	txt_error.text = "anim_x1 imgnum=[ "+ imgnum +" ]";

	_level0.txt_message.text= "mouse=[ "+_xmouse+" , "+_ymouse+" ] wh=[ "+_level0._width+" , "+_level0._height+" ]";
	s_xmin=177; s_xmax=870; s_ymin=177; s_ymax=182;
//	iwidth = _level0_.width; iheight = _level0_.height;
	iwidth=700; iheight=175;

	dx = .75; dy = .5;
	idx = 10; idy = 10;
	bdx = 340; bdy = 85; bdh = 2; bdw = 2;
	mdx = 130; mdy = -10;

	iy = s_ymax - ( _ymouse - ( _level0.image7._height / 2 ) * dy ) - idy;
	ix = 5;
	my = _ymouse - ( _level0.image7._height / 2 ) + 50;
	mx = 200 + mdx;
	by = iy + bdy;
	bx = ix + bdx;

	_level0.image7._x = ix;
	_level0.image7._y = iy;

	_level0.border7._width = iwidth + bdw;
	_level0.border7._height = iheight + bdh;
	_level0.border7._x = bx;
	_level0.border7._y = by;

	_level0.mask7._x = mx; 
	_level0.mask7._y = my;
	_level0.mask7._width = iwidth;
	_level0.mask7._height = iheight;

	_level0.image7.setMask( _level0.mask7 );

	_level0.txt_error.text = "iw=[ "+_level0.image7._width + " ] ih=[ " + _level0.image7._height +" ]";

	}

/* ================================================================================================== */

function preloader() 
{
	this.x=15;
	this.y=50	
	this.createTextField("preloader_txt", 0, this.x, this.y, 0, 0);
	this.preloader_txt.autoSize = true;
	this.preloader_txt.fontColor = 0x000000;

	bytes_loaded = Math.round(getBytesLoaded());
	bytes_total = Math.round(getBytesTotal());
	bytes_percent = bytes_loaded/bytes_total;
	this.preloader_txt.text = "Loading " + Math.round( bytes_percent * 100 ) + "%";


// Loading .................... 20%
	while( bytes_loaded < bytes_total ) {
		bytes_loaded = Math.round(getBytesLoaded());
		bytes_percent = bytes_loaded/bytes_total;
		dottxt="";
		for( j=0; j< Math.round( bytes_percent * 100 ); j++ ) {
			dottxt=dottxt+".";
			}
		this.preloader_txt.text = "Loading " + dottxt + Math.round( bytes_percent * 100 ) + "% ";
		}
	this.preloader_txt._visible=false;
	}


/* ================================================================================================== */

// GO
	this.preloader();
	this.init();


/* ================================================================================================== 
	Testing or unused code
 ================================================================================================== */

function komath() {
// sx0, sy0 = ( 177, 164 )	sx1, sy1 = ( 870, 311 )
// ax0, ay0 = ( 177, 177 )	ax1, ay1 = ( 870, 182 );
//        cXscale = this._xscale;
//        cYscale = this._yscale;
//        difXscale = cXscale-_root.targXscale;
//        difYscale = cYscale-_root.targYscale;
//        setProperty(this, _xscale, cXscale-(difXscale/5));
//        setProperty(this, _yscale, cYscale-(difYscale/5));
	}

function bugmsg( bugid ) {
	dttm = get_dttm();
	trace_label = appname + " " + dttm + " MSG " + bugid + ": ";
	txt_error.text = txt_error.txt + "/n" + trace_label + "/n";

//	for( j=1; j<10; j++ ) {
//		fldval = eval( "image"+j );
//		txtmsg = txtmsg + "\nBUGS_4 " + trace_label + " fldval=[" + j + "][" + fldval + "][" + image_names[j] + "]";
//		}
}

/*
this.myCfg.onLoad = function(success) 
{
	if(success)
	{ 
		trace("this.myCfg.onLoad("+success+")");
		if(( this.bgcolor != undefined ) && ( this.bgcolor.length > 2 )) 
		{
			if ( app_bgcolor == "" ) { app_bgcolor = trims( this.bgcolor ); }
		}
		trace("OK this.myCfg.onLoad("+success+")");
	} 
	else 
	{
		trace("FAIL this.myCfg.onLoad("+success+")");
	} 
}
*/

//


koh5_pano



Your browser does not support the HTML5 canvas element.


Drag mouse to navigate.

Navigation





17.Aug.2010, Martin Wengenmayer