Return to Snippet

Revision: 15900
at July 20, 2009 22:22 by njhamann


Initial Code
var cur:Number;
var played:Boolean = false;

for (x = 1; x <= 3; x++)
{
	eval ("clip_" + x + "_mc.hit").onRelease = play_clip;
}

function play_clip ()
{
	cur = this._parent._name.charAt (5);
	played = true;

	for (x = 1; x <= 3; x++)
	{
		if (x != cur)
		{
			eval ("clip_" + x + "_mc")._alpha = 0;
			eval ("clip_" + x + "_mc.hit").enabled = false;
		}
	}
	//this.enabled = false;
	this._parent.play ();
	if (cur == 1){
		pic_frames.scaleTo(233, .5, 'linear');
		pic_frames.xSlideTo(124, .5, 'linear');
		pic_frames.ySlideTo(-26.8, .5, 'linear');
		pic_frames.frame_2.alphaTo(20, .5);
		pic_frames.frame_3.alphaTo(20, .5);

	}else if(cur == 2){
		pic_frames.scaleTo(233, .5, 'linear');
		pic_frames.xSlideTo(-500, .5, 'linear');
		pic_frames.ySlideTo(-117, .5, 'linear');
			pic_frames.frame_1.alphaTo(20, .5);
		pic_frames.frame_3.alphaTo(20, .5);
	}else{
		pic_frames.scaleTo(233, .5, 'linear');
		pic_frames.xSlideTo(-1119, .5, 'linear');
		pic_frames.ySlideTo(-26.8, .5, 'linear');
				pic_frames.frame_2.alphaTo(20, .5);
		pic_frames.frame_1.alphaTo(20, .5);
	}
	
	if(played && this._parent._parent._parent.instruction_mc._alpha != 0)
	{
		this._parent._parent._parent.instruction_mc.alphaTo(0, .5);
	}
	else
	{
		//do nothing;
	}
}

function reset ()
{
			pic_frames.scaleTo(100, .5, 'linear');
		pic_frames.xSlideTo(-12.1, .5, 'linear');
		pic_frames.ySlideTo(24.4, .5, 'linear');
				pic_frames.frame_1.alphaTo(100, .5);
		pic_frames.frame_2.alphaTo(100, .5);
				pic_frames.frame_3.alphaTo(100, .5);
	for (x = 1; x <= 3; x++)
	{
		eval ("clip_" + x + "_mc").gotoAndStop (1);
		eval ("clip_" + x + "_mc")._alpha = 100;
		eval ("clip_" + x + "_mc.hit").enabled = true;
	}
}
clip_1_mc.input_animation.enter_btn.onRelease = function() {
trace(clip_1_mc.input_animation.input_txt.text);
};

Initial URL

                                

Initial Description

                                

Initial Title
Button Loop actionscript 2.0

Initial Tags
actionscript, flash

Initial Language
ActionScript