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 24/11/2010, 01h40   #1
Candidat au titre de Membre du Club
 
Mary F
Inscription : juillet 2010
Messages : 86
Détails du profil
Informations personnelles :
Nom : Mary F

Informations forums :
Inscription : juillet 2010
Messages : 86
Points : 11
Points : 11
Par défaut Prob insertion swf dans tableau (php)

Bonjour,

j'ai créé une animation flash (galerie d'images polaroids superposées). Je souhaite la disposer en bas à gauche de ma page mais lorsque je mets le code d'un tableau, le swf ne s'affiche plus. Avec d'autres swf cela fonctionne.

Quel est mon erreur ?

index.php
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<HTML>
<head>
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
    <TITLE>Campagne</TITLE>
    <!--favicon -->
<LINK REL="SHORTCUT ICON" href="../../favicon2.ico">
<link rel="icon" type="image/gif" href="../../animated_favicon1.gif">
<!--fin favicon -->
 
</head>
<body style="margin:0px" background="/images/campagne3.jpg">
 
    <object id="flashmovie" type="application/x-shockwave-flash" data="gallery.swf" width="100%" height="100%">
        <param name="movie" value="gallery.swf" />
        <param name="wmode" value="transparent">
        <param name="FlashVars" value="<? if(isset($_GET['image'])) echo "topimage=".$_GET['image'] ?>" />
    </object>
 
</body>
</html>
gallery.swf (AS3)
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
38
39
MovieClip.prototype.addProperty("onLoad", function () {
    return __onLoadHandler__[this];
}, function (f) {
    if (__onLoadHandler__ == undefined) {
        _global.__onLoadHandler__ = {};
    }
    __onLoadHandler__[this] = f;
});
Math.easeInQuad = function(t, b, c, d) {
    return c*(t /= d)*t+b;
};
Math.easeOutQuad = function(t, b, c, d) {
    return -c*(t /= d)*(t-2)+b;
};
Stage.scaleMode = "noScale";
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function() {
    nodes = myXML.childNodes;
    // ----------------------
    // find first image
    // ----------------------
    if (topimage.length) {
        for (var i = 0; i<nodes.length; i++) {
            if (nodes[i].attributes.src == topimage) {
                var insert = nodes.slice(0, i);
                nodes.splice(0, i);
                nodes = nodes.concat(insert);
            }
        }
    }
    _root.gotoAndStop(2);
};
if (_url.indexOf("http")>-1) {
    myXML.load("gallery.php");
} else {
    myXML.load("gallery.xml");
}
stop();
gallery.php
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
<?
$xml = '<?xml version="1.0"?'.'>';
$handle = opendir(".");
while ( ($file=readdir($handle)) !== false ) {
    if ( !is_dir($file) ){
        $pic = @getimagesize($file);
        if($pic != false && $pic[2] == 2){
            $xml .= '<img src="'.$file.'" width="'.$pic[0].'" height="'.$pic[1].'" />';
        }
    }
}
echo $xml;
?>
gallery.xml
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?xml version="1.0"?>
<img src="1.jpg" width="300" height="200" />
<img src="2.jpg" width="300" height="200"/>
<img src="3.jpg" width="300" height="200"/>
<img src="4.jpg" width="300" height="200"/>
<img src="5.jpg" width="300" height="200"/>
<img src="6.jpg" width="300" height="200"/>
<img src="7.jpg" width="300" height="200"/>
<img src="8.jpg" width="300" height="200"/>
<img src="9.jpg" width="300" height="200"/>
<img src="10.jpg" width="300" height="200"/>
<img src="11.jpg" width="300" height="200"/>
<img src="12.jpg" width="300" height="200"/>
<img src="13.jpg" width="300" height="200"/>
<img src="14.jpg" width="300" height="200"/>
merci d'avance !
marycandy est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 01/12/2010, 22h26   #2
Candidat au titre de Membre du Club
 
Mary F
Inscription : juillet 2010
Messages : 86
Détails du profil
Informations personnelles :
Nom : Mary F

Informations forums :
Inscription : juillet 2010
Messages : 86
Points : 11
Points : 11
j'ai oublié de mettre le deuxième calque du fichier flash:

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
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
function drawOutline(mc, width, height) {
	var wallx = width/2+10;
	var wally = height/2+10;
	var offset = 4;
	// Shadow
	mc.beginFill(0x000000, 20);
	mc.moveTo(-wallx+offset, -wally+offset);
	mc.lineTo(wallx+offset, -wally+offset);
	mc.lineTo(wallx+offset, wally+offset);
	mc.lineTo(-wallx+offset, wally+offset);
	mc.lineTo(-wallx+offset, -wally+offset);
	// Outline
	mc.beginFill(0xFFFFFF, 100);
	mc.lineStyle(2, 0x333333, 100);
	mc.moveTo(-wallx, -wally);
	mc.lineTo(wallx, -wally);
	mc.lineTo(wallx, wally);
	mc.lineTo(-wallx, wally);
	mc.lineTo(-wallx, -wally);
	mc.endFill();
}
// ----------------------
// build placeholders
// ----------------------
loads = [];
stack = [];
depth = 9999;
for (i=0; i<nodes.length; i++) {
	attrs = nodes[i].attributes;
	img = _root.createEmptyMovieClip("image"+i, depth--);
	drawOutline(img, attrs.width, attrs.height);
	img.createEmptyMovieClip("imgholder", 1);
	img.imgholder._x = -attrs.width/2;
	img.imgholder._y = -attrs.height/2;
	img.imgholder.src = attrs.src;
	totalw += img._width;
	totalh += img._height;
	coverw = (img._width>coverw) ? img._width : coverw;
	coverh = (img._height>coverh) ? img._height : coverh;
	img._rotation = (Math.random()*16)-8;
	img._visible = false;
	img._alpha = 0;
	stack.push(img);
	loads.push(img);
}
stack[0]._rotation = 0;
gox = (totalw/nodes.length)*0.9;
goy = (-totalh/nodes.length)*0.4;
// ----------------------
// load images
// ----------------------
function loadimage(id) {
	if (loads[id]) {
		loads[id]._visible = true;
		loads[id].imgholder.loadMovie(loads[id].imgholder.src);
		loads[id].imgholder.onLoad = function() {
			loads[id].imgholder.onEnterFrame = function() {
				if (this._parent._alpha<75) {
					this._parent._alpha += 25;
				} else if (this._parent._alpha<100) {
					this._parent._alpha += 25;
					loadimage(id+1);
				} else {
					delete this.onEnterFrame;
				}
			};
		};
	}
}
loadimage(0);
// ----------------------
// handle swap
// ----------------------
_root.createEmptyMovieClip("Cover", 10000);
Cover.beginFill(0xFFFFFFF, 0);
Cover.moveTo(-coverw/2, -coverh/2);
Cover.lineTo(coverw/2, -coverh/2);
Cover.lineTo(coverw/2, coverh/2);
Cover.lineTo(-coverw/2, coverh/2);
Cover.lineTo(-coverw/2, -coverh/2);
Cover.endFill();
Cover.onRelease = function() {
	// Shuffle the top image to the side
	stack[0].t = 0;
	stack[0].rot = stack[0]._rotation;
	stack[0].changerot = (Math.random()*16)-8-stack[0].rot;
	stack[0].onEnterFrame = function() {
		this.t++;
		this._x = Math.easeInQuad(this.t, 0, gox, 6);
		this._y = Math.easeInQuad(this.t, 0, goy, 6);
		this._rotation = Math.easeInQuad(this.t, this.rot, this.changerot, 6);
		if (this.t == 7) {
			this.swapDepths(depth--);
			this.t = 0;
			this.onEnterFrame = function() {
				this.t++;
				this._x = Math.easeOutQuad(this.t, gox, -gox, 6);
				this._y = Math.easeOutQuad(this.t, goy, -goy, 6);
				if (this.t == 6) {
					delete this.onEnterFrame;
				}
			};
		}
	};
	// Rotate the next image into view
	stack[1]._x = stack[1]._y=0;
	stack[1].t = 0;
	stack[1].rot = stack[1]._rotation;
	stack[1].onEnterFrame = function() {
		this.t++;
		this._rotation = Math.easeOutQuad(this.t, this.rot, -this.rot, 6);
		if (this.t == 6) {
			delete this.onEnterFrame;
		}
	};
	// Move top image to the back of the stack array
	var addback = stack.shift();
	stack.push(addback);
};
quand je mets un Stage.align ="BL" dans le premier calque voici ce que cela donne:



j'en conclu donc qu'il aligne l'image par rapport au milieu (de plus comme cela les images ne tournent pas)

sans:


J'aimerais que l'alignement se fasse par rapport au point rouge (que ce soit le coin qui soit au coin lorsque je fais un Stage.align ="BL".

Merci d'avance !
marycandy 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 10h04.


 
 
 
 
Partenaires

Hébergement Web