Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 27-07-2004, 18:13   #1 (permalink)
Neuer User
 
Registriert seit: Jan 2004
Ort: bei Düsseldorf
Beiträge: 76
Kleine AS Spielerei :)

Ich hab etwas mit dem Math Objekt rumgespielt:

ActionScript:
  1. mf=_root.createEmptyMovieClip('mouse_follower',7);
  2. mf.lineStyle(1,0x000000);
  3. mf.lineTo(-20,-20);
  4. mf.lineTo(20,-20);
  5. mf.lineTo(0,0);
  6. mf.lineTo(20,20);
  7. mf.lineTo(-20,20);
  8. mf.lineTo(0,0);
  9.  
  10.  
  11. var depth=9; //Starttiefe.. Anpassen,falls notwendig
  12. var count=8; //anzahl der Follower-1
  13.  
  14. createEmptyMovieClip('my_mouse',depth);
  15. depth++;
  16.  
  17. function make(obj){
  18. var follow=mouse_follower.DuplicateMovieClip('follow'+depth,depth);
  19. follow.onEnterFrame=function(){
  20. var dx=obj._x-this._x;
  21. var dy=obj._y-this._y;
  22. this._x += dx/4;
  23. this._y += dy/4;
  24. var scale=10+Math.sqrt(dx*dx+dy*dy);
  25. var rota=(Math.atan(dy/dx)*180)/Math.PI;
  26. this._xscale=scale;
  27. this._yscale=scale;
  28. this._rotation=rota;
  29. };
  30. depth++;
  31. return follow;
  32. };
  33.  
  34.  
  35. tmp=make(my_mouse);
  36.  
  37. while(count>0)
  38. {
  39. tmp=make(tmp);
  40. count--;
  41. }
  42.  
  43. mf.removeMovieClip();
  44.  
  45. function move(){
  46. clearInterval(inter);
  47. my_mouse._x=Math.random()*400;
  48. my_mouse._y=Math.random()*400;
  49. inter=setInterval(move,Math.random()*4000);
  50. };
  51.  
  52.  
  53. inter=setInterval(move,Math.random()*4000);
Angehängte Dateien
Dateityp: zip f3.zip (706 Bytes, 62x aufgerufen)

Geändert von sigint (27-07-2004 um 18:14 Uhr)
sigint ist offline   Mit Zitat antworten
Alt 27-07-2004, 18:41   #2 (permalink)
_//\\#//\\_
 
Benutzerbild von warrantmaster
 
Registriert seit: Jan 2003
Beiträge: 7.060
das ist ja ein lustiges dingens

netter effekt !
grz
warrantmaster ist offline   Mit Zitat antworten
Alt 27-07-2004, 18:43   #3 (permalink)
-
 
Benutzerbild von pape
 
Registriert seit: Jan 2004
Beiträge: 3.002
jo.. sieht lustig aus!
nur komisch finde ich dass das teil manchmal losspringt wenn es mitten im sprung ist.. aber könnte man ja ändern

schick!
pape ist offline   Mit Zitat antworten
Alt 27-07-2004, 19:21   #4 (permalink)
Neuer User
 
Registriert seit: Jan 2004
Ort: bei Düsseldorf
Beiträge: 76
Das hat mich auch gestört. Ich werd das Morgen mal anpassen, sollte mit einer Variablen "moving" machbar sein. Vielleicht hat einer von euch noch ne Idee,was man witziges als Grafik nehmen kann, die angedeuteten "fliegen" sind nicht wirklich toll.

Gruß,
SIGINT
sigint ist offline   Mit Zitat antworten
Alt 27-07-2004, 21:54   #5 (permalink)
_Thomas_
Gast
 
Beiträge: n/a
*g* witzig

Zitat:
Vielleicht hat einer von euch noch ne Idee,was man witziges als Grafik nehmen kann, die angedeuteten "fliegen" sind nicht wirklich toll.
mhh..vielleicht das haus vom nikolaus...

ActionScript:
  1. mf = _root.createEmptyMovieClip('mouse_follower', 7);
  2. with (mf) {
  3.     lineStyle(1, 0x000000);
  4.     moveTo(0,60)
  5.     lineTo(40, 60);
  6.     lineTo(0, 20);
  7.     lineTo(40, 20);
  8.     lineTo(20, 0);
  9.     lineTo(0, 20);
  10.     lineTo(0, 60);
  11.     lineTo(40, 20);
  12.     lineTo(40, 60);
  13. }
  14. //rest wie gehabt
  15.  



..hausvomnikolaus-koordinaten aus dem kopf sind gar nicht so einfach..

gruß,
Tante Amanda
  Mit Zitat antworten
Alt 27-07-2004, 22:48   #6 (permalink)
FlashLove@FirstSight
 
Benutzerbild von FLASHStyler
 
Registriert seit: Feb 2003
Beiträge: 2.460
Wie wärs mit Briefumschlägen :

PHP-Code:
with(mf) {
    
lineStyle(10x000000100);
    
//Qouvert
    
moveTo(00);
    
lineTo(500);
    
lineTo(5025);
    
lineTo(025);
    
lineTo(00);
    
//Verschluss oben
    
moveTo(00);
    
lineTo(2512.5);
    
lineTo(500);
    
//Verschluss unten links
    
moveTo(025);
    
lineTo(2010);
    
//Verschluss unten rechts
    
moveTo(5025);
    
lineTo(3010);

__________________
www.johannes-erhardt.com | blog | xing me baby
FLASHStyler ist offline   Mit Zitat antworten
Alt 27-07-2004, 23:11   #7 (permalink)
_Thomas_
Gast
 
Beiträge: n/a
lol...wo ist die briefmarke?

gruß,
Tante Amanda
  Mit Zitat antworten
Alt 27-07-2004, 23:28   #8 (permalink)
FlashLove@FirstSight
 
Benutzerbild von FLASHStyler
 
Registriert seit: Feb 2003
Beiträge: 2.460
Oder mal doch was extravagantes ?!??!
PHP-Code:
//ohne Rahmen
with(mf) {
    
lineStyle(10x000000100);
    
moveTo(100);
    
lineTo(00);
    
lineTo(020);
    
moveTo(010);
    
lineTo(1010);
    
//
    
moveTo(150);
    
lineTo(1520);
    
lineTo(2520);
    
//
    
moveTo(3020);
    
lineTo(300);
    
lineTo(400);
    
lineTo(4020);
    
moveTo(3010);
    
lineTo(4010);
    
//
    
moveTo(550);
    
lineTo(450);
    
lineTo(4510);
    
lineTo(5510);
    
lineTo(5520);
    
lineTo(4520);
    
//
    
moveTo(600);
    
lineTo(6020);
    
moveTo(700);
    
lineTo(7020);
    
moveTo(6010);
    
lineTo(7010);
    
//
    
moveTo(7520);
    
lineTo(750);
    
lineTo(850);
    
moveTo(7510);
    
lineTo(8510);
    
//
    
moveTo(900);
    
lineTo(1000);
    
lineTo(10020);
    
lineTo(9020);
    
lineTo(900);
    
//
    
moveTo(10520);
    
lineTo(1050);
    
lineTo(1150);
    
lineTo(11510);
    
lineTo(10510);
    
moveTo(10510);
    
lineTo(11520);
    
//
    
moveTo(1200);
    
lineTo(12020);
    
lineTo(13020);
    
lineTo(1300);
    
//
    
moveTo(13520);
    
lineTo(1350);
    
lineTo(1400);
    
lineTo(14020);
    
moveTo(1400);
    
lineTo(1450);
    
lineTo(14520);

__________________
www.johannes-erhardt.com | blog | xing me baby

Geändert von FLASHStyler (27-07-2004 um 23:29 Uhr)
FLASHStyler ist offline   Mit Zitat antworten
Alt 27-07-2004, 23:29   #9 (permalink)
FlashLove@FirstSight
 
Benutzerbild von FLASHStyler
 
Registriert seit: Feb 2003
Beiträge: 2.460
PHP-Code:

//mit Rahmen
with(mf) {
    
lineStyle(10x000000100);
    
//
    
moveTo(-5, -5);
    
lineTo(150, -5);
    
lineTo(15025);
    
lineTo(-525);
    
lineTo(-5, -5);
    
//
    
moveTo(100);
    
lineTo(00);
    
lineTo(020);
    
moveTo(010);
    
lineTo(1010);
    
//
    
moveTo(150);
    
lineTo(1520);
    
lineTo(2520);
    
//
    
moveTo(3020);
    
lineTo(300);
    
lineTo(400);
    
lineTo(4020);
    
moveTo(3010);
    
lineTo(4010);
    
//
    
moveTo(550);
    
lineTo(450);
    
lineTo(4510);
    
lineTo(5510);
    
lineTo(5520);
    
lineTo(4520);
    
//
    
moveTo(600);
    
lineTo(6020);
    
moveTo(700);
    
lineTo(7020);
    
moveTo(6010);
    
lineTo(7010);
    
//
    
moveTo(7520);
    
lineTo(750);
    
lineTo(850);
    
moveTo(7510);
    
lineTo(8510);
    
//
    
moveTo(900);
    
lineTo(1000);
    
lineTo(10020);
    
lineTo(9020);
    
lineTo(900);
    
//
    
moveTo(10520);
    
lineTo(1050);
    
lineTo(1150);
    
lineTo(11510);
    
lineTo(10510);
    
moveTo(10510);
    
lineTo(11520);
    
//
    
moveTo(1200);
    
lineTo(12020);
    
lineTo(13020);
    
lineTo(1300);
    
//
    
moveTo(13520);
    
lineTo(1350);
    
lineTo(1400);
    
lineTo(14020);
    
moveTo(1400);
    
lineTo(1450);
    
lineTo(14520);

Edit: War nicht einfach die Koordinaten aus dem Kopf !!!!!
__________________
www.johannes-erhardt.com | blog | xing me baby

Geändert von FLASHStyler (27-07-2004 um 23:33 Uhr)
FLASHStyler ist offline   Mit Zitat antworten
Alt 28-07-2004, 08:20   #10 (permalink)
Neuer User
 
Registriert seit: Jan 2004
Ort: bei Düsseldorf
Beiträge: 76
Cool :d
Angehängte Dateien
Dateityp: zip ff.zip (883 Bytes, 40x aufgerufen)
sigint ist offline   Mit Zitat antworten
Alt 28-07-2004, 12:48   #11 (permalink)
FlashLove@FirstSight
 
Benutzerbild von FLASHStyler
 
Registriert seit: Feb 2003
Beiträge: 2.460
Flash Forum Rules
__________________
www.johannes-erhardt.com | blog | xing me baby
FLASHStyler 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 18:31 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele