Problem in executing script
Ruprecht Helms <[email protected]> 12 Sep 2003 22:30:37 +0200
| Newsgroups | gmane.comp.web.ming.general |
|---|---|
| Message-ID | <[email protected]> |
Hi, I have one shape1 and one shape2 both lying on the same position in different depths. Shape1 should make some animations. Shape2 should stand still as the opposite to shape1. The animation in the code is only set to shape1, but shape2 is doing the animation continuesly after the first loop is ready. In the first loop of the running of the script the result is correct. For the reproduction of the error and help by fixing the problem I've attached the phpscript. Regards, Ruprecht _______________________________________________ ming-fun mailing list [email protected] http://www.opaque.net/mailman/listinfo/ming-fun
shapetest5.php
(text/plain, 4.4 KB)
<?php
//pbMingPics.php
/*##############################################
Jpg2Swf maker with MING
###############################################*/
$imgFile="GlpA-helixA-ribbon5.jpeg";
//function makeImgMovie($imgFile) {
//Make sure this file is an actual jpg file
// if (is_file($imgFile) && ereg("\.jpg$", $imgFile)) {
//Launch Flash
$movie = new swfMovie();
$movie->setBackground(0, 0, 0);
$movie->setRate(30);
//Make stage as big as the width and height of our bitmap
$movie->setDimension(1200,600);
//Import a bitmap
$b = new SWFBitmap(fOpen($imgFile, "rb"));
//Get it's width and height
$w = $b->getWidth();
$h = $b->getHeight();
//Convert Bitmap to a shape for Flash.
//This process is automated upon import in Flash, but with
//Ming we have have to do it ourselves. I see it as more control:)
$s1 = new SWFShape();
$f = $s1->addFill($b);
$s1->setRightFill($f);
//draw corners for the bitmap shape
$s1->drawLine($w, 0);
$s1->drawLine(0, $h);
$s1->drawLine(-$w, 0);
$s1->drawLine(0, -$h);
$s2 = new SWFShape();
$s2->setLine(1,255,255,255);
$s2->drawline(1000,0);
//CreateEmptyMovieclip
$p = new SWFSprite();
$p1 = new SWFSprite();
//add our bitmap shape to this movieclip
$p->add($s1);
$p1->add($s2);
$i = $p->add($s1);
$i = $p1->add($s2);
$p->nextFrame();
$border = $movie->add($p1);
$border->moveTo(30, 100);
$border = $movie->add($p1);
$border->setDepth(3);
$border->moveTo(30,600);
$p1->nextFrame();
//Add this movieclip to our main movie's timeline
//Much like dragging a symbol from the library in Flash.
$helix1 = $movie->add($p);
//move movieobject to this position
$helix1->setDepth(1);
$helix1->moveTo(90, 150);
// some animations of the helix1
for($i=0.0;$i<5;$i=$i+0.5) {
$helix1->moveTo(150+$i,100+$i);
// $helix1->scaleTo(sin($i)/2);
$movie->nextFrame();
}
for ($n=0.0;$n<30;$n=$n+1) {
$helix1->rotateTo($n);
$movie->nextFrame();
}
for ($n=0.0;$n<30;$n=$n+1) {
$helix1->rotateTo(30-$n);
$movie->nextFrame();
}
for($i=5.0;$i<10;$i=$i+0.5) {
$helix1->moveTo(150+$i,100+$i);
// $helix1->scaleTo(sin($i)/2);
$movie->nextFrame();
}
// for ($n=0.0;$n<30;$n=$n+1) {
// $helix1->rotateTo(30-$n);
// $movie->nextFrame();
// }
//for ($n=0.0;$n<30;$n=$n+1) {
// $helix1->rotateTo($n);
// $movie->nextFrame();
// }
for($i=5.0;$i<10;$i=$i+0.5) {
$helix1->moveTo(150+$i,100+$i);
// $helix1->scaleTo(sin($i)/2);
$movie->nextFrame();
}
for($k=0.0;$k<50.0;$k=$k+0.5) {
$helix1->moveTo(200+$k,150);
// $helix1->scaleTo(sin($i)/2);
$movie->nextFrame();
}
for ($n=0.0;$n<30;$n=$n+1) {
$helix1->rotateTo(30-$n);
$movie->nextFrame();
}
for ($n=0.0;$n<30;$n=$n+1) {
$helix1->rotateTo($n);
$movie->nextFrame();
}
for($l=0.0;$l<60.0;$l=$l+0.5) {
$helix1->moveTo(250-$l,150-$l);
// $helix1->scaleTo(sin($i)/2);
$movie->nextFrame();
}
for ($n=0.0;$n<30;$n=$n+1) {
$helix1->rotateTo(30-$n);
$movie->nextFrame();
}
for($m=0.0;$m<40.0;$m=$m+0.5) {
$helix1->moveTo(190-$m,90);
// $helix1->scaleTo(sin($i)/2);
$movie->nextFrame();
}
//Give this instance a name.. let's call it mImg as in movie image
$helix1->setName("mImg");
//Output the movie.. Ctrl+Enter!
header("Content-Type:application/x-shockwave-flash");
$movie->output();
// }End if
//} End function
//The directory where these images reside
//$imgDir = $DOCUMENT_ROOT."/tutorials/ming_bitmap/images/";
//Execute function
//makeImgMovie($imgDir.urldecode($img));
//GoodBye PHP
?>