Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 10-04-2006, 09:12   #1 (permalink)
Neuer User
 
Registriert seit: Mar 2006
Beiträge: 6
aktiver mc als button

mal funktioniert es, mal nicht:

habe dynamische mc als "button" realisiert (keine frames). wenn man auf mc1 klickt, soll dieser z.b. rot sein und auch bleiben. klickt man mc2 soll dieses ebenfalls passieren. klick ich allerdings auf einen weiteren mc3, dann soll mc1 nicht mehr aktiviert sein.
ich habe das alles mit transparenten alphawerten realisiert, da diese button auf einer karte (gif) plaziert werden.

hier nun mein script. mein problem ist, es funktioniert beim ersten durchlauf. deim zweiten testen spinnt er schon rum und danach geht gar nichts mehr richtig.

gruss, sandra

ortA = "";
ortAinst = "";
ortB = "";
ortBinst = "";

function registriere(ortInst)
{
// Ausgangssituation
if (ortAinst == "" and ortBinst == "")
{
ortAinst = ortInst;
this[ortAinst+"_text_mc"].ortsname_txt.textColor = 0xFF0000; //"ortsname_txt" ist instanzname von "Stadtname"
}
// Das erste Mal der zweite Ort
else if (ortAinst != "" and ortBinst == "")
{
ortBinst = ortInst;
this[ortBinst + "_text_mc"].ortsname_txt.textColor = 0xFF0000;
}
// Alle anderen Zustände
else
{
if( this[ortAinst+"_mc"]._alpha == 0 )
{
// den ersten "Link" wieder zurücksetzen
this[ortAinst+"_mc"]._alpha = 40;
}
else
{
// den ersten "Link" wieder zurücksetzen
this[ortAinst+"_mc"]._alpha = 0;
}

this[ortAinst + "_text_mc"].ortsname_txt.textColor = 0x000000;
ortAinst = ortBinst;
ortBinst = ortInst;
this[ortBInst + "_text_mc"].ortsname_txt.textColor = 0xFF0000;
}
}


// Rollovereffekt

myname = "";
myinstname = "";
mystatus = "null";

// Punkte auf Karte
this.btn_mc.onRelease = function()
{
mystatus = "angeklickt";
this.gotoAndStop(2);
this._parent._parent.registriere( myinstname );
this._parent._parent.entfernung();
}

this.btn_mc.onRollOver = function()
{
this._parent._parent.ortAktiv( myinstname, 1 );
this.gotoAndStop(2);
}

this.btn_mc.onRollOut = function()
{
if (!(mystatus == "angeklickt"))
{
this._parent._parent.ortAktiv( myinstname, 2 );
this.gotoAndStop(1);
}
}
anais_siana ist offline   Mit Zitat antworten
Alt 10-04-2006, 12:45   #2 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Servus
Ich meine der "bokel" hat da mal ein ding geschrieben (Die heisse Kartoffel genannt)!
Des müßte glaub ich zu Deinem Problem passen!

Die heisse Kartoffel
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake 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 06:49 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele