Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 29-04-2004, 03:27   #1 (permalink)
Neuer User
 
Benutzerbild von julius_suiluj
 
Registriert seit: Apr 2004
Ort: BeRLin
Beiträge: 230
Question per schleife action zuweisen

hallo
ich habe das problem, dass ich per schleife mehreren MCs die gleiche aktion zuweisen will. wie das bei einem button funzt verstehe ich:
ActionScript:
  1. for (i=1; i<=20; i++){
  2. this["punkt"+i].onRelease = function() {
  3. bla bla;
  4. }

aber ich will ein onClipEvent zuweisen und das funzt ja so irgendwie nicht.

wie ist der richtige syntax?
__________________
www.spektronaut.de

while ($bush == $president){
$krieg++;
}
julius_suiluj ist offline   Mit Zitat antworten
Alt 29-04-2004, 08:30   #2 (permalink)
Hot's no frogn gebn?!
 
Benutzerbild von Joemoe
 
Registriert seit: Oct 2002
Ort: Vlbg, ÖR
Beiträge: 186
es gibt für jeden onClipEvent auch einen eventhandler
musst nur den entsprchenden definieren, statt onRelease onEnterFrame oder so,...

in der flash hilfe findest alle:
Zitat:
Event handler
Description

MovieClip.onData
Invoked when all the data is loaded into a movie clip.

MovieClip.onDragOut
Invoked while the pointer is outside the button; the mouse button is pressed inside, and then rolls outside the button area.

MovieClip.onDragOver
Invoked while the pointer is over the button; the mouse button has been pressed then rolled outside the button, and then rolled back over the button.

MovieClip.onEnterFrame
Invoked continually at the frame rate of the SWF file. The actions associated with the enterFrame clip event are processed before any frame actions that are attached to the affected frames.

MovieClip.onKeyDown
Invoked when a key is pressed. Use the Key.getCode() and Key.getAscii() methods to retrieve information about the last key pressed.

MovieClip.onKeyUp
Invoked when a key is released.

MovieClip.onKillFocus
Invoked when focus is removed from a button.

MovieClip.onLoad
Invoked when the movie clip is instantiated and appears in the Timeline.

MovieClip.onMouseDown
Invoked when the left mouse button is pressed.

MovieClip.onMouseMove
Invoked every time the mouse is moved.

MovieClip.onMouseUp
Invoked when the left mouse button is released.

MovieClip.onPress
Invoked when the mouse is pressed while the pointer is over a button.

MovieClip.onRelease
Invoked when the mouse is released while the pointer is over a button.

MovieClip.onReleaseOutside
Invoked when the mouse is released while the pointer is outside the button after the button is pressed while the pointer is inside the button.

MovieClip.onRollOut
Invoked when the pointer rolls outside of a button area.

MovieClip.onRollOver
Invoked when the mouse pointer rolls over a button.

MovieClip.onSetFocus
Invoked when a button has input focus and a key is released.

MovieClip.onUnload
Invokes in the first frame after the movie clip is removed from the Timeline. The actions associated with the Unload movie clip event are processed before any actions are attached to the affected frame.
__________________
www.morgenstille.at
www.treemotion.at
Joemoe ist offline   Mit Zitat antworten
Alt 29-04-2004, 08:44   #3 (permalink)
Neuer User
 
Registriert seit: Dec 2001
Ort: D
Beiträge: 381
Du bist doch schon nah dran, eigentlich sollte das
fast genau so gehen

ActionScript:
  1. for (var i = 1 ; i <=3 ; i++) {
  2.     this["btn"+i].onRelease = function() {
  3.         trace(this._name);
  4.     };
  5. }
momo-loom ist offline   Mit Zitat antworten
Alt 29-04-2004, 11:55   #4 (permalink)
Neuer User
 
Benutzerbild von julius_suiluj
 
Registriert seit: Apr 2004
Ort: BeRLin
Beiträge: 230
Smile

vielen dank jetzt klapt es!
__________________
www.spektronaut.de

while ($bush == $president){
$krieg++;
}
julius_suiluj 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 00:28 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele