Section 1
//DiamondMaster_1 (flaaaaaaaaaaaaandre_fla.DiamondMaster_1)
package flaaaaaaaaaaaaandre_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.text.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class DiamondMaster_1 extends MovieClip {
public const SCREEN_WIDTH:Number = 720;
public const SPACING_BETWEEN_DIAMONDS:Number = 28;
public const MAXIMUM_ON_SCREEN;
public const TYPE_VARIATION_MODIFIER:Number = 1.25;
public const TYPES_COUNT = 7;
public var SPAWN_POSITION:Number;
public var TARGET_SPEED:Number;
public var FRAMES_TARGET:Number;
public var frame_count:Number;
public var usage:Array;
public var i;
public var previous_type:Number;
public function DiamondMaster_1(){
MAXIMUM_ON_SCREEN = Math.ceil((SCREEN_WIDTH / SPACING_BETWEEN_DIAMONDS));
super();
addFrameScript(0, frame1);
}
public function Reverse(){
var _local2:*;
var _local1:* = 0;
while (_local1 < this.numChildren) {
_local2 = (this.getChildAt(_local1) as Diamond).move_speed;
(this.getChildAt(_local1) as Diamond).move_speed = -(_local2);
_local1++;
};
frame_count = (FRAMES_TARGET - frame_count);
TARGET_SPEED = -(TARGET_SPEED);
if (SPAWN_POSITION < 0){
SPAWN_POSITION = 0;
} else {
SPAWN_POSITION = (-(SPACING_BETWEEN_DIAMONDS) * (MAXIMUM_ON_SCREEN + 1));
};
}
public function StartMoving(_arg1:Number){
var _local2:* = 0;
while (_local2 < this.numChildren) {
(this.getChildAt(_local2) as Diamond).move_speed = _arg1;
_local2++;
};
}
public function AddLoadingDiamond(_arg1:Number){
var _local2:Number;
while ((this.numChildren / MAXIMUM_ON_SCREEN) <= _arg1) {
_local2 = (-(SPACING_BETWEEN_DIAMONDS) * (MAXIMUM_ON_SCREEN - this.numChildren));
SpawnDiamond(SelectDiamondType(), 0, _local2);
};
}
public function DiamondFrameEventHandler(){
if (frame_count++ < FRAMES_TARGET){
return;
};
frame_count = 0;
SpawnDiamond(SelectDiamondType(), -(TARGET_SPEED), SPAWN_POSITION);
}
public function SpawnDiamond(_arg1:Number, _arg2:Number, _arg3:Number=0){
var _local4:Diamond;
switch (_arg1){
case 0:
_local4 = new DiamondBlue();
break;
case 1:
_local4 = new DiamondCyan();
break;
case 2:
_local4 = new DiamondGreen();
break;
case 3:
_local4 = new DiamondOrange();
break;
case 4:
_local4 = new DiamondPurple();
break;
case 5:
_local4 = new DiamondRed();
break;
case 6:
_local4 = new DiamondYellow();
break;
};
_local4.move_speed = _arg2;
_local4.x = _arg3;
this.addChild(_local4);
}
public function SelectDiamondType(){
var _local2:Number;
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local1:Number = 0;
for (_local3 in usage) {
_local1 = (_local1 + usage[_local3]);
};
do {
_local4 = Math.random();
_local5 = 0;
_local3 = 0;
while (_local3 < usage.length) {
_local5 = (_local5 + (usage[_local3] / _local1));
if (_local5 > _local4){
_local2 = _local3;
break;
};
_local3++;
};
} while (_local2 == previous_type);
_local3 = 0;
while (_local3 < usage.length) {
if (_local3 == _local2){
usage[_local3] = (usage[_local3] / (TYPE_VARIATION_MODIFIER + 1));
} else {
usage[_local3] = (usage[_local3] * ((TYPE_VARIATION_MODIFIER / TYPES_COUNT) + 1));
};
_local3++;
};
previous_type = _local2;
return (_local2);
}
function frame1(){
SPAWN_POSITION = 0;
TARGET_SPEED = 2;
FRAMES_TARGET = (SPACING_BETWEEN_DIAMONDS / TARGET_SPEED);
frame_count = 0;
usage = new Array(TYPES_COUNT);
i = 0;
while (i < usage.length) {
usage[i] = 1;
i++;
};
previous_type = -1;
}
}
}//package flaaaaaaaaaaaaandre_fla
Section 2
//SoundMaster_4 (flaaaaaaaaaaaaandre_fla.SoundMaster_4)
package flaaaaaaaaaaaaandre_fla {
import flash.display.*;
public dynamic class SoundMaster_4 extends MovieClip {
public function SoundMaster_4(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame8(){
stop();
}
function frame9(){
stop();
}
}
}//package flaaaaaaaaaaaaandre_fla
Section 3
//Diamond (Diamond)
package {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.ui.*;
public class Diamond extends MovieClip {
public const delete_upper_threshold = 0;
public const delete_lower_threshold = -758;
public var butt7:SimpleButton;
public var butt8:SimpleButton;
public var blackscreen_i:MovieClip;
public var eyes_i:MovieClip;
public var diamondmaster_i:MovieClip;
public var butt1:SimpleButton;
public var butt2:SimpleButton;
public var soundmaster_i:MovieClip;
public var butt3:SimpleButton;
public var butt4:SimpleButton;
public var butt5:SimpleButton;
public var butt6:SimpleButton;
public var cMenu:ContextMenu;
public var move_speed:Number;
static var g_played_first_frame:Boolean = false;
static var selectedSong:Number = 1;
public function Diamond(){
addFrameScript(0, frame1, 1, frame2);
this.addEventListener(Event.ENTER_FRAME, HandleFrameEvent);
}
public function LoadingHandler(_arg1:Event):void{
var _local2:Number = (this.stage.loaderInfo.bytesLoaded / this.stage.loaderInfo.bytesTotal);
blackscreen_i.alpha = Math.min((1 - (_local2 * _local2)), 0.9);
diamondmaster_i.AddLoadingDiamond(_local2);
if (_local2 >= 1){
this.removeEventListener(Event.ENTER_FRAME, LoadingHandler);
gotoAndPlay(2);
};
}
public function GlobalFrameHandler(_arg1:Event){
diamondmaster_i.DiamondFrameEventHandler();
}
public function butt1Click(_arg1:MouseEvent){
if (Diamond.selectedSong == 1){
return;
};
Diamond.selectedSong = 1;
SoundMixer.stopAll();
soundmaster_i.gotoAndPlay(2);
butt1.alpha = 1;
butt2.alpha = 0.5;
butt3.alpha = 0.5;
butt4.alpha = 0.5;
butt5.alpha = 0.5;
butt6.alpha = 0.5;
butt7.alpha = 0.5;
butt8.alpha = 0.5;
diamondmaster_i.Reverse();
}
public function butt2Click(_arg1:MouseEvent){
if (Diamond.selectedSong == 2){
return;
};
Diamond.selectedSong = 2;
SoundMixer.stopAll();
soundmaster_i.gotoAndPlay(3);
butt1.alpha = 0.5;
butt2.alpha = 1;
butt3.alpha = 0.5;
butt4.alpha = 0.5;
butt5.alpha = 0.5;
butt6.alpha = 0.5;
butt7.alpha = 0.5;
butt8.alpha = 0.5;
diamondmaster_i.Reverse();
}
public function butt3Click(_arg1:MouseEvent){
if (Diamond.selectedSong == 3){
return;
};
Diamond.selectedSong = 3;
SoundMixer.stopAll();
soundmaster_i.gotoAndPlay(4);
butt1.alpha = 0.5;
butt2.alpha = 0.5;
butt3.alpha = 1;
butt4.alpha = 0.5;
butt5.alpha = 0.5;
butt6.alpha = 0.5;
butt7.alpha = 0.5;
butt8.alpha = 0.5;
diamondmaster_i.Reverse();
}
public function butt4Click(_arg1:MouseEvent){
if (Diamond.selectedSong == 4){
return;
};
Diamond.selectedSong = 4;
SoundMixer.stopAll();
soundmaster_i.gotoAndPlay(5);
butt1.alpha = 0.5;
butt2.alpha = 0.5;
butt3.alpha = 0.5;
butt4.alpha = 1;
butt5.alpha = 0.5;
butt6.alpha = 0.5;
butt7.alpha = 0.5;
butt8.alpha = 0.5;
diamondmaster_i.Reverse();
}
public function butt5Click(_arg1:MouseEvent){
if (Diamond.selectedSong == 5){
return;
};
Diamond.selectedSong = 5;
SoundMixer.stopAll();
soundmaster_i.gotoAndPlay(6);
butt1.alpha = 0.5;
butt2.alpha = 0.5;
butt3.alpha = 0.5;
butt4.alpha = 0.5;
butt5.alpha = 1;
butt6.alpha = 0.5;
butt7.alpha = 0.5;
butt8.alpha = 0.5;
diamondmaster_i.Reverse();
}
public function butt6Click(_arg1:MouseEvent){
if (Diamond.selectedSong == 6){
return;
};
Diamond.selectedSong = 6;
SoundMixer.stopAll();
soundmaster_i.gotoAndPlay(7);
butt1.alpha = 0.5;
butt2.alpha = 0.5;
butt3.alpha = 0.5;
butt4.alpha = 0.5;
butt5.alpha = 0.5;
butt6.alpha = 1;
butt7.alpha = 0.5;
butt8.alpha = 0.5;
diamondmaster_i.Reverse();
}
public function butt7Click(_arg1:MouseEvent){
if (Diamond.selectedSong == 7){
return;
};
Diamond.selectedSong = 7;
SoundMixer.stopAll();
soundmaster_i.gotoAndPlay(8);
butt1.alpha = 0.5;
butt2.alpha = 0.5;
butt3.alpha = 0.5;
butt4.alpha = 0.5;
butt5.alpha = 0.5;
butt6.alpha = 0.5;
butt7.alpha = 1;
butt8.alpha = 0.5;
diamondmaster_i.Reverse();
}
public function butt8Click(_arg1:MouseEvent){
if (Diamond.selectedSong == 8){
return;
};
Diamond.selectedSong = 8;
SoundMixer.stopAll();
soundmaster_i.gotoAndPlay(9);
butt1.alpha = 0.5;
butt2.alpha = 0.5;
butt3.alpha = 0.5;
butt4.alpha = 0.5;
butt5.alpha = 0.5;
butt6.alpha = 0.5;
butt7.alpha = 0.5;
butt8.alpha = 1;
diamondmaster_i.Reverse();
}
private function HandleFrameEvent(_arg1:Event){
this.x = (this.x + move_speed);
if ((((this.x > delete_upper_threshold)) || ((this.x < delete_lower_threshold)))){
this.removeEventListener(Event.ENTER_FRAME, HandleFrameEvent);
this.parent.removeChild(this);
};
}
function frame1(){
if (Diamond.g_played_first_frame){
return;
};
Diamond.g_played_first_frame = true;
stop();
cMenu = new ContextMenu();
cMenu.hideBuiltInItems();
contextMenu = cMenu;
this.addEventListener(Event.ENTER_FRAME, LoadingHandler);
}
function frame2(){
stop();
this.addEventListener(Event.ENTER_FRAME, GlobalFrameHandler);
diamondmaster_i.StartMoving(-(diamondmaster_i.TARGET_SPEED));
soundmaster_i.gotoAndPlay(2);
butt1.addEventListener(MouseEvent.CLICK, butt1Click);
butt2.addEventListener(MouseEvent.CLICK, butt2Click);
butt3.addEventListener(MouseEvent.CLICK, butt3Click);
butt4.addEventListener(MouseEvent.CLICK, butt4Click);
butt5.addEventListener(MouseEvent.CLICK, butt5Click);
butt6.addEventListener(MouseEvent.CLICK, butt6Click);
butt7.addEventListener(MouseEvent.CLICK, butt7Click);
butt8.addEventListener(MouseEvent.CLICK, butt8Click);
}
}
}//package
Section 4
//DiamondBlue (DiamondBlue)
package {
public class DiamondBlue extends Diamond {
}
}//package
Section 5
//DiamondCyan (DiamondCyan)
package {
public class DiamondCyan extends Diamond {
}
}//package
Section 6
//DiamondGreen (DiamondGreen)
package {
public class DiamondGreen extends Diamond {
}
}//package
Section 7
//DiamondOrange (DiamondOrange)
package {
public class DiamondOrange extends Diamond {
}
}//package
Section 8
//DiamondPurple (DiamondPurple)
package {
public class DiamondPurple extends Diamond {
}
}//package
Section 9
//DiamondRed (DiamondRed)
package {
public class DiamondRed extends Diamond {
}
}//package
Section 10
//DiamondYellow (DiamondYellow)
package {
public class DiamondYellow extends Diamond {
}
}//package
Section 11
//Song1 (Song1)
package {
import flash.media.*;
public dynamic class Song1 extends Sound {
}
}//package
Section 12
//Song2 (Song2)
package {
import flash.media.*;
public dynamic class Song2 extends Sound {
}
}//package