Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage
Php > Miscellaneous sample source codes
Basic Example 3
Basic Example 3 setDimension(11000, 8000); $m->setBackground(0x00, 0x00, 0x00); $m->add(new SWFAction(" this.quality = 0; /frames.visible = 0; startDrag('/mouse', 1); ")); // mouse tracking sprite $t = new SWFSprite(); $i = $m->add($t); $i->setName('mouse'); $g = new SWFGradient(); $g->addEntry(0, 0xff, 0xff, 0xff, 0xff); $g->addEntry(0.1, 0xff, 0xff, 0xff, 0xff); $g->addEntry(0.5, 0xff, 0xff, 0xff, 0x5f); $g->addEntry(1.0, 0xff, 0xff, 0xff, 0); // gradient shape thing $s = new SWFShape(); $f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT); $f->scaleTo(0.03); $s->setRightFill($f); $s->movePenTo(-600, -600); $s->drawLine(1200, 0); $s->drawLine(0, 1200); $s->drawLine(-1200, 0); $s->drawLine(0, -1200); // need to make this a sprite so we can multColor it $p = new SWFSprite(); $p->add($s); $p->nextFrame(); // put the shape in here, each frame a different color $q = new SWFSprite(); $q->add(new SWFAction("gotoFrame(random(7) 1); stop();")); $i = $q->add($p); $i->multColor(1.0, 1.0, 1.0); $q->nextFrame(); $i->multColor(1.0, 0.5, 0.5); $q->nextFrame(); $i->multColor(1.0, 0.75, 0.5); $q->nextFrame(); $i->multColor(1.0, 1.0, 0.5); $q->nextFrame(); $i->multColor(0.5, 1.0, 0.5); $q->nextFrame(); $i->multColor(0.5, 0.5, 1.0); $q->nextFrame(); $i->multColor(1.0, 0.5, 1.0); $q->nextFrame(); // finally, this one contains the action code $p = new SWFSprite(); $i = $p->add($q); $i->setName('frames'); $p->add(new SWFAction(" dx = (/:mousex-/:lastx)/3 random(10)-5; dy = (/:mousey-/:lasty)/3; x = /:mousex; y = /:mousey; alpha = 100; ")); $p->nextFrame(); $p->add(new SWFAction(" this.x = x; this.y = y; this.alpha = alpha; x = dx; y = dy; dy = 3; alpha -= 8; ")); $p->nextFrame(); $p->add(new SWFAction("prevFrame(); play();")); $p->nextFrame(); $i = $m->add($p); $i->setName('frames'); $m->nextFrame(); $m->add(new SWFAction(" lastx = mousex; lasty = mousey; mousex = /mouse.x; mousey = /mouse.y; num; if(num == 11) num = 1; removeClip('char' & num); duplicateClip(/frames, 'char' & num, num); ")); $m->nextFrame(); $m->add(new SWFAction("prevFrame(); play();")); header('Content-type: application/x-shockwave-flash'); $m->output(); ?>
Privacy Policy
|
Link to Us
|
Links