Bonjour.

J'ai téléchargé un template de site en Flash qui contenait deux galeries.

Démo du template : http://s3.envato.com/files/84777/index.html

Je voulais seulement garder une galerie, j'ai donc couper le dossier contenant tout ce qui concerne cette galerie. (Je parle de la ''Traditional Gallery'' du menu).

Ensuite j'ai essayé de la lancer mais elle ne marche plus, rien ne s'affiche, le SWF se lance mais il reste noir.

Je suis donc rentré dans le code, et j'ai vu écrit en commentaire : "Activez cette variable pour tester en local".

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
var galleryFolder:String = "gallery-traditional/gallery1/";
// activate this variable for local testing
// var galleryFolder:String = "";
Je l'ai donc activée. Là ca marche, mais en partie seulement : l'image n'est pas au centre et il n'y a pas les boutons "Précédent" et "Suivant" comme dans la démo.

Je voulais donc savoir comment y remédier, et comment je peux résoudre ce problème ?

Voilà le lien vers tous les fichiers source du site en entier : http://rbelly.free.fr/autres/template.zip
Voilà le lien vers tous les fichiers source de la ''Traditional Gallery'' : http://rbelly.free.fr/autres/galerie.zip

Voilà le code du FLA de la ''Traditional Gallery'':

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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
import mx.transitions.Tween;
import mx.transitions.easing.*;
//System.useCodepage = true;
Mouse.removeListener(mouseListener);
_root.large_mc.description_mc.desc_txt.html = true;
var maxWSpace:Number = 940;
var maxHSpace:Number = 400;
var thumbnailWidth:Number = 130;
var totalHThumbs:Number = Math.floor(maxWSpace/90);
var hSpacing:Number = 0;
var vSpacing:Number = 0;
var media:Array = new Array();
var thumbnails:Array = new Array();
var largeAssets:Array = new Array();
var descriptions:Array = new Array();
var MYID:Number;
_global.FSImages = "no";
function init() {
	up_mc._visible = false;
	down_mc._visible = false;
}
init();
 
var galleryFolder:String = "gallery-traditional/gallery1/";
// activate this variable for local testing
// var galleryFolder:String = "";
var galleryXMLFile:String = galleryFolder+"gallery.xml";
var galleryXML:XML = new XML();
var total:Number = 0;
galleryXML.ignoreWhite = true;
 
galleryXML.onLoad = function(success) {
	if (success) {
		total = this.firstChild.childNodes.length;
		_global.FSImages = this.firstChild.attributes.fullScreenImages;
		for (var i:Number = 0; i<total; i++) {
			media.push(this.firstChild.childNodes[i].attributes.type);
			thumbnails.push(this.firstChild.childNodes[i].attributes.thumbnail);
			largeAssets.push(this.firstChild.childNodes[i].attributes.large);
			descriptions.push(this.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue);
			var tile_mc:MovieClip = thumbnails_mc.attachMovie("box", "box"+i, i);
			tile_mc.ID = i;
			tile_mc.target_mc.loadMovie(galleryFolder+thumbnails[i]);
			if (hSpacing>maxWSpace-(thumbnailWidth*2)) {
				hSpacing = 0;
				vSpacing += thumbnailWidth;
			} else {
				if (i != 0) {
					hSpacing += thumbnailWidth;
				}
			}
			tile_mc._x = hSpacing;
			tile_mc._y = vSpacing;
			tile_mc.onRollOver = function() {
				var fadeDown:Tween = new Tween(this, "_alpha", None.easeOut, this._alpha, 70, 0.2, true);
			};
			tile_mc.onRollOut = tile_mc.onReleaseOutside=function () {
				var fadeUp:Tween = new Tween(this, "_alpha", None.easeOut, this._alpha, 100, 0.2, true);
			};
			tile_mc.onRelease = function() {
				//_root.large_mc._visible = true;
				loadNew(galleryFolder+largeAssets[this.ID], _root.large_mc.target_mc, media[this.ID], this.ID);
			};
			if (media[i] == "image") {
				tile_mc.videoicon_mc._visible = false;
			} else if (media[i] == "video") {
				tile_mc.videoicon_mc._visible = true;
			}
		}
		if (vSpacing>maxHSpace) {
			down_mc._visible = true;
		}
	} else {
		trace("Cannot load traditional gallery XML");
	}
};
galleryXML.load(galleryXMLFile);
 
//loadAsset(galleryFolder+largeAssets[this.ID], large_mc.target_mc, media[this.ID], this.ID);
 
