init ComboBox (AS3)

posted on 20 Feb 2008 10:43 by xptogo

 

import fl.controls.comboBox;

import fl.data.DataProvider;

Flash CS3 (AS3) Connect PHP and mySQL

posted on 18 Feb 2008 17:21 by xptogo

1. file Flash AS3 in Frame 1

 

import flash.net.navigateToURL;  

import flash.net.URLRequest;  

import flash.net.URLVariables;  

import flash.display.Sprite;  

var btn_cart:Button = new Button()  

            btn_cart.addEventListener(MouseEvent.CLICK, gotoCart);  

            btn_cart.x = 695.0;  

            btn_cart.y = 547.8;  

            btn_cart.label="Add to cart";  

            addChild(btn_cart);  

function gotoCart(event:MouseEvent):void{       

            var url:String = "http://192.168.1.11/flash/checkuser1.php";  

            var request:URLRequest = new URLRequest(url);  

            request.data = variables;  

            var labelcbBg:String  = cbBg.selectedItem.label;  

            var labelFont:String = cmbFonts.selectedItem.label;  

            variables.lblBg = labelcbBg;  

            variables.lblFont = labelFont;  

            variables.txtinput1 = txtInput1.text;  

            variables.txtinput2 = txtInput2.text;  

            variables.txtinput3 = txtInput3.text; 

            variables.txtinput4 = txtInput4.text;   

            variables.test1 = "guest";  

            navigateToURL(request);        

            trace(labelFont);     

  }

 

2. File PHP

session_start();

require("mysql.inc.php");

$name=$_GET['txtinput1'];

$comment=$_GET['txtinput2'];

$tshirt=$_GET['txtinput3'];

$color=$_GET['txtinput4'];

$cmbBg=$_GET['lblBg'];

$cmbFont=$_GET['lblFont'];

$test1=$_GET['test1'];

$SQL="INSERT INTO tbltest(id, txt1, txt2, txt3, txt4, cmbBg, cmbFont)";

$SQL.="VALUES (' ' ,'$name', '$comment', '$color', '$tshirt', '$cmbBg','$cmbFont')";

$result=mysql_query($SQL) or die(mysql_error());

?>

 

edit @ 18 Feb 2008 17:44:59 by pony

edit @ 18 Feb 2008 21:44:08 by pony

edit @ 19 Feb 2008 10:02:02 by pony

set motion Tween In Flash CS3 (Action Script 3)

posted on 18 Feb 2008 10:02 by xptogo
// Import the required transition classes.
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
 
// Create a new instance of the Font1 symbol from the document's library.
var myFont:Font = new Font1();
 
/* Create a new TextFormat object, and set the font property to the myFont
   object's fontName property. */
var myFormat:TextFormat = new TextFormat();
myFormat.font = myFont.fontName;
myFormat.size = 24;
 
/* Create a new TextField object, assign the text format using the 
   defaultTextFormat property, set the embedFonts property to true, set 
   the antiAliasType property to "advanced", and rotate the text field. */
var myTextField:TextField = new TextField();
myTextField.autoSize = TextFieldAutoSize.LEFT;
myTextField.embedFonts = true;
myTextField.antiAliasType = AntiAliasType.ADVANCED;
myTextField.defaultTextFormat = myFormat;
myTextField.text = "The quick brown fox jumped over the lazy dog.";
myTextField.border = true;
myTextField.x = 15;
myTextField.y = 5;
myTextField.rotation = 15;
addChild(myTextField);
 
// Create a new Tween object which will fade the text field's alpha property.
var fadeTween:Tween = new Tween(myTextField, "alpha", Strong.easeIn, 1, 0, 2, true);
fadeTween.addEventListener(TweenEvent.MOTION_FINISH, motionFinishHandler);
 
/* Handler for the fade tween. When the tween dispatches the motionFinish 
   event, this function gets called and reverses the direction of the tween. */
function motionFinishHandler(event:TweenEvent):void {
    Tween(event.currentTarget).yoyo();
}
      
 

edit @ 18 Feb 2008 10:07:20 by pony

edit @ 18 Feb 2008 10:08:20 by pony

<?
session_start();
$bg1='#FFFFFF';
$bg2='#F6F6F6';
require("mysql.inc.php");
$hn=$_SESSION['hn'];
$search_name=$_POST['txt_search_name'];
$sql="SELECT item_id, item_name, item_quantity, item_price FROM item_price WHERE item_name like '%$search_name%' ORDER BY item_id ";
$result=mysql_query($sql);
$num_rows=mysql_num_rows($result);
echo "<table width=100% cellspacing=0' border=1 bordercolor=#EFEFF8>";
echo "<tr ><th>รหัส</th><th>ชื่อยา</th><th>ราคา</th><th>จำนวนยาคงเหลือ</th></tr>";
for($i=0;$i<$num_rows;$i++){
 if(($i%2)==0){
  $bgc=$bg1;
 }else{
  $bgc=$bg2;
 }
    $fetcharr=mysql_fetch_array($result);
 $item_id=$fetcharr['item_id'];
 $item_name=$fetcharr['item_name'];
 $item_quantity=$fetcharr['item_quantity'];
 $item_price=$fetcharr['item_price'];
  //echo"<a href=postmed.php?item_id=$item_id target=_blank><tr height=20 bgcolor=#FFFFFF align=center valign=middle onclick=go2print($row->hn)>\n<TR>";
 echo "<tr bgcolor=$bgc onmouseover=this.style.backgroundColor='#CCddee' onmouseout=this.style.backgroundColor='$bg' OnClick=\"window.open('postmed.php?item_id=$item_id','show','toolbar=0,location=0,directories=0,status=0,menubar=0,height=320,width=780,resizeable=1,scrollbars=1');\"><td withd=10% align=center>$item_id</td><td width=70% align=center>$item_name</td><td width=10% align=center>$item_price</td><td width=10% align=center>$item_quantity</td></tr>\n";
}
 echo"</table>";
?>

edit @ 16 Feb 2008 12:28:59 by pony