Why this code is not working on PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lam thai
    New Member
    • Feb 2007
    • 1

    Why this code is not working on PHP

    Always getting:
    Fatal error: SWFAction::__co nstruct() [<a href='function. SWFAction---construct'>func tion.SWFAction---construct</a>]: / ^ Line 1: Reason: 'syntax error' in C:\www\test\tes t1.php on line 31

    <?php
    $s = new SWFShape();
    $f = $s->addFill(0xff , 0, 0);
    $s->setRightFill($ f);

    $s->movePenTo(-500, -500);
    $s->drawLineTo(500 , -500);
    $s->drawLineTo(500 , 500);
    $s->drawLineTo(-500, 500);
    $s->drawLineTo(-500, -500);

    $p = new SWFSprite();
    $i = $p->add($s);
    $i->setDepth(1);
    $p->nextFrame();

    for ($n=0; $n<15; ++$n) {
    $i->rotate(-15);
    $p->nextFrame();
    }

    $m = new SWFMovie();
    $m->setBackground( 0xff, 0xff, 0xff);
    $m->setDimension(6 000, 4000);

    $i = $m->add($p);
    $i->setDepth(1);
    $i->moveTo(3000,20 00);
    $i->setName("box") ;

    $m->add(new SWFAction("/box.x += 103;"));
    $m->nextFrame();
    $m->add(new SWFAction("goto Frame(0); play();"));
    $m->nextFrame();

    header('Content-type: application/x-shockwave-flash');
    $m->output();
    ?>


    Any ideas?

    PHP Version: 5.1.6
    Ming: 0.3beta1
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    Originally posted by Lam thai
    Always getting:
    Fatal error: SWFAction::__co nstruct() [<a href='function. SWFAction---construct'>func tion.SWFAction---construct</a>]: / ^ Line 1: Reason: 'syntax error' in C:\www\test\tes t1.php on line 31

    <?php
    $s = new SWFShape();
    $f = $s->addFill(0xff , 0, 0);
    $s->setRightFill($ f);

    $s->movePenTo(-500, -500);
    $s->drawLineTo(500 , -500);
    $s->drawLineTo(500 , 500);
    $s->drawLineTo(-500, 500);
    $s->drawLineTo(-500, -500);

    $p = new SWFSprite();
    $i = $p->add($s);
    $i->setDepth(1);
    $p->nextFrame();

    for ($n=0; $n<15; ++$n) {
    $i->rotate(-15);
    $p->nextFrame();
    }

    $m = new SWFMovie();
    $m->setBackground( 0xff, 0xff, 0xff);
    $m->setDimension(6 000, 4000);

    $i = $m->add($p);
    $i->setDepth(1);
    $i->moveTo(3000,20 00);
    $i->setName("box") ;

    $m->add(new SWFAction("/box.x += 103;"));
    $m->nextFrame();
    $m->add(new SWFAction("goto Frame(0); play();"));
    $m->nextFrame();

    header('Content-type: application/x-shockwave-flash');
    $m->output();
    ?>


    Any ideas?

    PHP Version: 5.1.6
    Ming: 0.3beta1
    Welcome to The Scripts.
    Try removing the / from in front of box.x. Unless you want it there. Then I don't know.

    Comment

    Working...