IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Flash Discussion :

Prob insertion swf dans tableau (php)


Sujet :

Flash

  1. #1
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    88
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Juillet 2010
    Messages : 88
    Points : 37
    Points
    37
    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 : 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
    <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 : 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
    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 : Sélectionner tout - Visualiser dans une fenêtre à part
    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 : Sélectionner tout - Visualiser dans une fenêtre à part
    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 !

  2. #2
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    88
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Juillet 2010
    Messages : 88
    Points : 37
    Points
    37
    Par défaut
    j'ai oublié de mettre le deuxième calque du fichier flash:

    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
    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 !

Discussions similaires

  1. Probleme insertion objet dans tableau
    Par Titiii25 dans le forum C++
    Réponses: 11
    Dernier message: 20/04/2009, 21h06
  2. [phpToPDF] Insertion image dans tableau PDF
    Par kanabzh29 dans le forum Bibliothèques et frameworks
    Réponses: 4
    Dernier message: 17/09/2008, 08h29
  3. Insertion image dans tableau
    Par tidoc dans le forum VB.NET
    Réponses: 2
    Dernier message: 30/07/2007, 11h28
  4. resultat requete oracle dans tableau php
    Par tom43 dans le forum Oracle
    Réponses: 1
    Dernier message: 31/07/2006, 18h50
  5. Insertion javascript dans tableau HTML
    Par Rocca dans le forum Général JavaScript
    Réponses: 5
    Dernier message: 08/08/2005, 12h28

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo