Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 11-06-2004, 22:49   #1 (permalink)
...
 
Registriert seit: Jun 2004
Beiträge: 115
eval funzt nit...!

PHP-Code:
  trace(eval("this"));
  
this.eval(song"+cur+"_mc).openme(); 
ich will durch eval dynamisch movieclipsfunktionen aufrufen, doch irgendwie funzt das nit....kann mir einer helfen?

Grüße Tobi
Tobi81 ist offline   Mit Zitat antworten
Alt 11-06-2004, 22:57   #2 (permalink)
Flashaholic
 
Benutzerbild von atothek
 
Registriert seit: Feb 2003
Ort: Berlin
Beiträge: 1.459
na das wird so nix

PHP-Code:
 trace(eval("this"));
  
this.eval(song"+cur+"_mc).openme(); // ??????????????????? 
entweder

PHP-Code:
trace(eval("this"));// ist ok
this["song"+cur+"_mc"].openme(); // wenn cur eine Variable ist
// oder
this[song+"cur"+_mc].openme(); // wenn song und _mc variablen sind 
__________________
TVNEXT Solutions
atothek ist offline   Mit Zitat antworten
Alt 11-06-2004, 23:07   #3 (permalink)
...
 
Registriert seit: Jun 2004
Beiträge: 115
wie nicht anders zu erwartet war wieder atothek

jetzt zum x mal vielen DANKE, jetzt hab ich zumindest keine syntax fehler mehr, aber die function läd er trotzdem nicht.....

PHP-Code:
cur 0;
min 0;
max 7;
interval 300;
//
start_move = function () {
    if ((
cur<max) && (cur>=0)) {
        
// trace("if");
         
trace(cur);
        
// this.["song"+cur+"_mc"].openme();
        // this.eval("song"+cur+"_mc").openme();
        // this.eval(song"+cur+"_mc).openme();
        // ["mc"+index+"_einladen"].
        
this["song"+cur+"_mc"].openme();
        
cur++;
        
clearInterval(yID);
        
yID setInterval(start_moveinterval);
    } else {
        
// trace("ende");
        
clearInterval(yID);
        
// start_move();
    
}
};
//
start_move(); 
auf song1_mc, und song2_mc.....

PHP-Code:
openme = function () {
    
maske_mc.tween("_width"2201'linear');
}; 
Tobi81 ist offline   Mit Zitat antworten
Alt 11-06-2004, 23:16   #4 (permalink)
Flashaholic
 
Benutzerbild von atothek
 
Registriert seit: Feb 2003
Ort: Berlin
Beiträge: 1.459
beschreib doch nochmal exakt was passieren soll und wie wo was ist ????

also auf den ersten blick vermute ich soetwas



PHP-Code:
start_move = function () {
    if ((
cur<max) && (cur>=0)) {
        
this["song"+cur+"_mc"].openme();
        
cur++;
        if(
yID==undefined)yID setInterval(start_moveinterval);
    } else {
        
clearInterval(yID);
    }
};
//
start_move(); 
ach und die funktion openme() wird wo deklariert ???
__________________
TVNEXT Solutions
atothek ist offline   Mit Zitat antworten
Alt 11-06-2004, 23:19   #5 (permalink)
...
 
Registriert seit: Jun 2004
Beiträge: 115
ok du hast mal wieder gewonne hier mein source...

eh ich dirs erklär gehts so schneller

am ende soll das sowas werden wie in den gif => maroon5.com

PS: die schleife ist schon richtig und funzt auch, nur er soll zeitabhängig funktionen auf rufen die auf einer anderen mc sind....buh wie kompliziert...

naja der aufrufe der openme funktion auf der anderen mc funzt leider noch nit...
Angehängte Grafiken
Dateityp: gif blend.gif (7,9 KB, 12x aufgerufen)
Angehängte Dateien
Dateityp: zip radio.zip (4,8 KB, 8x aufgerufen)

Geändert von Tobi81 (11-06-2004 um 23:29 Uhr)
Tobi81 ist offline   Mit Zitat antworten
Alt 11-06-2004, 23:42   #6 (permalink)
Flashaholic
 
Benutzerbild von atothek
 
Registriert seit: Feb 2003
Ort: Berlin
Beiträge: 1.459
na ich guck mal aber was mir gleich auffällt du includest nen twee.as und das ist in der zip nicht dabei
__________________
TVNEXT Solutions
atothek ist offline   Mit Zitat antworten
Alt 11-06-2004, 23:47   #7 (permalink)
...
 
Registriert seit: Jun 2004
Beiträge: 115
ok dacht du hättest die...bekommst du hier:

Tween in Actionscript

oder hier:

http://gfx2u.de/download/down/MovieClipTween.mxp

Zitat:
This extension adds tweening methods to MovieClip
After
#include "lmc_tween.as" for ActionScript 2.0 (runs fine on Flash Player 6) or
#include "lmc_tween_as1.as" for ActionScript 1.0
you can use following methods for MovieClip:
MovieClip.tween()
MovieClip.stopTween()
MovieClip.isTweening()
MovieClip.getTweens()
MovieClip.lockTween()
MovieClip.unlockTween()
MovieClip.isTweenLocked()
MovieClip.alphaTo()
MovieClip.brightnessTo()
MovieClip.colorTo()
MovieClip.colorTransformTo()
MovieClip.scaleTo()
MovieClip.slideTo()
MovieClip.rotateTo()

Detailed documentation is in Help panel > Movieclip Tweening Prototypes

Additional Notes:
To create your own custom easing use custom easing tool from window->Other Panels->custom Easing Tool
If you plan to use this prototypes in your own class, to extend MovieClip class and prevent from compile time errors, you must manully replace the file "MovieClip.as" in your Flash MX 2004\[language]\First Run\Classes directory with file in this location:
WinXP: C:\Documents and Settings\[username]\Local Settings\Application Data\Macromedia\Flash MX 2004\[language]\Configuration\Shared\Zigo
Win9X: C:\Windows\Application Data\Macromedia\Flash MX 2004\[language]\Configuration\Shared\Zigo
Mac: HD:Users:[username]:Library:Application Support:Macromedia Flash MX 2004:[language]:Configuration:Shared:Zigo
Homepage and main discussion thread of this extension http://proto.layer51.com/d.aspx?f=1142
Original idea by Zeh Fernando http://proto.layer51.com/d.aspx?f=804
Easing Equations
(c) 2003 Robert Penner, all rights reserved.
This work is subject to the terms in http://www.robertpenner.com/easing_terms_of_use.html.

Documentation (F1) -> Movieclip Tweening Prototypes
syntax helper
actions Panel->Movieclip Tweening
Window->Other Panels->custom Easing Tool
Tobi81 ist offline   Mit Zitat antworten
Alt 11-06-2004, 23:56   #8 (permalink)
Flashaholic
 
Benutzerbild von atothek
 
Registriert seit: Feb 2003
Ort: Berlin
Beiträge: 1.459
so nu8n hab ich ma die sache gelötet

auf der HZ:
PHP-Code:
#include "lmc_tween.as"

this.cur 0;
this.min 0;
this.max 7;
this.interval 300;
//
this.start_move = function() {
    if ((
this.cur<=this.max) && (this.cur>=0)) {
        
trace("song"+cur+"_mc");
        
this["song"+cur+"_mc"].openme();
        
this.cur++;
        if (
this.yID == undefined) {
            
this.yID setInterval(this"start_move"interval);
        }
    } else {
        
clearInterval(this.yID);
    }
};
//
this.start_move(); 
und im Mc

PHP-Code:
this.openme = function() {
    
trace("aufruf");
    
this.maske_mc.tween("_width"2201'linear');
};
//
this.onRelease = function() {
    
this.openme();
}; 
1. du mußt das script nur einmal includen da es prototypes erzeugt und die sind dann für alle mc gültig egal wo die sind.

2. ein kleiner Rat gewöhn dir das this an es ist zwar ein bisschen mehr zu tippen aber es lohnt sich (meiner Meinung nach)
__________________
TVNEXT Solutions
atothek ist offline   Mit Zitat antworten
Alt 12-06-2004, 00:06   #9 (permalink)
...
 
Registriert seit: Jun 2004
Beiträge: 115
VIELEN DANK...! ich kann nicht oft genug sagen....werd dich nur noch 5 wochen lang nerven, am 17. Juli ist abgabe!

nacht...!
Tobi81 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 11:16 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele