Connecting Tech Pros Worldwide Forums | Help | Site Map

Why this code is not working on PHP

Newbie
 
Join Date: Feb 2007
Posts: 1
#1: Feb 7 '07
Always getting:
Fatal error: SWFAction::__construct() [<a href='function.SWFAction---construct'>function.SWFAction---construct</a>]: / ^ Line 1: Reason: 'syntax error' in C:\www\test\test1.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(6000, 4000);

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

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

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


Any ideas?

PHP Version: 5.1.6
Ming: 0.3beta1

Motoma's Avatar
Moderator
 
Join Date: Jan 2007
Location: Maine, USA
Posts: 2,904
#2: Feb 7 '07

re: Why this code is not working on PHP


Quote:

Originally Posted by Lam thai

Always getting:
Fatal error: SWFAction::__construct() [<a href='function.SWFAction---construct'>function.SWFAction---construct</a>]: / ^ Line 1: Reason: 'syntax error' in C:\www\test\test1.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(6000, 4000);

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

$m->add(new SWFAction("/box.x += 103;"));
$m->nextFrame();
$m->add(new SWFAction("gotoFrame(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.
Reply