function loadNew(asset, target, media, id) {
	MYID = id;
	trace(id);
	if (media == "image") {
		_root.videoplayer_mc._alpha = 0;
		_root.videoplayer_mc._visible = false;
		_root.large_mc._alpha = 0;
		_root.large_mc.target_mc._alpha = 0;
		_root.large_mc.description_mc._alpha = 0;
		_root.large_mc.target_mc.enabled = true;
		_root.blackbox_mc._visible = true;
		_root.large_mc._visible = false;
		_root.large_mc.trad_next_btn._visible = true;
		_root.large_mc.trad_prev_btn._visible = true;
		var fadeBlackBox:Tween = new Tween(_root.blackbox_mc, "_alpha", None.easeOut, _root.blackbox_mc._alpha, 100, 0.3, true);
		_root.large_mc.description_mc.desc_txt.htmlText = descriptions[id];
		smoothImageLoad(asset,target);
	}
	if (media == "video") {
		_root.videoplayer_mc.myPlay(asset);
		_root.videoplayer_mc.description_mc.desc_txt.html = true;
		_root.videoplayer_mc.description_mc.desc_txt.htmlText = descriptions[id];
		_root.musicState = false;
		_root.footer_mc.musicControls_mc.gotoAndStop(2);
		_root.my_sound.stop();
		_root.blackbox_mc._visible = true;
		_root.blackbox_mc._x = 0;
		_root.blackbox_mc._y = 0;
		_root.blackbox_mc._width = Stage.width;
		_root.blackbox_mc._height = Stage.height;
		_root.large_mc._visible = true;
		_root.large_mc.description_mc._alpha = 0;
		_root.large_mc.target_mc._alpha = 0;
		_root.large_mc.target_mc.enabled = false;
		_root.large_mc.trad_next_btn._visible = true;
		_root.large_mc.trad_prev_btn._visible = true;
		_root.large_mc.trad_next_btn.enabled = true;
		_root.large_mc.trad_prev_btn.enabled = true;
		_root.large_mc.trad_prev_btn._x = -_root.videoplayer_mc._width/2-2;
		_root.large_mc.trad_next_btn._x = _root.videoplayer_mc._width/2+2;
		var fadeBlackBox:Tween = new Tween(_root.blackbox_mc, "_alpha", None.easeOut, _root.blackbox_mc._alpha, 100, 0.3, true);
		fadeBlackBox.onMotionFinished = function() {
			_root.videoplayer_mc._visible = true;
			var fadeVideo:Tween = new Tween(_root.videoplayer_mc, "_alpha", None.easeOut, _root.videoplayer_mc._alpha, 100, 0.3, true);
			var fadeVideo2:Tween = new Tween(_root.large_mc, "_alpha", None.easeOut, _root.large_mc._alpha, 100, 0.3, true);
		};
 
	}
}
 
function smoothImageLoad(imgURL, targetMovie) {
	var i = 0;
	do {
		i++;
	} while (eval("_root.smoothImageLoadTemp"+i) != undefined);
	tmc = _root.createEmptyMovieClip("smoothImageLoadTemp"+i, _root.getNextHighestDepth());
	tmc.createEmptyMovieClip("ti",tmc.getNextHighestDepth());
	tmc.tm = targetMovie;
	with (tmc) {
		mcLoader = new MovieClipLoader();
		var mclListener:Object = new Object();
		mcLoader.addListener(mclListener);
		mclListener.onLoadInit = function(mclListener:MovieClip):Void {
			_root.gallery_preloader_mc._alpha = 100;
			_root.large_mc._alpha = 0;
		}
		mclListener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
			percentData = Math.round(100/bytesTotal*bytesLoaded);
			_root.gallery_preloader_mc.gotoAndStop(percentData);
		}
		mclListener.onLoadComplete = function() {
			var hidePreloader:Tween = new Tween(_root.gallery_preloader_mc, "_alpha", None.easeOut, 100, 0, 0.5, true);
			hidePreloader.onMotionFinished = function() {
				_root.large_mc._visible = true;
				var showLarge:Tween = new Tween(_root.large_mc, "_alpha", None.easeOut, 0, 100, 1, true);
 
			}
			ti.onEnterFrame = function() {
				pixelData = new flash.display.BitmapData(ti._width, ti._height);
				_global.LARGEBGW = ti._width;
				_global.LARGEBGH = ti._height;
				pixelData.draw(ti);
				tm.attachBitmap(pixelData,1,true,true);
				tm.smoothImageLoadComplete();
				_root.large_mc.trad_prev_btn.enabled = true;
				_root.large_mc.trad_next_btn.enabled = true;
				_root.position();
				var showTarget:Tween = new Tween(_root.large_mc.target_mc, "_alpha", None.easeOut, 0, 100, 1, true);
				var showDesc:Tween = new Tween(_root.large_mc.description_mc, "_alpha", None.easeOut, 0, 100, 0.4, true);
 
				removeMovieClip(ti._parent);
			};
		};
		mcLoader.loadClip(imgURL,tmc.ti);
	}
}
 
 
up_mc.onRollOver = function() {
	this.gotoAndStop(2);
};
up_mc.onRollOut = up_mc.onReleaseOutside=function () {
	this.gotoAndStop(1);
};
down_mc.onRollOver = function() {
	this.gotoAndStop(2);
};
down_mc.onRollOut = down_mc.onReleaseOutside=function () {
	this.gotoAndStop(1);
};
 
var current:Number = 0;
var animationInProgress:Boolean = false;
var totalViewableThumbs:Number = 21;
 
up_mc.onRelease = function() {
	if (current>0) {
		if (animationInProgress == false) {
			current--;
			down_mc._visible = true;
			var moveThumbs:Tween = new Tween(thumbnails_mc, "_y", Strong.easeInOut, thumbnails_mc._y, thumbnails_mc._y+(thumbnailWidth*3), 1, true);
			animationInProgress = true;
		}
		moveThumbs.onMotionFinished = function() {
			animationInProgress = false;
		};
	} else {
		this._visible = false;
	}
	if (current == 0) {
		this._visible = false;
	}
};
 
down_mc.onRelease = function() {
	//trace(total);
	if (current<Math.floor(total/totalViewableThumbs)) {
		if (animationInProgress == false) {
			current++;
			up_mc._visible = true;
			var moveThumbs:Tween = new Tween(thumbnails_mc, "_y", Strong.easeInOut, thumbnails_mc._y, thumbnails_mc._y-(thumbnailWidth*3), 1, true);
			animationInProgress = true;
		}
		moveThumbs.onMotionFinished = function() {
			animationInProgress = false;
		};
	} else {
		this._visible = false;
	}
	if (current == Math.floor(total/totalViewableThumbs)) {
		this._visible = false;
	}
};
 
 
 
_root.large_mc.trad_prev_btn.onRelease = function() {
	this.enabled = false;
	if (MYID>0) {
		MYID--;
	} else {
		MYID = total-1;
	}
	/*_root.large_mc._visible = true;
	_root.large_mc._alpha = 0;
	_root.large_mc.target_mc.enabled = true;
	_root.large_mc.description_mc.desc_txt.htmlText = descriptions[MYID];
	smoothImageLoad(galleryFolder+largeAssets[MYID],_root.large_mc.target_mc);*/
	loadNew(galleryFolder+largeAssets[MYID], _root.large_mc.target_mc, media[MYID], MYID);
};
 
_root.large_mc.trad_next_btn.onRelease = function() {
	this.enabled = false;
	if (MYID<total-1) {
		MYID++;
	} else {
		MYID = 0;
	}
	/*_root.large_mc._visible = true;
	_root.large_mc._alpha = 0;
	_root.large_mc.target_mc.enabled = true;
	_root.large_mc.description_mc.desc_txt.htmlText = descriptions[MYID];
	smoothImageLoad(galleryFolder+largeAssets[MYID],_root.large_mc.target_mc);*/
	loadNew(galleryFolder+largeAssets[MYID], _root.large_mc.target_mc, media[MYID], MYID);
};
 
 
_root.large_mc.target_mc.onRelease = _root.blackbox_mc.onRelease = function() {
	_root.large_mc.trad_next_btn._visible = false;
	_root.large_mc.trad_prev_btn._visible = false;
	var hideBlackBox:Tween = new Tween(_root.blackbox_mc, "_alpha", None.easeOut, _root.blackbox_mc._alpha, 0, 0.5, true);
	hideBlackBox.onMotionFinished = function() {
		_root.blackbox_mc._visible = false;
	};
	var hideLarge:Tween = new Tween(_root.large_mc, "_alpha", None.easeOut, _root.large_mc._alpha, 0, 0.4, true);
	hideLarge.onMotionFinished = function() {
		_root.large_mc._visible = false;
	};
	_root.large_mc.target_mc.enabled = false;
 
 
	var hideVideo:Tween = new Tween(_root.videoplayer_mc, "_alpha", None.easeOut, _root.videoplayer_mc._alpha, 0, 0.4, true);
	hideVideo.onMotionFinished = function() {
		_root.videoplayer_mc._visible = false;
	};
	_root.videoplayer_mc.ns.pause(true);
	_root.videoplayer_mc.ns.close();
 
};
Voilà le code du XML de la ''Traditional Gallery'':

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
<?xml version="1.0" encoding="utf-8"?>
<gallery fullScreenImages="no">
	<asset type="image" thumbnail="images/thumb1.jpg" large="images/large1.jpg">
		<description><![CDATA[Test description 1]]></description>
	</asset>
	<asset type="video" thumbnail="images/video-logo.jpg" large="videos/video-logo.flv">
		<description><![CDATA[Video 1]]></description>
	</asset>
	<asset type="video" thumbnail="images/vidthumb1.jpg" large="videos/video01.flv">
		<description><![CDATA[Video 1]]></description>
	</asset>
	<asset type="video" thumbnail="images/vidthumb2.jpg" large="videos/video02.flv">
		<description><![CDATA[Video 2]]></description>
	</asset>
	<asset type="video" thumbnail="images/vidthumb3.jpg" large="videos/video03.flv">
		<description><![CDATA[Video 3]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb3.jpg" large="images/large3.jpg">
		<description><![CDATA[Test description 3]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb4.jpg" large="images/large4.jpg">
		<description><![CDATA[Test description 4]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb5.jpg" large="images/large5.jpg">
		<description><![CDATA[Test description 5]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb6.jpg" large="images/large6.jpg">
		<description><![CDATA[Test description 6]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb7.jpg" large="images/large7.jpg">
		<description><![CDATA[Test description 7]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb8.jpg" large="images/large8.jpg">
		<description><![CDATA[Test description 8]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb9.jpg" large="images/large9.jpg">
		<description><![CDATA[Test description 9]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb10.jpg" large="images/large10.jpg">
		<description><![CDATA[Test description 10]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb11.jpg" large="images/large11.jpg">
		<description><![CDATA[Test description 11]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb12.jpg" large="images/large12.jpg">
		<description><![CDATA[Test description 12]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb13.jpg" large="images/large13.jpg">
		<description><![CDATA[Test description 13]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb14.jpg" large="images/large14.jpg">
		<description><![CDATA[Test description 14]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb15.jpg" large="images/large15.jpg">
		<description><![CDATA[Test description 15]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb16.jpg" large="images/large16.jpg">
		<description><![CDATA[Test description 16]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb17.jpg" large="images/large17.jpg">
		<description><![CDATA[Test description 17]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb18.jpg" large="images/large18.jpg">
		<description><![CDATA[Test description 18]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb19.jpg" large="images/large19.jpg">
		<description><![CDATA[Test description 19]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb20.jpg" large="images/large20.jpg">
		<description><![CDATA[Test description 20]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb21.jpg" large="images/large21.jpg">
		<description><![CDATA[Test description 21]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb22.jpg" large="images/large22.jpg">
		<description><![CDATA[Test description 22]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb23.jpg" large="images/large23.jpg">
		<description><![CDATA[Test description 23]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb24.jpg" large="images/large24.jpg">
		<description><![CDATA[Test description 24]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb25.jpg" large="images/large25.jpg">
		<description><![CDATA[Test description 25]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb26.jpg" large="images/large26.jpg">
		<description><![CDATA[Test description 26]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb27.jpg" large="images/large27.jpg">
		<description><![CDATA[Test description 27]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb28.jpg" large="images/large28.jpg">
		<description><![CDATA[Test description 28]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb29.jpg" large="images/large29.jpg">
		<description><![CDATA[Test description 29]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb30.jpg" large="images/large30.jpg">
		<description><![CDATA[Test description 30]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb31.jpg" large="images/large31.jpg">
		<description><![CDATA[Test description 31]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb32.jpg" large="images/large32.jpg">
		<description><![CDATA[Test description 32]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb33.jpg" large="images/large33.jpg">
		<description><![CDATA[Test description 33]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb34.jpg" large="images/large34.jpg">
		<description><![CDATA[Test description 34]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb35.jpg" large="images/large35.jpg">
		<description><![CDATA[Test description 35]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb36.jpg" large="images/large36.jpg">
		<description><![CDATA[Test description 36]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb37.jpg" large="images/large37.jpg">
		<description><![CDATA[Test description 37]]></description>
	</asset>
	<asset type="image" thumbnail="images/thumb38.jpg" large="images/large38.jpg">
		<description><![CDATA[Test description 38]]></description>
	</asset>
</gallery>
Merci pour votre aide.