像闪光灯按钮自定义的Facebook的(动作) [英] custom facebook like button in flash(actionscript)

查看:370
本文介绍了像闪光灯按钮自定义的Facebook的(动作)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过ActionScript来整合用户的Facebook的喜欢按钮(闪存)编程?

I want to integrate custom facebook like button through ACTIONSCRIPT(Flash) programming?

所有我能得到在互联网上是code。使用JavaScript来产生Facebook的Like按钮。 我想提供给我的自定义按钮相同的功能,

All I could get on the internet is the code to produce facebook Like button using javascript. I want that same functionality to be provided to my custom button,

我不希望用户重定向到其实际的Facebook的Like按钮这中间页。 我试着用中间页,但它过于冗​​长的users.they不得不再次点击该按钮分享。

I don't want users to redirect intermediate page which having actual facebook Like button. I tried with intermediate page but it too lengthy for users.they have to click again on that button to share.

请帮我融入了这个功能。 任何帮助将是巨大的AP preciate。

Please help me to integrate this functionality. any help will be great appreciate.

谢谢, 桑迪普

推荐答案

我不知道,如果你想在闪存或AdobeAir项目,但如果你是移动的,这里的解决方案:的 https://github.com/myflashlab/facebook-ANE

I'm not sure if you are trying on a flash or AdobeAir project but if you are on mobile, here's the solution: https://github.com/myflashlab/facebook-ANE

var like1:LikeBtn = FB.createLikeBtn("https://www.facebook.com/myflashlab", LikeBtn.STYLE_STANDARD, LikeBtn.LINK_TYPE_PAGE, stage);
like1.name = "like" + Math.random();
like1.addEventListener(FBEvent.LIKE_BTN_CREATED, onBtnCreated);
like1.addEventListener(FBEvent.LIKE_BTN_ERROR, onBtnError);
like1.addEventListener(FBEvent.LIKE_BTN_UPDATED, onBtnUpdated);

private function onBtnCreated(e:FBEvent):void
    {
        var btn:LikeBtn = e.target as LikeBtn;
        _btn = btn;

        btn.x = Math.random() * 600;
        btn.y = Math.random() * 600;

        C.log("onBtnCreated, btn.name = " + btn.name);
        C.log("width = " + btn.width);
        C.log("height = " + btn.height);

        btn.update("http://www.myappsnippet.com/", LikeBtn.STYLE_BOX_COUNT, LikeBtn.LINK_TYPE_OPEN_GRAPH);
    }

    private function onBtnError(e:FBEvent):void
    {
        var btn:LikeBtn = e.target as LikeBtn;
        C.log("e.param = " + e.param);
    }

    private function onBtnUpdated(e:FBEvent):void
    {
        var btn:LikeBtn = e.target as LikeBtn;
        C.log("onBtnUpdated");
        C.log("width = " + btn.width);
        C.log("height = " + btn.height);

        /*btn.removeEventListener(FBEvent.LIKE_BTN_CREATED, onBtnCreated);
        btn.removeEventListener(FBEvent.LIKE_BTN_ERROR, onBtnError);
        btn.removeEventListener(FBEvent.LIKE_BTN_UPDATED, onBtnUpdated);
        btn.dispose();
        btn = null;
        C.log("btn.dispose();");*/
    }

这篇关于像闪光灯按钮自定义的Facebook的(动作)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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