Data sharing between users using flash and php

让人想犯罪 __ 提交于 2019-12-25 13:26:30

问题


I'am searching how to send variables from a php webpage to a flash animation that it will be integrated into another webpage Little example : An user enter his name in an input in a php page then when he clicks submit button, his name will be shown in a flash animation

Any suggestions?


回答1:


If I understood right, you want to have some sort of form processed with user data, then on submit load a different page that holds a flash animation that needs the user data,right?

You can look into flashvars. Basically you can pass any number of key value pairs ( under 64K ) when you embed a flash object and they will be available in the root loader info object.

//access flashvars       
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;

You add the flash vars when embeding the swf. You can use SWFObject. A little snippet:

<script type="text/javascript">

var flashvars = false;
var params = {
  menu: "false",
  flashvars: "name1=hello&name2=world&name3=foobar"
};
var attributes = {
  id: "myDynamicContent",
  name: "myDynamicContent"
};

swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes);

</script>

You can check:

  • swfobjec docs
  • livedocs'loaderinfo



回答2:


Doesn't Flash integrate in with Javascript? I would investigate that because PHP doesn't really interact with Flash other than maybe generating some Javascript to put on the page for flash to interact with.



来源:https://stackoverflow.com/questions/4681056/data-sharing-between-users-using-flash-and-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!