Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > Flash/Flex > Flash
Flash Forum d'entraide sur la technologie Flash (Cours, FAQs, Sources)
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 17/07/2008, 19h50   #1
Invité de passage
 
Inscription : avril 2008
Messages : 17
Détails du profil
Informations forums :
Inscription : avril 2008
Messages : 17
Points : 3
Points : 3
Par défaut un fractal, modifier couleurs et aspect.

Bonjour,

loin de moi de jouer les fainéants.
je n'ai en fait jamais programmé sur Flash de script.
La conception d'animation Flash m'est parfaitement inconnue.

Je crée mon site web (en php) et je travaille en ce moment sur l'aspect de mon site.

Et voilà que je tombe sur cette animation flash (http://www.toocharger.com/fiches/scr...al-v1/4671.htm) qui génère automatiquement une fractale qui fond merveilleusement bien avec le reste de ma page web, à ceci près que les couleurs des branches de la fractale ne me vont pas, et je voudrai également que le fond soit noir.

Pour éviter d'apprendre tout depuis le début, quelqu'un pourrait m'indiquer où et comment modifier le code pour définir la couleur de fond et la couleur des branches des fractals...
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Stage.scaleMode = "noScale";
MovieClip.prototype.randPos = function(click) {
	this._x = (click) ? _root._xmouse : Math.random()*400+75;
	this._y = (click) ? _root._ymouse : Math.random()*300+50;
};
MovieClip.prototype.putOnParent = function(clip) {
	this._x = clip.stuff.current.x+clip._x;
	this._y = clip.stuff.current.y+clip._y;
};
MovieClip.prototype.draw = function() {
	(mat=new flash.geom.Matrix()).translate(this._x, this._y);
	all.draw(this, mat);
	this.clear();
};
_root.attachBitmap((all=new flash.display.BitmapData(400, 200)), 1);
function genBranch(clip, onBranch, level, click, numKids) {
	(onBranch) ? col=clip.stuff.c : col=(0x638A00*((randCol=Math.random())>.5))+(0xBDEB00*(randCol<=.5));
	(c=_root.createEmptyMovieClip("branch"+_root.getNextHighestDepth(), _root.getNextHighestDepth())).stuff = {l:level, av:0, a:(onBranch) ? clip.stuff.a+(Math.random()*90-45)*(Math.random()>.2) : Math.random()*360, c:col, aav:(Math.random()-.5)/2, t:(clip.stuff.t != undefined) ? clip.stuff.t : 5, current:new flash.geom.Point(), child:0, lastChild:0, age:0, currentg:(clip.stuff.currentg == undefined) ? new flash.geom.Point() : clip.stuff.currentg};
	(onBranch) ? c.putOnParent(clip) : c.randPos(click);
	c.onEnterFrame = function() {
		this.lineStyle(this.stuff.t, this.stuff.c, 100);
		this.stuff.av += this.stuff.aav;
		this.stuff.a += this.stuff.av;
		this.moveTo(this.stuff.current.x, this.stuff.current.y);
		(this.stuff.current=new flash.geom.Point(this.stuff.current.x+Math.cos(this.stuff.a*Math.PI/180)*5, this.stuff.current.y+Math.sin(this.stuff.a*Math.PI/180)*-5));
		this.lineTo(this.stuff.current.x, this.stuff.current.y);
		this.localToGlobal((this.stuff.currentg=this.stuff.current.clone()));
		(((this.stuff.currentg.x>450 || this.stuff.currentg.x<100 || this.stuff.currentg.y>350 || this.stuff.currentg.y<50) || Math.random()*100>80) && this.stuff.child<5-this.stuff.l && this.stuff.lastChild>this.stuff.age-300 && (this.stuff.lastChild>0 || this.stuff.age>30)) ? genBranch(this, true, this.stuff.l+1, (this.stuff.child++)) : this.stuff.age++;
		this.draw();
		((this.stuff.currentg.x>600 || this.stuff.currentg.x<-100 || this.stuff.currentg.y>500 || this.stuff.currentg.y<-100 || this.stuff.t<.1) && this.stuff.age>60) ? this.removeMovieClip() : this.stuff.t *= 1-(this.stuff.l/300);
	};
}
onMouseDown = function () {
	genBranch(_root, false, 1, true);
};
genBranch(_root, false, 1, false);
genBranch(_root, false, 1, false);

Merci d'avance.

G.
gritchou est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/08/2008, 10h04   #2
Membre confirmé
 
Inscription : avril 2008
Messages : 189
Détails du profil
Informations forums :
Inscription : avril 2008
Messages : 189
Points : 223
Points : 223
Citation:
Envoyé par gritchou Voir le message
Bonjour,

loin de moi de jouer les fainéants.
je n'ai en fait jamais programmé sur Flash de script.
La conception d'animation Flash m'est parfaitement inconnue.

Je crée mon site web (en php) et je travaille en ce moment sur l'aspect de mon site.

Et voilà que je tombe sur cette animation flash (http://www.toocharger.com/fiches/scr...al-v1/4671.htm) qui génère automatiquement une fractale qui fond merveilleusement bien avec le reste de ma page web, à ceci près que les couleurs des branches de la fractale ne me vont pas, et je voudrai également que le fond soit noir.

Pour éviter d'apprendre tout depuis le début, quelqu'un pourrait m'indiquer où et comment modifier le code pour définir la couleur de fond et la couleur des branches des fractals...
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Stage.scaleMode = "noScale";
MovieClip.prototype.randPos = function(click) {
	this._x = (click) ? _root._xmouse : Math.random()*400+75;
	this._y = (click) ? _root._ymouse : Math.random()*300+50;
};
MovieClip.prototype.putOnParent = function(clip) {
	this._x = clip.stuff.current.x+clip._x;
	this._y = clip.stuff.current.y+clip._y;
};
MovieClip.prototype.draw = function() {
	(mat=new flash.geom.Matrix()).translate(this._x, this._y);
	all.draw(this, mat);
	this.clear();
};
_root.attachBitmap((all=new flash.display.BitmapData(400, 200)), 1);
function genBranch(clip, onBranch, level, click, numKids) {
	(onBranch) ? col=clip.stuff.c : col=(0x638A00*((randCol=Math.random())>.5))+(0xBDEB00*(randCol<=.5));
	(c=_root.createEmptyMovieClip("branch"+_root.getNextHighestDepth(), _root.getNextHighestDepth())).stuff = {l:level, av:0, a:(onBranch) ? clip.stuff.a+(Math.random()*90-45)*(Math.random()>.2) : Math.random()*360, c:col, aav:(Math.random()-.5)/2, t:(clip.stuff.t != undefined) ? clip.stuff.t : 5, current:new flash.geom.Point(), child:0, lastChild:0, age:0, currentg:(clip.stuff.currentg == undefined) ? new flash.geom.Point() : clip.stuff.currentg};
	(onBranch) ? c.putOnParent(clip) : c.randPos(click);
	c.onEnterFrame = function() {
		this.lineStyle(this.stuff.t, this.stuff.c, 100);
		this.stuff.av += this.stuff.aav;
		this.stuff.a += this.stuff.av;
		this.moveTo(this.stuff.current.x, this.stuff.current.y);
		(this.stuff.current=new flash.geom.Point(this.stuff.current.x+Math.cos(this.stuff.a*Math.PI/180)*5, this.stuff.current.y+Math.sin(this.stuff.a*Math.PI/180)*-5));
		this.lineTo(this.stuff.current.x, this.stuff.current.y);
		this.localToGlobal((this.stuff.currentg=this.stuff.current.clone()));
		(((this.stuff.currentg.x>450 || this.stuff.currentg.x<100 || this.stuff.currentg.y>350 || this.stuff.currentg.y<50) || Math.random()*100>80) && this.stuff.child<5-this.stuff.l && this.stuff.lastChild>this.stuff.age-300 && (this.stuff.lastChild>0 || this.stuff.age>30)) ? genBranch(this, true, this.stuff.l+1, (this.stuff.child++)) : this.stuff.age++;
		this.draw();
		((this.stuff.currentg.x>600 || this.stuff.currentg.x<-100 || this.stuff.currentg.y>500 || this.stuff.currentg.y<-100 || this.stuff.t<.1) && this.stuff.age>60) ? this.removeMovieClip() : this.stuff.t *= 1-(this.stuff.l/300);
	};
}
onMouseDown = function () {
	genBranch(_root, false, 1, true);
};
genBranch(_root, false, 1, false);
genBranch(_root, false, 1, false);

Merci d'avance.

G.
Oops...

j'avais envoyé une très longue réponse qui a malheureusement disparu dans le crash... paix à son âme...

Tu peux remplacer les 2 couleurs RGB 638A00 et BDEB00 par les couleurs de ton choix, par exemple, si veux plus bleu: 00638A et 00BDEB

)jack(
jack-ft est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 21h36.


 
 
 
 
Partenaires

Hébergement Web