Javascript alert from swf : Ming functions for Flash : Functions PHP Source Code


PHP Source Code » Functions » Ming functions for Flash »

 

Javascript alert from swf


javascript alert with ming from flash movie


<?
/********************************************************************************
* @ File: usingjavascript.php
* @ Original date: December 2003 @ www16.brinkster.com/gazb/ming/
* @ Version: 1.2
* @ Summary: creating a javascript alert with ming : press the button
* @ Updated:  small improvements and summary text
* @ Copyright (c) 2003-2007, www.gazbming.com - all rights reserved.
* @ Author: gazb.ming [[@]] gmail.com - www.gazbming.com 
* @ Released under GNU Lesser General Public License - http://www.gnu.org/licenses/lgpl.html
********************************************************************************/

// some typical movie variables
Ming_setScale(20.0000000);
ming_useswfversion(6);
$movie=new SWFMovie();
$movie->setDimension(550,400);
$movie->setBackground(rand(0,0xFF),rand(0,0xFF),rand(0,0xFF));
$movie->setRate(12); 

$squareshape=new SWFShape(); 
$squareshape->setLine(4,0,0,0); 
$squareshape->setRightFill(255,0,0);
$squareshape->movePenTo(-50,-50); 
$squareshape->drawLine(100,0);  
$squareshape->drawLine(0,100); 
$squareshape->drawLine(-100,0); 
$squareshape->drawLine(0,-100); 

$b = new SWFButton();
$b->addShape($squareshapeSWFBUTTON_HIT SWFBUTTON_UP SWFBUTTON_DOWN SWFBUTTON_OVER);
$b->addAction(new SWFAction("this.geturl('javascript:alert(\'you pressed the button\')');"), SWFBUTTON_MOUSEDOWN);
$i=$movie->add($b);
$i->moveTo(200,200);


// save swf with same name as filename
$swfname basename(__FILE__,".php");
$movie->save("$swfname.swf",9);
?>


HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Functions
» Ming functions for Flash