flash js 传参

来源:互联网 发布:手机做电音的软件 编辑:程序博客网 时间:2024/04/30 06:33

 <script>
 /*function refreshPage(urlstr){
  alert(urlstr);
  //document.getElementById("swf1").url=
  //window.location.href=urlstr;
 }
 */
 function initSwf(){
  for(var i = 1 ; i < 100 ; i ++){
   var flashObj = document.getElementById("swf" + i);
   if(flashObj == undefined || flashObj == null){
    break;
   }
   //alert('initSwf called');
   //alert(flashObj);
   flashObj.SetVariable("seathorizontal","var1");
   flashObj.SetVariable("seathorrent","var2");
   

//   var fla = document.getElementById("swf1");
//   fla.SetVariable("seathorizontal","var1");
  
  }
  
 }
 
 //refreshPage('55555555555555555555555555');
 //refreshPage('5555555555555')
</script>

 

 

<body onLoad="initSwf()">
<object id="swf1" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" >
  <param name="movie" value="seathorizontal.swf">
  <param name="quality" value="high">
  <param name="id" value="swf1">
  <embed src="seathorizontal.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
</object>
<object id="swf2" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" >
  <param name="movie" value="seathorrent.swf">
  <param name="quality" value="high">
  <param name="id" value="swf2">
  <embed src="seathorrent.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
</object>

 

flash

 

 import flash.display.BitmapData;
 import flash.geom.Matrix;
 import flash.geom.ColorTransform;
 import flash.geom.Rectangle;
 
if(_root.seathorrent != undefined){
    seatnum_txt.text = _root.seathorrent;
   
    setTxtContent(_root.seathorrent);
   
    stop();
}
else
{
 gotoAndPlay(2);
}

function setTxtContent(content:String){
 
_root.createTextField("dy_txt", 1, 105, 50, 100, 35);

with (dy_txt) {
background = true;
backgroundColor = 0x003366;
type = "dynamic";
text = content;
textColor = 0xffffff;
}

 var style_fmt:TextFormat = new TextFormat();
 style_fmt.font = "Verdana (embedded)";
 style_fmt.size = 20;
 dy_txt.setTextFormat(style_fmt);


var bp:BitmapData = new BitmapData(dy_txt._width, dy_txt._height, false);

this.createEmptyMovieClip("_mc", 2);
bp.draw(dy_txt, new Matrix(), new ColorTransform(), normal, new Rectangle(0, 0, dy_txt._width, dy_txt._height), true);


bp.draw(dy_txt);

_mc.attachBitmap(bp, 1);

_mc._x = dy_txt._x;
_mc._y = dy_txt._y;
dy_txt._visible = false;
_mc._rotation = 90;

}

 

stop();
function num_dec() {
 if (num>0) {
    num--;
 } else {
    clearInterval(myInterval);
    gotoAndPlay(1);
 }
}
myInterval = setInterval(num_dec, 1000);