将SWF文件发布到Facebook墙-如何传递自定义参数? [英] Publishing an swf to Facebook wall - how to pass custom param?

查看:82
本文介绍了将SWF文件发布到Facebook墙-如何传递自定义参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的iPhone应用程序将一个Flash项目发布到我的墙上. 瑞士法郎显示在我的墙上,但不幸的是,我没有找到如何将自定义变量(如songUrl)传递给它.

I would like to post a flash item to my wall from my iPhone app. The swf is displayed on my wall, but unfortunalty I didn't found how to pass it a custom variable, like songUrl.

你有个主意吗?

谢谢

推荐答案

将参数传递到嵌入在Facebook Wall帖子中的SWF的唯一方法是将值嵌入SWF的参数中.

The only way you can pass parameters to your SWF which is embedded in a Facebook Wall post is to embed values in the parameter of your SWF.

假设您正在使用Facebook Connect发布到Wall,则SWF的URL必须包含您想要传递给它的任何自定义变量,例如

Assuming you're using Facebook Connect to publish to the Wall, the URL to your SWF must include any custom variables you'd like to pass to it, e.g.

http://...myflashfile.swf?myvar1=foo&myvar2=bar

现在在您的Actionscript代码中(假设您有一个Flex项目),您将完成

Now in your Actionscript code (assuming you've got a Flex project), you'll do

FlexGlobals.topLevelApplication.parameters.myvar1

获取myvar1的值.

to get the value of myvar1.

参考文献:

  • http://www.permadi.com/tutorial/flashQueryString/ (for Flash)
  • http://www.permadi.com/tutorial/flashQueryString/indexAs3.html (for Actionscript/Flex)

这篇关于将SWF文件发布到Facebook墙-如何传递自定义参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