Article View: alt.pl.programy.flash-5
Article #34308problem z funkcja wywolywana wielokrotnie
From: AL
Date: Fri, 20 Jul 2007 15:50
Date: Fri, 20 Jul 2007 15:50
88 lines
3459 bytes
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;
};
};
};
Technical Details
Message-ID:
<1184946608.413003.260080@r34g2000hsd.googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news2.icm.edu.pl!newsfeed.atman.pl!news.nask.pl!news.nask.org.pl!newshub.sdsu.edu!postnews.google.com!r34g2000hsd.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news2.icm.edu.pl!newsfeed.atman.pl!news.nask.pl!news.nask.org.pl!newshub.sdsu.edu!postnews.google.com!r34g2000hsd.googlegroups.com!not-for-mail From: AL <lenartphoto@googlemail.com> Newsgroups: alt.pl.programy.flash-5 Subject: problem z funkcja wywolywana wielokrotnie Date: Fri, 20 Jul 2007 08:50:08 -0700 Organization: http://groups.google.com Lines: 89 Message-ID: <1184946608.413003.260080@r34g2000hsd.googlegroups.com> NNTP-Posting-Host: 212.23.23.87 Mime-Version: 1.0 X-Trace: posting.google.com 1184946608 11642 127.0.0.1 (20 Jul 2007 15:50:08 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 20 Jul 2007 15:50:08 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.22 (Windows NT 5.1; U; en),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: r34g2000hsd.googlegroups.com; posting-host=212.23.23.87; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit