Posted By

CammoKing on 11/12/09


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

tspitzr
ballen205


AS3 Flash Vars


 / Published in: ActionScript 3
 

  1. // this is used to pass reference to the video size, to dynamically change the playback component size to the video dimensions
  2.  
  3. // in the actionscript
  4. var thisVidWidthVar:String;
  5. var thisVidHeightVar:String;
  6. var thisVidSrc:String;
  7. var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
  8.  
  9. // check to see if var exists, so it doesn't throw errors otherwise
  10. if (paramObj.thisVidSrc){
  11. thisVidSrc = String(paramObj.thisVidSrc);
  12. thisVidWidthVar = String(paramObj.thisVidWidth);
  13. thisVidHeightVar = String(paramObj.thisVidHeight);
  14. }
  15.  
  16. // object params
  17. <param name="FlashVars" value="thisVidSrc=videosrc.flv&thisVidWidth=640&thisVidHeight=480"></param>
  18. // flashVars on embed
  19. <embed flashVars="thisVidSrc=videosrc.flv&thisVidWidth=640&thisVidHeight=480" src="vidPlayer/videoplayer.swf" quality="high" bgcolor="#000000" width="640" height="480" name="videoplayer" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />

Report this snippet  

You need to login to post a comment.