Bonjour,

Bon, j'ai fait des progrès et mon SlideShow fonctionne. Tout ce qu'il me reste à faire, c'est d'agrandit l'image lorsqu'on clique sur le ScrollPane du centre. J'ai cependant une erreur à la première ligne de ma fonction zoomIn(). VOus pouvez m'aider?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
var numImage:Number = 1;
var maxImage:Number = 26;
var X_PETITE_VIGNETTE:Number = 120/1280;
var Y_PETITE_VIGNETTE:Number = 90/960;
var X_GRANDE_VIGNETTE:Number = 267/1280;
var Y_GRANDE_VIGNETTE:Number = 200/960;
var X_FULL_SIZE:Number = 500/960;
var Y_FULL_SIZE:Number = 500/960;
 
 
import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;
var plLdr:Loader = new Loader();
var pcLdr:Loader = new Loader();
var prLdr:Loader = new Loader();
if(maxImage > 0) {
	pcLdr.load(new URLRequest("img/r1.jpg"));
	pcLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, show_grande_vignette);
	plLdr.load(new URLRequest("img/r"+maxImage+".jpg"));
	plLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, show_petite_vignette_gauche);
}
if(2 <= maxImage) {
	prLdr.load(new URLRequest("img/r2.jpg"));
	prLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, show_petite_vignette_droite);
}
 
function show_grande_vignette(event:Event):void {
	var img:DisplayObject = pcLdr.content as DisplayObject;
	img.scaleX = X_GRANDE_VIGNETTE;
	img.scaleY = Y_GRANDE_VIGNETTE;
    photo_centre.addChild(img); 
}
 
function show_petite_vignette_gauche(event:Event):void {
	var img:DisplayObject = plLdr.content as DisplayObject;
	img.scaleX = X_PETITE_VIGNETTE;
	img.scaleY = Y_PETITE_VIGNETTE;
    photo_gauche.addChild(img); 
}
 
function show_petite_vignette_droite(event:Event):void {
	var img:DisplayObject = prLdr.content as DisplayObject;
	img.scaleX = X_PETITE_VIGNETTE;
	img.scaleY = Y_PETITE_VIGNETTE;
    photo_droite.addChild(img); 
}
 
//Définition des actions sur le formulaire
btn_suivant.addEventListener(MouseEvent.MOUSE_DOWN, suivant);
btn_precedent.addEventListener(MouseEvent.MOUSE_DOWN, precedent);
photo_centre.addEventListener(MouseEvent.MOUSE_DOWN, zoomIn);
 
function suivant(event:MouseEvent):void {
	var plLdr:Loader = new Loader();
	var pcLdr:Loader = new Loader();
	var prLdr:Loader = new Loader();
	plLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, spvg);
	pcLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, sgv);
	prLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, spvd);
	while(photo_gauche.numChildren > 0) photo_gauche.removeChildAt(0);
	plLdr.load(new URLRequest("img/r"+numImage+".jpg"));
	numImage++;
	while(photo_centre.numChildren > 0) photo_centre.removeChildAt(0);
	if(numImage > maxImage) numImage = 1;
	pcLdr.load(new URLRequest("img/r"+numImage+".jpg"));
	while(photo_droite.numChildren > 0) photo_droite.removeChildAt(0);
	if((numImage + 1) > maxImage) numImage = 1;
	prLdr.load(new URLRequest("img/r"+(numImage + 1)+".jpg"));
 
	function sgv(event:Event):void {
		var img:DisplayObject = pcLdr.content as DisplayObject;
		img.scaleX = X_GRANDE_VIGNETTE;
		img.scaleY = Y_GRANDE_VIGNETTE;
		photo_centre.addChild(img); 
	}
 
	function spvg(event:Event):void {
		var img:DisplayObject = plLdr.content as DisplayObject;
		img.scaleX = X_PETITE_VIGNETTE;
		img.scaleY = Y_PETITE_VIGNETTE;
		photo_gauche.addChild(img); 
	}
 
	function spvd(event:Event):void {
		var img:DisplayObject = prLdr.content as DisplayObject;
		img.scaleX = X_PETITE_VIGNETTE;
		img.scaleY = Y_PETITE_VIGNETTE;
		photo_droite.addChild(img); 
	}
}
 
 
function precedent(event:MouseEvent):void {
	var plLdr:Loader = new Loader();
	var pcLdr:Loader = new Loader();
	var prLdr:Loader = new Loader();
	plLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, spvg);
	pcLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, sgv);
	prLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, spvd);
	while(photo_droite.numChildren > 0) photo_droite.removeChildAt(0);
	prLdr.load(new URLRequest("img/r"+numImage+".jpg"));
	numImage--;
	while(photo_centre.numChildren > 0) photo_centre.removeChildAt(0);
	if(numImage < 1) numImage = maxImage;
	pcLdr.load(new URLRequest("img/r"+numImage+".jpg"));
	while(photo_gauche.numChildren > 0) photo_gauche.removeChildAt(0);
	if((numImage - 1) < 1) plLdr.load(new URLRequest("img/r"+maxImage+".jpg"));
	else plLdr.load(new URLRequest("img/r"+(numImage - 1)+".jpg"));
 
	function sgv(event:Event):void {
		var img:DisplayObject = pcLdr.content as DisplayObject;
		img.scaleX = X_GRANDE_VIGNETTE;
		img.scaleY = Y_GRANDE_VIGNETTE;
		photo_centre.addChild(img); 
	}
 
	function spvg(event:Event):void {
		var img:DisplayObject = plLdr.content as DisplayObject;
		img.scaleX = X_PETITE_VIGNETTE;
		img.scaleY = Y_PETITE_VIGNETTE;
		photo_gauche.addChild(img); 
	}
 
	function spvd(event:Event):void {
		var img:DisplayObject = prLdr.content as DisplayObject;
		img.scaleX = X_PETITE_VIGNETTE;
		img.scaleY = Y_PETITE_VIGNETTE;
		photo_droite.addChild(img); 
	}
}
 
function zoomIn(event:MouseEvent):void {
	var img:DisplayObject = photo_centre.content as DisplayObject;
	img.scaleX = X_FULL_SIZE;
	img.scaleY = Y_FULL_SIZE;
	photo_centre.move(-10, -10);
	//photo_centre.update();
	photo_centre.addEventListener(MouseEvent.MOUSE_DOWN, zoomOut);
}
 
function zoomOut(event:MouseEvent):void {
	var img:DisplayObject = photo_centre.content as DisplayObject;
	img.scaleX = X_GRANDE_VIGNETTE;
	img.scaleY = Y_GRANDE_VIGNETTE;
	//photo_centre.update();
	photo_centre.addEventListener(MouseEvent.MOUSE_DOWN, zoomIn);
}
Aussi, si vous connaissez un moyen pour que je n'aie pas à redéfinir les fonction show_grande_vignette() et cie dans mes fonctions suivant() et précédent() sans générer l'erreur #2025, je suis preneur.