Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 01-01-2004, 18:25   #1 (permalink)
Addicted to Flas
 
Benutzerbild von eliias
 
Registriert seit: Sep 2002
Ort: Salzburg/Austria
Beiträge: 335
prototypen ähnlich alt- tag

kennt jemand einen prototypen der dem alt- tag von html ähnelt, oder muss ich mir das selber schreiben .

wäre recht nützlich, find ich zumindest. in der suche konnte ich leider nix finden, aber vielleicht weiß jemand von euch was.

thx eliias
__________________
Blog
Ace of Mace
eliias ist offline   Mit Zitat antworten
Alt 02-01-2004, 00:48   #2 (permalink)
Steffen G.
 
Benutzerbild von Tschdaeff
 
Registriert seit: Aug 2001
Ort: Ba-Wü
Beiträge: 4.123
ActionScript:
  1. //buttonBefehl
  2.  
  3. on (rollOver) {
  4.     _root.attachMovie ("mc","mc",100)
  5.     _root.mc._alpha = 0
  6.     _root.mc.onEnterFrame = function () {
  7.         this.fadein ("beschriftung")
  8.     }
  9. }
  10. on (rollOut) {
  11.     _root.mc.onEnterFrame = function () {
  12.         this.fadeout ()
  13.     }
  14. }
  15.  
  16.  
  17. // Prototypen
  18.  
  19. movieclip.prototype.fadein = function (str) {
  20.     this._x = _root._xmouse
  21.     this._y = _root._ymouse
  22.     if (this._alpha < 100) {
  23.         this._alpha += 10
  24.     }
  25.     this.output.text = str
  26. }
  27. movieclip.prototype.fadeout = function () {
  28.     if (this._alpha > 0) {
  29.         this._alpha -= 10
  30.     }
  31.     if (this._alpha < 10) {
  32.         delete this.onEnterFrame;
  33.         this.removeMovieClip ()
  34.     }
  35. }

sowas hab ich mal gemacht... vllt hilfts

cu mfg
Tschdaeff
Angehängte Dateien
Dateityp: zip alttext.zip (20,0 KB, 31x aufgerufen)
__________________
mod@
www.flashbattle.de
www.steffen-guse.de
------------------------------------

Tschdaeff ist offline   Mit Zitat antworten
Alt 02-01-2004, 01:00   #3 (permalink)
mod_rewrite
 
Benutzerbild von sonar
 
Registriert seit: Feb 2003
Ort: München
Beiträge: 15.621
Wobei das ja keine ALT-Tag, wäre sondern eine Art Tooltip oder? Also quasi ein "title"-Attribut für ein <a>-Tag... Oder meintest du sowas eliias (Greez @ Austria! )
__________________
RTFM
Wie man Fragen richtig stellt.

Achim Bindannmalweg

Money makes the world go round, fear makes it turn much faster.
(New Model Army)
sonar ist offline   Mit Zitat antworten
Alt 02-01-2004, 01:02   #4 (permalink)
Steffen G.
 
Benutzerbild von Tschdaeff
 
Registriert seit: Aug 2001
Ort: Ba-Wü
Beiträge: 4.123
hmm stimmt... hab ich net drüber nachgedacht... naja funzt ja auch auf mcs von dem her

cu mfg
Tschdaeff
__________________
mod@
www.flashbattle.de
www.steffen-guse.de
------------------------------------

Tschdaeff ist offline   Mit Zitat antworten
Alt 02-01-2004, 13:07   #5 (permalink)
Addicted to Flas
 
Benutzerbild von eliias
 
Registriert seit: Sep 2002
Ort: Salzburg/Austria
Beiträge: 335
naja..meinte so das pendant zum ie alt - tag, falls jemand ie benutzt , grüsse zurück

naja.. dann bastel ich mal einen eigenen prototypen... werd ihn mal posten wenn er fertig wird nächstes Jahr oder so, aja das haben wir ja schon ...

trotzdem danke @ Tschdaeff
(die fadeIn prototypes tauchen einfach immer wieder auf )

mfg eliias
__________________
Blog
Ace of Mace
eliias ist offline   Mit Zitat antworten
Alt 02-01-2004, 14:04   #6 (permalink)
mod_rewrite
 
Benutzerbild von sonar
 
Registriert seit: Feb 2003
Ort: München
Beiträge: 15.621
Zitat:
Geschrieben von eliias
naja..meinte so das pendant zum ie alt - tag, falls jemand ie benutzt ,
(die fadeIn prototypes tauchen einfach immer wieder auf )
Also, "alt" is doch eigentlich ein Attribut innerhalb eines <IMG>-Tags, welches einen Alternativtext bereit hält, wenn das Bild nich angezeigt werden kann... kann mir da jetzt gar keine Flash-Umsetzung vorstellen...

...und von mir gibts eine viiieeel schönere MC-Prototyp-Fade-Methode
__________________
RTFM
Wie man Fragen richtig stellt.

Achim Bindannmalweg

Money makes the world go round, fear makes it turn much faster.
(New Model Army)
sonar ist offline   Mit Zitat antworten
Alt 02-01-2004, 16:55   #7 (permalink)
Addicted to Flas
 
Benutzerbild von eliias
 
Registriert seit: Sep 2002
Ort: Salzburg/Austria
Beiträge: 335
*g*

naja ich zeig mal wie ich mir das vorstelle, also deshalb meinte ich
ja IE - Alt tag, weil der eben ein schönes gelbes rechteck mit dem alternativtext anzeigt und sowas fände ich ab und an schon praktisch, so als getter/setter für jeden mc, naja nur so idee

mfg eliias

Ps.: mal guggen was morgen kommt
__________________
Blog
Ace of Mace
eliias ist offline   Mit Zitat antworten
Alt 02-01-2004, 16:59   #8 (permalink)
mod_rewrite
 
Benutzerbild von sonar
 
Registriert seit: Feb 2003
Ort: München
Beiträge: 15.621
[schlaubi]
dasistaberkeinalttag! Das ist genau das von mir erwähnte title-Attribut in einem <a>-tag.
[/schlaubi]
Und das was tschdaeff gepostet hat sollte doch sowas in der Art sein oder?
__________________
RTFM
Wie man Fragen richtig stellt.

Achim Bindannmalweg

Money makes the world go round, fear makes it turn much faster.
(New Model Army)
sonar ist offline   Mit Zitat antworten
Alt 02-01-2004, 17:02   #9 (permalink)
Addicted to Flas
 
Benutzerbild von eliias
 
Registriert seit: Sep 2002
Ort: Salzburg/Austria
Beiträge: 335
ich glaube ich sollte mir irgendwann doch einmal auch mehr als embed und object in html anguggen

mfg eliias

aber trotzdem, ich bleib dabei, da muss noch was her
__________________
Blog
Ace of Mace
eliias ist offline   Mit Zitat antworten
Alt 02-01-2004, 17:17   #10 (permalink)
mod_rewrite
 
Benutzerbild von sonar
 
Registriert seit: Feb 2003
Ort: München
Beiträge: 15.621
ich häng dir mal was an, vielleicht kannst des brauchen...

Tom
*austriafreund*
Angehängte Dateien
Dateityp: zip tooltip.fla.zip (3,2 KB, 21x aufgerufen)
__________________
RTFM
Wie man Fragen richtig stellt.

Achim Bindannmalweg

Money makes the world go round, fear makes it turn much faster.
(New Model Army)
sonar ist offline   Mit Zitat antworten
Alt 02-01-2004, 17:55   #11 (permalink)
Addicted to Flas
 
Benutzerbild von eliias
 
Registriert seit: Sep 2002
Ort: Salzburg/Austria
Beiträge: 335
danke für die .fla

sitze jetzt aber an einem prototypen

werd ihn morgen posten
muss jetzt wech

mfg eliias

aja schönes WE (wer eins hat)
__________________
Blog
Ace of Mace
eliias ist offline   Mit Zitat antworten
Alt 03-01-2004, 07:50   #12 (permalink)
Addicted to Flas
 
Benutzerbild von eliias
 
Registriert seit: Sep 2002
Ort: Salzburg/Austria
Beiträge: 335
prototype

Sodale, mal eine 1. Version des Teils

kleiner edit: versteht jetzt auch html - formatierungen (z.B. mehrzeilig)

ActionScript:
  1. //prototype
  2. var o=MovieClip.prototype;
  3. o.setTitle=function(param) {
  4.     this.titleString=param;
  5.     this.createEmptyMovieClip("container",1048575-1);
  6.     var i=this.container;
  7.     i.createTextField("textForm",2,0,0,0,0);
  8.     var t=i.textForm;
  9.     t.autoSize="left";
  10.     t.html=1;
  11.     t.multiline=1;
  12.     t.selectable=0;
  13.     t.htmlText=param;
  14.     t.setTextFormat(this.titleTextFormat());
  15.     t._visible=0;
  16.     var width=t._width;
  17.     var height=t._height;
  18.     delete t;
  19.     i.createEmptyMovieClip("clipForm",1);
  20.     var c=i.clipForm;
  21.     c.lineStyle(0.25,0x000000,100);
  22.     c.beginFill(0xFDFBF2,100);
  23.     c.moveTo(0,0);
  24.     c.lineTo(width,0);
  25.     c.lineTo(width,height);
  26.     c.lineTo(10,height);
  27.     c.lineTo(4,height+6);
  28.     c.lineTo(4,height);
  29.     c.lineTo(0,height);
  30.     c.endFill();
  31.     i._alpha=0;
  32.     delete c;
  33.     delete width;
  34.     delete height;
  35.     delete i;
  36. }
  37. o.getTitle=function() {
  38.     return this.titleString;
  39. }
  40. o.titleTextFormat=function() {
  41.     var f=new TextFormat();
  42.     f.size=10;
  43.     f.font="Verdana";
  44.     f.align="center";
  45.     f.color=0x000000;
  46.     return f;
  47.     delete f;
  48. }
  49. o.titleFadeIn=function(alphaMax) {
  50.     var r=this.container;
  51.     var alphaMax=alphaMax;
  52.     var speed=9;
  53.     var I=function() {
  54.         if(r._alpha<alphaMax) {
  55.             r._alpha+=speed;
  56.         } else {
  57.             r.textForm._visible=1;
  58.             clearInterval(I_ID);
  59.         }
  60.         updateAfterEvent();
  61.     }
  62.     var I_ID=setInterval(I,10);
  63.     delete r;
  64. }
  65. o.titleFadeOut=function(alphaMin) {
  66.     var r=this.container;
  67.     var alphaMin=alphaMin;
  68.     var speed=9;
  69.     r.textForm._visible=0;
  70.     var O=function() {
  71.         if(r._alpha>alphaMin) {
  72.             r._alpha-=speed;
  73.         } else {
  74.             clearInterval(O_ID);
  75.         }
  76.         updateAfterEvent();
  77.     }
  78.     var O_ID=setInterval(O,10);
  79.     delete r;
  80. }
  81. o.useTitle=function() {
  82.     this.container._x=this._xmouse-4;
  83.     this.container._y=this._ymouse-this.container.textForm._height-7;
  84.     this.titleFadeIn(100);
  85.     this.container.startDrag(0);
  86. }
  87. o.disableTitle=function() {
  88.     this.titleFadeOut(0);
  89.     this.container.stopDrag();
  90. }
  91. delete o;
  92. // aufruf (movieclip test muss auf der bühne sein)
  93. _root.test.setTitle("roter Abendhimmel");
  94. _root.test.onRollOver=function() {
  95.     this.useTitle();
  96. }
  97. _root.test.onRollOut=function() {
  98.     this.disableTitle();
  99. }

verbesserungsvorschläge, kritiken erwünscht

ein sehr unschönes verhalten tritt auf, wie ich gerade bemerkt habe, wenn der fadeIn - Vorgang den fadeOut - Vorgang behindert oder umgekehrt, ev. die Codezeilen des FadeIn bzw. FadeOut vorrübergehend durch folgende ersetzen.

Ich muss mir erst eine schönere Variante für den FadeIn und FadeOut einfallen lassen

ActionScript:
  1. o.titleFadeIn=function(alphaMax) {
  2.     this.container._alpha=100;
  3.     this.container.textForm._visible=1;
  4. }
  5. o.titleFadeOut=function(alphaMin) {
  6.     this.container._alpha=0;
  7.     this.container.textForm._visible=0;
  8. }

mfg eliias
__________________
Blog
Ace of Mace

Geändert von eliias (03-01-2004 um 08:28 Uhr)
eliias ist offline   Mit Zitat antworten
Alt 03-01-2004, 10:19   #13 (permalink)
Flash & TYPO3
 
Registriert seit: Oct 2003
Ort: Bayern
Beiträge: 2.700
Gibt's dazu eventuell auch ne .fla?
johanness ist offline   Mit Zitat antworten
Alt 03-01-2004, 11:39   #14 (permalink)
Steffen G.
 
Benutzerbild von Tschdaeff
 
Registriert seit: Aug 2001
Ort: Ba-Wü
Beiträge: 4.123
fla wäre echt interessant....


cu mfg
Tschdaeff
__________________
mod@
www.flashbattle.de
www.steffen-guse.de
------------------------------------

Tschdaeff ist offline   Mit Zitat antworten
Alt 03-01-2004, 12:01   #15 (permalink)
Addicted to Flas
 
Benutzerbild von eliias
 
Registriert seit: Sep 2002
Ort: Salzburg/Austria
Beiträge: 335
einen mom.... habs erst jetzt gesehen

sodale das ist der link zum ziparchiv
attachment hab ich auf die schnelle ned kapiert

title_prototype

viel spass damit, aja und falls jemand lust hat, verschönern, erweitern ist erwünscht

mfg eliias

Ps.: falls sich jemand gewundert haben sollte, warum das file nicht zu öffnen war, war in mx 2004 gespeichert, habs jetzt in mx abgespeichert.

mfg eliias
__________________
Blog
Ace of Mace

Geändert von eliias (03-01-2004 um 12:29 Uhr)
eliias ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 03:04 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele