示例#1
0
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(255, 255, 255);
        //Import a bitmap
        $b = new SWFBitmap(fOpen($imgFile, "rb"));
        //Get it's width and height
        $w = $b->getWidth();
        $h = $b->getHeight();
        //Make stage as big as the width and height of our bitmap
        $movie->setDimension($w, $h);
        //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:)
        $s = new SWFShape();
        $f = $s->addFill($b);
        $s->setRightFill($f);
        //draw corners for the bitmap shape
        $s->drawLine($w, 0);
        $s->drawLine(0, $h);
        $s->drawLine(-$w, 0);
        $s->drawLine(0, -$h);
        //CreateEmptyMovieclip
        $p = new SWFSprite();
        //add our bitmap shape to this movieclip
        $p->add($s);
        $p->nextFrame();
        //Add this movieclip to our main movie's timeline
        //Much like dragging a symbol from the library in Flash.
        $i = $movie->add($p);
        //Give this instance a name.. let's call it mImg as in movie image
        $i->setName("mImg");
        //Output the movie.. Ctrl+Enter!
        // header("Content-Type:application/x-shockwave-flash");
        $movie->output();
    }
    //End if
}
示例#2
0
<?php

$s = new SWFShape();
$fp = fopen('../../intro/php-big.jpg', 'r');
$jpg = new SWFBitmap($fp);
$w = $jpg->getWidth();
$h = $jpg->getHeight();
$f = $s->addFill($jpg);
$f->moveTo(-$w / 2, -$h / 2);
$s->setRightFill($f);
$s->movePenTo(-$w / 2, -$h / 2);
$s->drawLine($w, 0);
$s->drawLine(0, $h);
$s->drawLine(-$w, 0);
$s->drawLine(0, -$h);
$p = new SWFSprite();
$i = $p->add($s);
for ($step = 0; $step < 360; $step += 2) {
    $p->nextFrame();
    $i->rotate(-2);
}
$m = new SWFMovie();
$i = $m->add($p);
$i->moveTo(230, 120);
$m->setRate(100);
$m->setDimension($w * 1.8, $h * 1.8);
header('Content-type: application/x-shockwave-flash');
$m->output(6);
示例#3
0
$src = new SWFSprite();
$src->add($rm);
$src->nextFrame();
$racket_computer = $m->add($src);
$racket_computer->moveTo(630, 215);
$racket_computer->setName("racketComputer");
// Adds the "grass"
$grass_top = $m->add($gm);
$grass_top->moveTo(0, 0);
$grass_bottom = $m->add($gm);
$grass_bottom->moveTo(0, 480);
// Adds the while line
$whiteline = $m->add($wl);
$whiteline->moveTo(316, 0);
// Adds the ball to the movie (within a sprite)
$sb = new SWFSprite();
$sb->add($bm);
$sb->nextFrame();
$ball = $m->add($sb);
$ball->moveTo(316, 240);
$ball->setName("zeBall");
// Adds scores
$score_player = $m->add($sp);
$score_player->moveTo(320 - $f->getWidth("Player : 0") / 3, 20);
$score_computer = $m->add($sc);
$score_computer->moveTo(330, 20);
// Finally, adds signature
$signit = $m->add($signature);
$signit->moveTo(5, 460);
// Hides the mouse (action script code)
$m->add(new SWFAction('Mouse.hide();'));
示例#4
0
 public function AddImage($szPath, $time, $depth, $num, $disp, $isEnd, $effectNum)
 {
     //
     echo "path : ", $szPath, "<br>";
     //exit;
     //$bitmap= new SWFBitmap(fopen($szPath, "rb"));
     $path = "./" . $szPath;
     $bitmap = new SWFBitmap(fopen($szPath, "rb"));
     //$bitmap = new SWFBitmap(fopen($szPath,"rb"));
     $width = $bitmap->getWidth();
     $height = $bitmap->getHeight();
     $cx = $this->m_Width / 2 - $width / 2;
     $cy = $this->m_Height / 2 - $height / 2;
     // add the square to a sprite
     $sprite1 = new SWFSprite();
     $disp_1 = $sprite1->add($bitmap);
     $disp_1->moveTo(-1 * $width / 2, -1 * $height / 2);
     $sprite1->nextFrame();
     $sprite2 = new SWFSprite();
     $disp_1 = $sprite2->add($sprite1);
     $disp_1->moveTo(0, 0);
     $sprite2->nextFrame();
     $disp_1 = $this->m_oMovie->add($sprite2);
     $cx += $width / 2;
     $cy += $height / 2;
     $disp_1->moveTo($cx, $cy);
     $disp_1->setDepth($depth);
     //CString str;
     if ($disp != NULL) {
         if ($effectNum == 0) {
             $this->EffectManage($disp_1, $num - 1);
         } else {
             if ($effectNum == 1) {
                 $this->EffectManage($disp, $num - 1);
             } else {
                 if ($effectNum == 2) {
                     $this->EffectManage2($disp, $disp_1, $num - 1, true);
                     $this->EffectManage2($disp_1, NULL, $num - 1, false);
                 }
             }
         }
         $disp->remove();
     }
     $nTime = $time * $this->FRAMES;
     if ($disp != NULL) {
         $nTime = $nTime + $this->FRAMES;
     }
     if ($isEnd == false) {
         for ($i = 0; $i < $nTime; $i++) {
             $this->m_oMovie->nextFrame();
         }
     }
     return $disp;
 }
示例#5
0
 public function WhiteAndBlack($color)
 {
     // drawing a red square shape (registration point : centered)
     $width = $this->m_Width;
     $height = $this->m_Height;
     //echo "width : $width , height : $height <br>";
     $squareshape = new SWFShape();
     if ($color == "white") {
         $squareshape->setRightFill(255, 0, 0);
     } else {
         $squareshape->setRightFill(0, 0, 0);
     }
     //$squareshape->movePenTo(-$width/2,-$height/2);
     $squareshape->drawLine($width, 0);
     $squareshape->drawLine(0, $height);
     $squareshape->drawLine(-$width, 0);
     $squareshape->drawLine(0, -$height);
     $squaresprite = new SWFSprite();
     $f1 = $squaresprite->add($squareshape);
     //$f1->moveTo(-$width/2,-$height/2);
     $squaresprite->nextFrame();
     $disp = $this->m_oMovie->add($squaresprite);
     $disp->moveTo(-$width, -$height);
     $disp->setDepth($this->m_nColorDepth);
     $this->m_nColorDepth = $this->m_nColorDepth + 1;
     return $disp;
 }
$display_eqp_icons = Nexista_Path::get('//get_sp_pointer_by_id/display_eqp_icons', 'flow');
$my_address_id = Nexista_Path::get('//_get/location_id', 'flow');
$testing = true;
if ($testing) {
    $jpg_file = '/var/www/dev/internetfloorplans/web/s/img/200907_testing.png';
} else {
    $jpg_file = $file . '.png';
}
$sp_clip = new SWFBitmap(fopen($jpg_file, 'r'));
$fpbk = new SWFSprite();
$fpbk->add($sp_clip);
$fpbk->nextFrame();
$y = $m->add($fpbk);
$y->moveTo($x_shift, $y_shift);
$y->setName('background');
$entire_key = new SWFSprite();
$key_label = new SWFTextField(SWFTEXTFIELD_NOSELECT);
$key_label->setBounds(150, 25);
$key_label->setFont($f);
$key_label->setHeight(14);
if ($space_plan_locked === false) {
    $key_label->setColor(0, 0, 0);
    $key_label_text = 'Merchandising Key';
} else {
    $key_label->setColor(255, 0, 0);
    $key_label_text = 'Plan Is Locked';
}
$key_label->addString($key_label_text);
$my_key_label_header = new SWFShape();
$my_key_label_header->setLine(1, 0, 0, 0);
$my_key_label_header->setRightFill(240, 240, 240);