🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.pl.programy.flash-5
1 messages
1 total messages Started by AL Fri, 20 Jul 2007 15:50
problem z funkcja wywolywana wielokrotnie
#34308
Author: AL
Date: Fri, 20 Jul 2007 15:50
88 lines
3459 bytes
Witam ponownie :)

Wyskrobalem sobie taka mala funkcje, ktora tworzy dynamiczny "dymek"
do MovieClipa.
Wszystko pieknie dziala, tylko jesli chce tej funkcji uzyc do wiecej
niz jednego MC, to skrypt siada. Czy ktos ma pomysl jak to poprawic?

http://www.lenart.pl/flash/hoverClouds.swf

i skrypt (wymaga zalaczonego fontu o  nazwie "fontLight"):

// hover targets
this.createEmptyMovieClip("mcSquare", 0);
with (mcSquare) {
	beginFill(0xFF0000, 100);
	moveTo(100, 100);
	lineTo(200, 100);
	lineTo(200, 200);
	lineTo(100, 200);
	lineTo(100, 100);
	endFill();
};
this.createEmptyMovieClip("mcTriangle", 1);
with (mcTriangle) {
	beginFill(0x00FF00, 100);
	moveTo(250, 250);
	lineTo(350, 350);
	lineTo(150, 350);
	lineTo(250, 250);
	endFill();
};

// call clouds
hoverCloud(mcSquare, "This is square", 40, 40, 0xEEEEEE, 60, 3); //
movieclip, text, x, y, color, alpha, speed
//hoverCloud(mcTriangle, "Triangle", 340, 540, 0xEEEEEE, 60,
5); // !!! sprobuj wywolac funkcje drugi raz

// functions
function hoverCloud(hTarget:MovieClip, hText:String, hXpos:Number,
hYpos:Number, hColor, hAlpha:Number, hSpeed:Number) {
	this.createEmptyMovieClip("mcHoverCloud",
this.getNextHighestDepth());
	mcHoverCloud.createTextField("hoverText", this.getNextHighestDepth(),
1, -44, 120, 20);
	with (mcHoverCloud.hoverText) {
		html = true;
		embedFonts = true;
		autoSize = true;
		multiline = false;
		wordWrap = false;
		selectable = false;
		text = hText;
	};
	var hoverFormat:TextFormat = new TextFormat();
	hoverFormat.font = "fontLight";
	hoverFormat.size = 18;
	hoverFormat.letterSpacing = 1.2;
	mcHoverCloud.hoverText.setTextFormat(hoverFormat);
	fLen = mcHoverCloud.hoverText._width + 10;
	with (mcHoverCloud) {
		beginFill(hColor, hAlpha);
		moveTo(0, 0);
		lineTo(15, -15);
		lineTo(fLen, -15);
		lineTo(fLen, -51);
		lineTo(-10, -51);
		lineTo(-10, -15);
		lineTo(0, -15)
		lineTo(0, 0);
		endFill();
		_x = hXpos;
		_y = hYpos;
	};
	mcHoverCloud._alpha=0;
	hTarget.onRollOver = function() {
		this.onEnterFrame = function () {
			mcHoverCloud._alpha += (100-mcHoverCloud._alpha)/hSpeed;
			mcHoverCloud._x -= (mcHoverCloud._x-_xmouse)/hSpeed;
			mcHoverCloud._y -= (mcHoverCloud._y-_ymouse)/hSpeed;
		};
	};
	hTarget.onRollOut = function() {
		this.onEnterFrame = function() {
			mcHoverCloud._alpha += (0-mcHoverCloud._alpha)/hSpeed;
		};
	};
};
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads