Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 02-12-2004, 15:07   #1 (permalink)
yaqwdrtgb
 
Benutzerbild von maks
 
Registriert seit: Dec 2003
Ort: hh
Beiträge: 92
random kritzelei

hi!

ich hätte so gerne das:
besipiel
hehe...

also im prinzip, ein punkt der an einer (der einfachheit halber) an einer bestimmten koordinate anfängt zu zeichnen. und das random.

wir hätten da folgenden zutaten:
# Math.random()
# MovieClip.beginFill(), MovieClip.beginGradientFill(), MovieClip.clear(), MovieClip.curveTo(), MovieClip.lineTo(), MovieClip.moveTo()

wirft man beides in einen topf kommt heraus...



hat wer einen vorschlag - leider sind meine AS-script überhaupt nicht doll. also wenn ich mich zusammenreisse, kann ich flash dazu bewegen, ein quadrat zu zeichnen und dies mit einer farbe zu füllen. das dauert aber schon mindestens eine halbe stunde!

und mathRandom - hau mir ab...

erbarmt sich jemand?
maks ist offline   Mit Zitat antworten
Alt 02-12-2004, 16:50   #2 (permalink)
Flash & TYPO3
 
Registriert seit: Oct 2003
Ort: Bayern
Beiträge: 2.700
Die Zufallsbewegung ist schwer. Dass aber dort eine Linie entsteht könntest du zB mit attachMovie machen, der nur einen Punkt enthält. Ich weiß, dass ich mal so ein Beispiel für Schrift Zeichnen hatte. Das klappte gut. Wäre vielleicht ein Ansatz...
__________________
Mediendesign-Student
johanness ist offline   Mit Zitat antworten
Alt 02-12-2004, 17:10   #3 (permalink)
_//\\#//\\_
 
Benutzerbild von warrantmaster
 
Registriert seit: Jan 2003
Beiträge: 7.060
fehlt nur noch curveTo

PHP-Code:
_root.moveTo(200,200)
_root.lineStyle(2,0x00,100)
for(var 
i=0;i<100;i++)
{
    var 
xpos=Math.round(random(400))
    var 
ypos=Math.round(random(400))
    
_root.lineTo(xpos,ypos)

grz
warrantmaster ist offline   Mit Zitat antworten
Alt 02-12-2004, 17:27   #4 (permalink)
-
 
Benutzerbild von pape
 
Registriert seit: Jan 2004
Beiträge: 3.002
mit curve to z.b. so:
ActionScript:
  1. _root.moveTo(200,200)
  2. _root.lineStyle(2,0x00,100)
  3. for(var i=0;i<100;i++)
  4. {
  5.     var xpos=Math.round(random(400))
  6.     var ypos=Math.round(random(400))
  7.     var xan=Math.round(random(400))
  8.     var yan=Math.round(random(400))
  9.     if (Math.round(random(2))) {
  10.         _root.curveTo(xpos,ypos,xan,yan)
  11.     } else {
  12.         _root.lineTo(xpos,ypos);
  13.     }
  14. }
grz
pape
pape ist offline   Mit Zitat antworten
Alt 02-12-2004, 17:37   #5 (permalink)
_//\\#//\\_
 
Benutzerbild von warrantmaster
 
Registriert seit: Jan 2003
Beiträge: 7.060
pape....da kommt kunst bei raus....

(gleich ausdrucken und an die wand tackern )
warrantmaster ist offline   Mit Zitat antworten
Alt 02-12-2004, 19:47   #6 (permalink)
Flash & TYPO3
 
Registriert seit: Oct 2003
Ort: Bayern
Beiträge: 2.700
Thumbs up

Sieht zwar bestimmt nie ganz so aus, wie zB auf dem Bild, aber gekrizelt ist es sicher
__________________
Mediendesign-Student
johanness ist offline   Mit Zitat antworten
Alt 02-12-2004, 19:50   #7 (permalink)
-
 
Benutzerbild von pape
 
Registriert seit: Jan 2004
Beiträge: 3.002
hm.. auch schön:
ActionScript:
  1. durcheinander=100;//besser nicht über 3000 setzen... bei 1000 fangen bei meinem pc die probleme an...
  2. pape = function () {
  3.     if(_root.malen) {
  4.         _root.malen.removeMovieClip();
  5.     }
  6.     _root.createEmptyMovieClip("malen",1);
  7.     _root.malen.moveTo(200,200)
  8.     for(var i=0;i<durcheinander;i++)
  9.     {
  10.         var xpos=Math.round(random(400))
  11.         var ypos=Math.round(random(400))
  12.         var xan=Math.round(random(400))
  13.         var yan=Math.round(random(400))
  14.         f = "0x"+Math.round(Math.random()*100)+Math.round(Math.random()*100)+Math.round(Math.random()*100);
  15.         _root.malen.lineStyle(2,f,100)
  16.         if (Math.round(random(2))) {
  17.             _root.malen.curveTo(xpos,ypos,xan,yan)
  18.         } else {
  19.             _root.malen.lineTo(xpos,ypos);
  20.         }
  21.     }
  22. }
  23. SID = setInterval( pape, 1000);

...1 Kinderbild pro sekunde!
...
...

grz
pape

Geändert von pape (02-12-2004 um 19:54 Uhr)
pape ist offline   Mit Zitat antworten
Alt 02-12-2004, 20:00   #8 (permalink)
-
 
Benutzerbild von pape
 
Registriert seit: Jan 2004
Beiträge: 3.002
oder als Hintergrund:
ActionScript:
  1. durcheinander=250;
  2. _root.createTextField("txt",2,160,200,0,20);
  3. txt.autoSize=true;
  4. txt.text = "hallo, ich bin ein Blind text";
  5. pape = function () {
  6.     if(_root.malen) {
  7.         _root.malen.removeMovieClip();
  8.     }
  9.     _root.createEmptyMovieClip("malen",1);
  10.     _root.malen.moveTo(200,200)
  11.     for(var i=0;i<durcheinander;i++)
  12.     {
  13.         var xpos=Math.round(random(400))
  14.         var ypos=Math.round(random(400))
  15.         var xan=Math.round(random(400))
  16.         var yan=Math.round(random(400))
  17.         f = "0x"+Math.round(Math.random()*100)+Math.round(Math.random()*100)+Math.round(Math.random()*100);
  18.         _root.malen.lineStyle(2,f,Math.round(Math.random()*20));
  19.         if (Math.round(random(2))) {
  20.             _root.malen.curveTo(xpos,ypos,xan,yan)
  21.         } else {
  22.             _root.malen.lineTo(xpos,ypos);
  23.         }
  24.     }
  25. }
  26. SID = setInterval( pape, 2000);
pape ist offline   Mit Zitat antworten
Alt 02-12-2004, 20:08   #9 (permalink)
_//\\#//\\_
 
Benutzerbild von warrantmaster
 
Registriert seit: Jan 2003
Beiträge: 7.060
PHP-Code:
SID setIntervalpape2000); 

....na,....auch schon durchgeknallt....
warrantmaster ist offline   Mit Zitat antworten
Alt 02-12-2004, 20:25   #10 (permalink)
.
 
Registriert seit: May 2003
Ort: bayern
Beiträge: 1.117
damit es jetzt richtig bunt wird und der ganze farbraum ausgekostet wird schlag ich dir vor die zeile
ActionScript:
  1. f = "0x"+Math.round(Math.random()*100)+Math.round(Math.random()*100)+Math.round(Math.random()*100);

zu ersetzen durch:
ActionScript:
  1. var r = random(256);
  2. var g = random(256);
  3. var b = random(256);
  4. var f = r << 16 | g << 8 | b;
__________________
[mooseMash]
mooseMash ist offline   Mit Zitat antworten
Alt 02-12-2004, 20:45   #11 (permalink)
*hello new world
 
Benutzerbild von nalin
 
Registriert seit: Jan 2004
Ort: sauerland
Beiträge: 1.788
Thumbs up

mit der ergänzung von mooseMash siehts mal richtig nach kritzelei aus!
nalin ist offline   Mit Zitat antworten
Alt 02-12-2004, 21:00   #12 (permalink)
-
 
Benutzerbild von pape
 
Registriert seit: Jan 2004
Beiträge: 3.002
jo. endlich mal was mit bitweisen operatoren... gg
pape 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 05:58 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele