<?php

require_once('minglib_swf.php');

$moviewidth = 300;
$movieheight = 450;

$red = 0xdb ;
$green = 0xe3 ;
$blue = 0xf8 ;

// some typical movie variables
Ming_setScale(20.00000000);
ming_useswfversion(6);
$movie=new SWFMovie();
$movie->setBackground(249,249,249);
$movie->setRate(15); 
$movie->setDimension($moviewidth,$movieheight);

// Load the font
$fontname="Bitstream Vera Sans-B.fdb";
$fontsize = 15 ;
$font = new SWFFont($fontname);

//--------------------------------------//
//			Start the Movie				//
//--------------------------------------//

set_color( 0x00, 0x33, 0x66 ) ;

$pic1 = fade_in_pic("golfmain.jpg", 30, 0, 0) ;

// Add first 2 lines of text

$spr1 = new SWFSprite();
$text1 = add_text( 320, 20, "What will you do today?", $spr1 );
move_text( $text1, -300, 0, 60, $spr1 ) ;
$sprite1 = $movie->add($spr1);

skip_frames(60);

// First text is across - replace with static text
$movie->remove($sprite1);
$text3 = add_text( 20, 20, "What will you do today?", $movie );

skip_frames(30);

// Now add a fading text effect.

$movie->remove($text3);
$spr1 = new SWFSprite();
$text1 = add_text( 20, 20, "What will you do today?", $spr1 );
fade_out( $text1, 60, $spr1 ) ;
$sprite1 = $movie->add($spr1);

skip_frames(30);

$text3 = add_text( 20, 40, "Play 18 holes of golf...", $movie );
fade_in( $text3, 30, $movie ) ;

$movie->remove($sprite1);
skip_frames(30);


$pic2 = fade_in_pic("ts1.jpg", 15) ;
fade_out_pic($pic1, 5);
$movie->remove($text3);

//
// End of Scene 1
//

$squareshape=new SWFShape(); 
$squareshape->setLine(1,0,0,0); 
$squareshape->setRightFill(249,249,249);
$squareshape->setRightFill(219,227,248);
$squareshape->movePenTo(-100,0); 
$squareshape->drawLine(200,0);  
$squareshape->drawLine(0,100); 
$squareshape->drawLine(-200,0); 
$squareshape->drawLine(0,-100); 

set_color(0x00, 0x66, 0xcc) ;

$h=130;
$spr1 = new SWFSprite();
$f1 = $spr1->add($squareshape);
$f1->moveTo(150,$h);
$text1 = add_text( 60, $h+20, "...or take control", $spr1 );
$spr1->nextFrame();

$sprite1 = $movie->add($spr1);
fade_in( $sprite1, 30, $movie ) ;

$text2 = add_text( 60, $h+45, "- Of your sales cycle", $movie );
fade_in( $text2, 12, $movie ) ;
$text3 = add_text( 60, $h+65, "- Of communications", $movie );
fade_in( $text3, 12, $movie ) ;
$text4 = add_text( 60, $h+85, "- Of your costs", $movie );
fade_in( $text4, 12, $movie ) ;

skip_frames(10);

$pic3 = fade_in_pic("pe.jpg", 5) ;
fade_out_pic($pic2, 10);
$pic4 = fade_in_pic("golfbase.jpg", 1, -50, 128, 0) ; // Add with alpha zero
//$pic4->multColor(1,1,1,0.5);

// renew centre block to bring to the top
$sprite1 = $movie->add($spr1);
$text2 = add_text( 60, $h+45, "- Of your sales cycle", $movie );
$text3 = add_text( 60, $h+65, "- Of communications", $movie );
$text4 = add_text( 60, $h+85, "- Of your costs", $movie );

fade_in( $pic4, 5, $movie, 0.5 ) ;


skip_frames(10);

$l=30;
set_color( 0xff, 0x99, 0x00 ) ;
$text5 = add_text( $l, $h+120, "(And still have time for an", $movie );
$text6 = add_text( $l, $h+140, " afternoon's golf!) ", $movie );
set_color( 0x00, 0x33, 0x66 ) ;
fade_in( $text5, 12, $movie ) ;

skip_frames(10);

// Add first 2 lines of text
$h=310;
set_color(0x00, 0x66, 0xcc) ;

$spr6 = new SWFSprite();
$text6 = add_text( $l, $h+150, "Team Server Edition", $spr6 );
move_text( $text6, 0, -150, 30, $spr6 ) ;
$sprite6 = $movie->add($spr6);

skip_frames(10);

set_fontsize(12);
$spr7 = new SWFSprite();
$text7 = add_text( $l+10, $h+170, " Features >>", $spr7 );
move_text( $text7, 0, -150, 30, $spr7 ) ;
$sprite7 = $movie->add($spr7);

skip_frames(5);

$spr8 = new SWFSprite();
$text8 = add_text( $l+10, $h+190, " Download >>", $spr8 );
move_text( $text8, 0, -150, 30, $spr8 ) ;
$sprite8 = $movie->add($spr8);

skip_frames(5);

$spr9 = new SWFSprite();
$text9 = add_text( $l+10, $h+210, " Upgrade >>", $spr9 );
move_text( $text9, 0, -150, 30, $spr9 ) ;
$sprite9 = $movie->add($spr9);

skip_frames(10);

// First text is across - replace with static text
set_fontsize();
$movie->remove($sprite6);
$text6 = add_text( $l, $h, "Team Server Edition", $movie );

skip_frames(10);

// Second text is across - replace with static text

$box=new SWFShape(); 
$box->setRightFill(249,249,249);
$box->movePenTo(0,0); 
$box->drawLine(150,0);  
$box->drawLine(0,16); 
$box->drawLine(-150,0); 
$box->drawLine(0,-16); 

set_fontsize(12);
$movie->remove($sprite7);
$b=new SWFButton();
$b->addShape($box, SWFBUTTON_UP | SWFBUTTON_OVER | SWFBUTTON_DOWN | SWFBUTTON_HIT);
$b->setAction(new SWFAction("getURL('features_teamserver.php','_self');"));
$i=$movie->add($b);
$textb = add_text( $l+10, $h+20, " Features >>", $movie );
$i->moveTo($l+10,$h+8);
$i->multColor(1,1,1,0);

skip_frames(5);

$movie->remove($sprite8);
$b=new SWFButton();
$b->addShape($box, SWFBUTTON_UP | SWFBUTTON_OVER | SWFBUTTON_DOWN | SWFBUTTON_HIT);
$b->setAction(new SWFAction("getURL('download.php','_self');"));
$i=$movie->add($b);
$textb = add_text( $l+10, $h+40, " Download >>", $movie );
$i->moveTo($l+10,$h+28);
$i->multColor(1,1,1,0);


skip_frames(5);

$movie->remove($sprite9);
$b=new SWFButton();
$b->addShape($box, SWFBUTTON_UP | SWFBUTTON_OVER | SWFBUTTON_DOWN | SWFBUTTON_HIT);
$b->setAction(new SWFAction("getURL('upgrade.php','_self');"));
$i=$movie->add($b);
$textb = add_text( $l+10, $h+60, " Upgrade >>", $movie );
$i->moveTo($l+10,$h+48);
$i->multColor(1,1,1,0);





//--------------------------------------//
//			End the Movie				//
//--------------------------------------//

$strAction = " _root.stop(); ";
$movie->add(new SWFAction($strAction));
$movie->nextFrame();

// save the movie
if (is_file("/var/www/html/Users/TestSite/MING SWF/golf.swf"))
	unlink("/var/www/html/Users/TestSite/MING SWF/golf.swf");

$movie->save("/var/www/html/Users/TestSite/MING SWF/golf.swf", 9);

?>